- Joined
- Sep 11, 2011
- Messages
- 1,176
hello everyone!
i'm helping someone to make a system that kills all unit inside a transport when the transport died. but it seems that my trigger didn't work properly. take a look :
the hashtable should save all unit that's loaded into the transport
P.S i already create a hashtable, and make a trigger that detects when the transport is in the map.
i'm helping someone to make a system that kills all unit inside a transport when the transport died. but it seems that my trigger didn't work properly. take a look :
-
Loading Units
-
Events
- Unit - A unit Is loaded into a transport
- Conditions
-
Actions
-
For each (Integer IntegerVariable) from 1 to TransportCount, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Transporting unit) Equal to Transport[IntegerVariable]
-
Then - Actions
- Set PassengerCount[IntegerVariable] = (PassengerCount[IntegerVariable] + 1)
- Game - Display to (All players) the text: (Transport name : + ((Name of Transport[IntegerVariable]) + ( Number + (String(IntegerVariable)))))
- Game - Display to (All players) the text: (Number of Passengers : + (String(PassengerCount[IntegerVariable])))
- Hashtable - Save Handle Of(Triggering unit) as IntegerVariable of PassengerCount[IntegerVariable] in hash
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer IntegerVariable) from 1 to TransportCount, do (Actions)
-
Events
-
Dead Transports
-
Events
- Unit - A unit Dies
- Conditions
-
Actions
-
For each (Integer IntegerVariable) from 1 to TransportCount, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Triggering unit) Equal to Transport[IntegerVariable]
-
Then - Actions
-
For each (Integer IntegerVariable2) from 1 to PassengerCount[IntegerVariable], do (Actions)
-
Loop - Actions
- Game - Display to (All players) the text: (Name of (Load IntegerVariable of IntegerVariable2 in hash))
- Unit - Kill (Load IntegerVariable of IntegerVariable2 in hash)
-
Loop - Actions
-
For each (Integer IntegerVariable2) from 1 to PassengerCount[IntegerVariable], do (Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer IntegerVariable) from 1 to TransportCount, do (Actions)
-
Events
- Hashtable - Save Handle Of(Triggering unit) as IntegerVariable of PassengerCount[IntegerVariable] in hash
P.S i already create a hashtable, and make a trigger that detects when the transport is in the map.