1
OXCE Support Y-scripts / Re: [Solved]Skip Player first turn (battlescape) per mission (boolean)
« on: October 14, 2023, 02:51:04 am »
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:
PS:
Again this script wouldn't have been possible without you guys, thank you so much!
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!