I want to order a player's unit to open their spellbook ability, but only that unit. For some reason there are bugs with this that make other players lose their abilities (as if their selected unit has opened a spellbook).
I decided to use the GetLocalPlayer() custom script, which I don't really understand. It is now disconnecting players and crashes the game in single player. These are the triggers that cause it.
Trigger #1: this occurs when a player selects the unit with the spellbook ability
Is there a tutorial for GetLocalPlayer()? Does anyone see what's wrong with this? I used this custom script in other areas and it worked, but I don't really understand it.
I decided to use the GetLocalPlayer() custom script, which I don't really understand. It is now disconnecting players and crashes the game in single player. These are the triggers that cause it.
Trigger #1: this occurs when a player selects the unit with the spellbook ability
-
Selection Event Rebel
-
Events
-
Conditions
-
(Unit-type of (Triggering unit)) Not equal to Rebel Command Control
-
-
Actions
-
Set tempPlayer = (Triggering player)
-
Set tempInteger = (Player number of tempPlayer)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
defaultSelection[tempInteger] Not equal to (Triggering unit)
-
(defaultSelection[tempInteger] is alive) Equal to True
-
Or - Any (Conditions) are true
-
Conditions
-
(defaultSelection[tempInteger] is A Hero) Equal to False
-
((Triggering unit) is in FlareShuttles) Equal to True
-
-
-
-
Then - Actions
-
Selection - Clear selection for tempPlayer
-
Selection - Select defaultSelection[tempInteger] for tempPlayer
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Triggering unit) is A Hero) Equal to False
-
((Triggering unit) is Mechanical) Equal to False
-
-
Then - Actions
-
-
-
-
-
-
[B] Set zUnit = (Triggering unit)
-
Set MBint = tempInteger
-
Trigger - Run zPress Trigger <gen> (ignoring conditions)[/B]
-
Else - Actions
-
Skip remaining actions
-
-
-
zPress Trigger
-
Events
-
Conditions
-
Actions
-
Set MBint = (MBint - 1)
-
Custom script: if GetLocalPlayer() == Player(udg_MBint) then
-
Custom script: call IssueImmediateOrderById (udg_zUnit, 852608)
-
Custom script: endif
-
-
Is there a tutorial for GetLocalPlayer()? Does anyone see what's wrong with this? I used this custom script in other areas and it worked, but I don't really understand it.