Detection Problem

Status
Not open for further replies.
Well, PurgeandFire answered chilla_killa on how to detect unloading.

Here's how:
  • UnitLoaded
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
    • Actions
      • Unit Group - Add (Triggering unit) to TransportGroup
      • Game - Display to (All players) the text: ((Name of (Triggering unit)) + was loaded!)
  • UnitLeaves
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in TransportGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is being transported) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from TransportGroup
              • Game - Display to (All players) the text: ((Name of (Picked unit)) + was unloaded!)
            • Else - Actions
What I want is that, how can I detect on what Unit Group is the Transport on.
Cause I really need to check what unit group the transport belongs (not the transported unit).

Thank you for your help :D
 
Level 8
Joined
Jan 8, 2008
Messages
454
Well in the second part after (picked unit is being transported = false)

also have an and then (Unit-type of (Transporting unit)) Equal to (Unit-type of (Random unit from(*Unit group*)) Just pop that in to detect if the unloading unit leaves that vehicle then your events will happen.

Does that work?
 
Level 8
Joined
Jan 8, 2008
Messages
454
!!!!!!!!!!!! Now what D:

Edit: Add the transporter into the unit group also then when the unit leaves the group if the transporting unit = *unit* remove it from the unit group. If not it won't affect the unit.
 
Last edited:
Level 15
Joined
Aug 14, 2007
Messages
936
Basically you have to use an array of unitgroup!

When unit is transported

success = false
for lOOpA (loop through all){
if transporter equal the guy in array {
then success = true
add target unit to group
}

}

if success = false
for lOOpA (loop through all) {
if (guy in array equal no unit and success false) {
add target to group
success = true

}
}

That should do for now, ;D hope it works
 
Status
Not open for further replies.
Top