{Triggering} Transports

Gwafu

Active Member
Reaction score
12
Well I got these two triggers, they are too long to be posted. I'll just explain what it does.

First of all, every 0.50 seconds, there is another trigger (doesn't belong to the two) that pick every Gnome Ark (the transport) on the map, then check if they are not belong to the 8 groups. And if the picked unit is not, it will add to Unit Group [0].

The first trigger has an the event "Unit - A unit is loaded into a transport". Then there's the condition if the loaded unit is a Rifleman. Then if it is, it will add the Transport the Unit group.
There will be 9 unit groups.
Unit Group [0-9]
If the unit is in UG [0]. It will remove the transport from UG [0] and add it to UG [1] and add the ability (I won't explain what is it, it is not important)

The second trigger IS the problem. What I want is that, when the Rifleman is unloaded from the Transport, it will check the LOADER of the Rifleman and check what Unit Group it is and remove the ability.

Help me plox :>
 

Gwafu

Active Member
Reaction score
12
Trigger:
  • Gnome Ark Multishot
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
      • (Unit-type of (Loading unit)) Equal to Elven Ranger
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Transporting unit) is in Ark[1]) Equal to True
        • Then - Actions
          • Unit - Add Dummy 1 to (Transporting unit)
          • Unit Group - Add (Transporting unit) to Ark[2]
          • Unit Group - Remove (Transporting unit) from Ark[1]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Transporting unit) is in Ark[2]) Equal to True
            • Then - Actions
              • Unit - Add Dummy 2 to (Transporting unit)
              • Unit Group - Add (Transporting unit) to Ark[3]
              • Unit Group - Remove (Transporting unit) from Ark[2]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Transporting unit) is in Ark[3]) Equal to True
                • Then - Actions
                  • Unit - Add Dummy 3 to (Transporting unit)
                  • Unit Group - Add (Transporting unit) to Ark[4]
                  • Unit Group - Remove (Transporting unit) from Ark[3]
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Transporting unit) is in Ark[4]) Equal to True
                    • Then - Actions
                      • Unit - Add Dummy 4 to (Transporting unit)
                      • Unit Group - Add (Transporting unit) to Ark[5]
                      • Unit Group - Remove (Transporting unit) from Ark[4]
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Transporting unit) is in Ark[5]) Equal to True
                        • Then - Actions
                          • Unit - Add Dummy 5 to (Transporting unit)
                          • Unit Group - Add (Transporting unit) to Ark[6]
                          • Unit Group - Remove (Transporting unit) from Ark[5]
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Transporting unit) is in Ark[6]) Equal to True
                            • Then - Actions
                              • Unit - Add Dummy 6 to (Transporting unit)
                              • Unit Group - Add (Transporting unit) to Ark[7]
                              • Unit Group - Remove (Transporting unit) from Ark[6]
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • ((Transporting unit) is in Ark[7]) Equal to True
                                • Then - Actions
                                  • Unit - Add Dummy 7 to (Transporting unit)
                                  • Unit Group - Add (Transporting unit) to Ark[8]
                                  • Unit Group - Remove (Transporting unit) from Ark[7]
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • ((Transporting unit) is in Ark[8]) Equal to True
                                    • Then - Actions
                                      • Unit - Add Dummy 8 to (Transporting unit)
                                      • Unit Group - Add (Transporting unit) to Ark[9]
                                      • Unit Group - Remove (Transporting unit) from Ark[8]
                                    • Else - Actions


well, the abilities are the same, they are all the same Phoenix Fire.
Why? Cause I want multishot :p
 

Carnerox

The one and only.
Reaction score
84
Well I am heading off to bed, if some how you don't figure out how to fix it or some one else fixes it, I'll do it tomorrow. Sorry. :thup:
 

Gwafu

Active Member
Reaction score
12
someone said store the id of the Transport into hashtables. But I don't use hash :/
 

perkeyone

something clever
Reaction score
71
would it be ok to just remove the ability once you remove it from that group?

like this?
Code:
# Then - Actions

    * Unit - Add Dummy 1 to (Transporting unit)
    * Unit Group - Add (Transporting unit) to Ark[2]
    * Unit Group - Remove (Transporting unit) from Ark[1]
    //remove the ability here
if you need the ability to be removed as soon as the unit is unloaded, then what i posted wont work.
 

Gwafu

Active Member
Reaction score
12
NO. i want the transport to multishot when a Rifleman enters. And when a rifleman unloads, remove the ability given to the transport of his unit group.
 

Seprest

New Member
Reaction score
15
Couldn't you have been more creative with your nested loops?

coly+paste+replace makes me sad =(


I don't quite get EXACTLY what you want in your head.


It seems like you have the whole unit group switching figurued out, but why can't you just check IF the loader had X ability THEN remove X ability from loader ELSE do nothing.

Could you post the second trigger please?
Post them please. :rolleyes:
 

Gwafu

Active Member
Reaction score
12
sigh...I'LL EXPLAIN.
So there will be 8 Abilities based on Phoenix Fire.
Then a Unit Group (Ark) with array.
Then there is another trigger (NEVERMIND IT, IT IS NOT IMPORTANT) that periodically picks every Gnome Ark (the Transport) on the map and if the Ark is on Unit Groups 2 - 9. If not, he will add the Ark in Unit Group [1].
When an Elven Ranger (I said Rifleman to avoid confusions) loads into the Gnome Ark, it will check if the Ark is in Unit Group [1], then remove from UG [1], add Dummy 1, then add to UG [2]. Then so on.

My problem is that when an Elven Ranger unloads, how can I check what Unit Group does the TRANSPORTING UNIT (the one that unloads the Elven Ranger) does he belong.

Did you get what I need?

(Note: Gnome Arks and Elven Rangers are not single units. THEY ARE TRAINED, like in melee.)
 

Seprest

New Member
Reaction score
15
Are you just looking for-

Trigger:
  • ((Triggering unit) is in (Ark[x]))) Equal to True

???
 

Gwafu

Active Member
Reaction score
12
Well....
There will be two options
(A) If I'll use that, how can I detect unloading?

(B)A nice coder, i mean VERY NICE (PurgeandFire to be specific) just answered a thread on the Hive on how to detect unloading.
And here it goes.
There will be two triggers.
Trigger:
  • 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!)

Trigger:
  • 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

With that, HOW COULD I USE THE GUI LINE?
 

Seprest

New Member
Reaction score
15
I don't know =( IDK why blizzard didn't add a -unloading unit- or -unit is transporting- variable.


Trigger:
  • ((Unit-type of (Triggering unit)) Equal to Gnome Ark) and ((Ability being cast) Equal to Unload (Air Transports))

Detects the unload ability though -random-
 

Gwafu

Active Member
Reaction score
12
I know that, but how would I know what is the kind of unit unloaded?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top