aliens

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - thusky

Pages: [1] 2
1
Thanks to you Yankes and Filip H from the I.D.T Discord server I learnt a lot and the script is complete!

This script sets the player's units to 0 TU on their first turn and back to their max TU on the enemy turn!

Best to place the dummy item to enable the script in aliendeployments.rul

The snippet:

Code: [Select]
#------Dummy item to place in the battlescape for the script to work
items:
  - type: STR_TURN_SKIP
    categories: [STR_LOGIC]
    tags:
      ITEM_SKIP_TAG: 1

# Script allowing Xcom: Rising from the deep to set the player's units TU to 0 in battlescape and let the unit regain TU for the second turn.
extended:
  tags:
    BattleGame:
      BATTLE_SKIP_TAG: int
    RuleItem:
      ITEM_SKIP_TAG: int

  scripts:
  #---If there is an item with skip first turn tag, then set the battlescape tag to skip first turn.
    createItem:
      - offset: 21
        code: |
          var int isSkipItem;
          var int battleGameObject;

          item.getTag isSkipItem Tag.ITEM_SKIP_TAG;

          if eq isSkipItem 1;
          battle_game.setTag Tag.BATTLE_SKIP_TAG 1;
          end;
          return;


  #---Check if it's the 1st turn, check if the units are from the player, check if the dummy item is present on the map, then set the units to 0 TU, enemy turn set them to their max TU.
    newTurnUnit:
      - offset: 22
        code: |
          var int isPlayerUnit;
          var int maxUnitTu;
          var int isEnemyTurn;
          var int battleGameObject;

          unit.getFaction isPlayerUnit;
          unit.getTimeUnitsMax maxUnitTu;
          battle_game.getTurnSide isEnemyTurn;
          battle_game.getTag battleGameObject Tag.BATTLE_SKIP_TAG;

          if eq turn 1;
            if eq battleGameObject 1;
              if eq isPlayerUnit 0;
              unit.setTimeUnits 0 ;
                if eq isEnemyTurn 1;
                unit.setTimeUnits maxUnitTu;
                end;
              end;
            end;
          end;
          return;

PS:
Again this script wouldn't have been possible without you guys, thank you so much!

2
Thanks! With this I'll go in that direction then, I'll report back whenever I hit a hard wall, I'm likely gonna try and try again until it works.

3
Got it,

Do you think this is the best approach? To create a dummy item to give to units when battle start to "simulate" a boolean?

Or is there some other way I could trigger this script on and off on demand? The old one I mean (it works without issues).

4
I'm pretty much a novice and really dumstruck when it comes to anything script related (that involves any logic), I mostly spend my days drawing, creating 3D art and pixel art.

As such I'd say that's pretty much the reason why some things that might seem clear aren't to me ahah.

Thanks though I'll get right on it then, I hope this is the only issue with the script!

So yep, no particular reason why I used item.getTag aside from lack of logic/patience when it comes to anything script related.

5
I did and this is what I got:

[13-10-2023_17-30-08]   [ERROR]   Can't match overload for operator 'BattleItem.getTag' for:
[13-10-2023_17-30-08]   [ERROR]     [ptre BattleItem] [var int] [BattleGame.Tag]
[13-10-2023_17-30-08]   [ERROR]   Expected:
[13-10-2023_17-30-08]   [ERROR]     [ptr BattleItem] [var int] [RuleItem.Tag]
[13-10-2023_17-30-08]   [ERROR]     [ptr BattleItem] [var int] [BattleItem.Tag]
[13-10-2023_17-30-08]   [ERROR]   Error in parsing script 'createItem' for 'Global Event Script': invalid operation in line: 'item.getTag isSkipTurn Tag.SKIP_TAG;'
[13-10-2023_17-30-08]   [ERROR]   Unknown argument 'Tag.isSkipTurn'
[13-10-2023_17-30-08]   [ERROR]   Error in matching arguments for operator 'BattleGame.getTag'
[13-10-2023_17-30-08]   [ERROR]   Error in parsing script 'newTurnUnit' for 'Global Event Script': invalid operation in line: 'battle_game.getTag isSkipTurnPointer Tag.isSkipTurn;'
[13-10-2023_17-30-08]   [ERROR]   Error in tags: 'SKIP_TAG' unknown tag name not defined in current file


I've been trying different things to remove the errors but aside from reverting to the old code which works 100% of the time I'm a tad lost. Still I'll keep trying then.

6
The first script works but doesn't allow me to turn it on/off on demand, which is a problem.

The second script doesn't work as nothing happens, I still have my first turn as the player whereas all my units should all have 0 TU until the second turn.

The question is "How can I make this script work?" basically, or what other kind of designs could I go for to create something similar to a boolean using the old script.

7
Hello,

Been a while since I last posted and worked on my mod, I'm back one year later and working on a script I worked on before. The idea of this script would be to skip the player's first turn only for certain mission, as such I'd like to be able to control this boolean (true/false) per mission.

I had a previously working prototype of the script which "Filip H" (discord) helped me make, however this version didn't allow me to control when I wanted this feature to be active, it was basically always active.

The old version:

Code: [Select]
# Script allowing Xcom: Rising from the deep to always skip first turn in battlescape and let the unit regain TU for the second turn.
extended:
  scripts:
    newTurnUnit:
      - offset: 21
        code: |
          var int isPlayerUnit;
          var int maxUnitTu;
          var int isEnemyTurn;

          unit.getFaction isPlayerUnit;
          unit.getTimeUnitsMax maxUnitTu;
          battle_game.getTurnSide isEnemyTurn;

          if eq turn 1;
            if eq isPlayerUnit 0;
            unit.setTimeUnits 0 ;
              if eq isEnemyTurn 1;
              unit.setTimeUnits maxUnitTu;
              end;
            end;
          end;
          return;

In the new version, I'm trying to add an item through the alienDeployments.rul with [ExtraRandomItems], however that wouldn't work on the long run, there surely is a better way to make a boolean to control the skip first turn per mission.

The new (WIP) version, which currently doesn't work:

Code: [Select]
#------DUMMY ITEM FOR BATTLETURN SKIP
items:
  - type: STR_TURN_SKIP
    categories: [STR_LOGIC]
    tags:
      SKIP_TAG: 1
# Script allowing Xcom: Rising from the deep to always skip first turn in battlescape and let the unit regain TU for the second turn.
extended:
  tags:
    BattleGame:
     SKIP_TAG: int

  scripts:
  #---Check if SKIP_TAG is present to skip first turn or not
    createItem:
      - offset: 21
        code: |
          var int isSkipTurn;

          item.getTag isSkipTurn Tag.SKIP_TAG;

          return;

  #---Skip First Turn
    newTurnUnit:
      - offset: 22
        code: |
          var int isPlayerUnit;
          var int maxUnitTu;
          var int isEnemyTurn;
          var int isSkipTurnPointer;
         
          unit.getFaction isPlayerUnit;
          unit.getTimeUnitsMax maxUnitTu;
          battle_game.getTurnSide isEnemyTurn;
          battle_game.getTag isSkipTurnPointer Tag.isSkipTurn;

          if eq isSkipTurnPointer 1;
            if eq turn 1;
              if eq isPlayerUnit 0;
              unit.setTimeUnits 0 ;
                if eq isEnemyTurn 1;
                unit.setTimeUnits maxUnitTu;
                end;
              end;
            end;
          end;
          return;

So all in all, a way to enable/disable skip first turn per mission.


EDIT:
Solution Down Below.

8
Tools / Re: MAPVIEW upgrade
« on: August 24, 2022, 11:10:55 pm »
I just duplicated my whole mapview working folder personally, no errors so far so I kept working, the ability to change colors is a boon for sure, I feel much better working with Mapview now, I can't stress how much this will help me on the long run!

it's things like this that makes me want to boot the software more often!

9
Tools / Re: MAPVIEW upgrade
« on: August 24, 2022, 09:50:47 pm »
Just shared your update on the discord servers! I'll be sure to report anything unusual/buggy so you know what's up, again big thanks for your work, it's a big help for my eyes ahah!

10
Tools / Re: MAPVIEW upgrade
« on: August 18, 2022, 12:58:06 pm »
color schemes ... surprisingly nontrivial

but gettin there
Thank you for your hard work! I already hyped both discord servers about your color schemes upgrade!

11
Tools / Re: MAPVIEW upgrade
« on: August 12, 2022, 02:30:01 pm »
Quote
oh its beginning to look lovely (screenshot2)

It's awesome! I'm sure your work will benefit many other modders as well, big thanks KevL!

12
Tools / Re: MAPVIEW upgrade
« on: August 10, 2022, 08:16:15 pm »
Yeah background/foreground color is what dark mode is all about, font size wasn't my request it was to make things more readable to me and you ahah.

Thank you so much for your time!

13
Tools / Re: MAPVIEW upgrade
« on: August 10, 2022, 01:33:22 pm »
well, i was kinda wondering about that (screenshot 1) but more about 2

did you increase fontsize in Win OS ?

I did actually! I also tweaked the font in pixel art to make some part more readable to you as a ref, even though the text on the left is pretty unreadable I'll admit!

14
Tools / Re: MAPVIEW upgrade
« on: August 10, 2022, 10:16:32 am »
am trying to finish a big update on another project atm - ill take a closer look sometime, maybe implement user-options for those ...
Awesome!


Quote
ps. Is the font in your MapTree really that borky... ?
You mean the front of the top view being that big? It's because I increase the size to see more clearly or did you refer to something else?

15
Tools / Re: MAPVIEW upgrade
« on: August 09, 2022, 12:39:56 pm »
Alright I'll see what I can tweak in windows already!

Here are a few modified screenshots to show roughly what I had in mind just in case!

No worries though I can work in mapview already, if it's too much work might not be worth it if I'm the only one asking.

Pages: [1] 2