there probably is no answer but...

Status
Not open for further replies.
Level 3
Joined
Jul 29, 2008
Messages
30
Im trying to detect how many units are inside a transport. Basically to determine if its full or not. I'm having a lot of trouble with this though.

I'd use the custom value if I could but i cant its already in use for another system on my map.

I was thinking of enumerating all units on the map then determining which are inside the transport. but i couldnt get it to work right...

Anyone else have any thoughts on this? I think it might be impossible though...
 
here it comes:

  • Check
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Load (Goblin Zeppelin)
    • Actions
      • Set u = (Triggering unit)
      • Set p = (Owner of u)
      • -------- these are the units which are loaded into the triggering unit --------
      • -------- units within playable map area would not work because the loaded units are not in the map --------
      • Set g = (Units owned by p matching (((Matching unit) is loaded into u) Equal to True))
      • -------- +1 because the unit which is loaded right now is not in the transporter yet --------
      • Floating Text - Create floating text that reads ((String(((Number of units in g) + 1))) + units loaded) above u with Z offset 0.00, using font size 10.00, color (50.00%, 50.00%, 50.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
      • Floating Text - Change (Last created floating text): Disable permanence
      • -------- removes leak --------
      • Custom script: call DestroyGroup( udg_g )
 

Attachments

  • HowManyUnitsLoaded.w3x
    18 KB · Views: 50
Level 3
Joined
Jul 29, 2008
Messages
30
I forgot to mention that actually through other trigers units from OTHER players will be inside the transports, even enemies! But this is a d*** good start thanks! any other sugestions
 
Level 3
Joined
Jul 29, 2008
Messages
30
No it works for multiple I assume I only need to detect when they are using a certain ability how many are in THAT unit. I had tried something similar to this before but no I realize that I was using units in playable map area. Perhaps I should learn to use hashtables though as it could be useful
 
Use hashtables to attach the value to the unit, as currently only one transporter at a time is supported.

this is MUI of cause...

I forgot to mention that actually through other trigers units from OTHER players will be inside the transports, even enemies! But this is a d*** good start thanks! any other sugestions

you could add all units of type (but this may be too limited) or add all units owned by other players too

an other possibility would be checking if an unit is issued to load and check if the order is being fullfilled after some time
 
Status
Not open for further replies.
Top