SC2Mapster Forums

Development > Triggers

Triggering Unit work with morphing units?

  • 6 posts
    #1 Jan 28, 2013 at 05:25 UTC - 0 likes

    I am eventing at a warpgate transforming into a gateway, but how would I refer to the gateway that the warpgate turned into (in the same trigger)? I tried

    General - Wait for (Conditions), checking every 1.0 Game Time seconds Conditions ((Triggering unit) ability command Gateway - Transform to Warp Gate is in state Executing) == True

    but it seems to get stuck there despite me transforming it back into a warpgate, so I am thinking that Triggering unit only refers back to the original warpgate? Basically, I just want this part to wait for that gateway to transform back into a warpgate.

    The trigger just counts the amount of time in gateway mode, so it can reduce the cooldown of the warpgate accordingly, excluding transformation times. I think I have other ways of implementing this, but this just bothers me >_<

    How would I refer to the unit that is the product of a transformation?

    Thanks!

    Last edited Jan 28, 2013 by purakushi
    #2 Jan 28, 2013 at 17:16 UTC - 0 likes

    when you morph a unit it remains the same unit, only when you replace a unit using triggers does it change. also why do you have a wait for execution state, why not have the event only trigger at generic3 -execute. that would get you the unit, the reason you prob don't get it right now, is executing only lasts maybe .5 secs and your trigger only check every 1. sec, have it check every 0.0 secs that would work.

    I'm a triggerer
    I can't make awesome terrains
    I dabble in data

    I suck at poems
    That is why i do haiku
    i suck at them too :(

    #3 Jan 28, 2013 at 21:33 UTC - 0 likes

    @willuwontu: Go

    Oh, that is nice to know. I thought I already tried the wait at every 0.1 seconds, but I will try again. I thought "executing" would mean the whole time that the warpgate is transforming, rather than a "start executing", so I was not worried about that number. Is there a source for that it only lasts half a second or so, or just from experimentation?

    Hm, I am not sure what you mean by having the event trigger on generic3 - execute for this case. I have the trigger event on when the warpgate transforms into a gateway, so Triggering unit does refer to that unit (I thought otherwise, because my trigger was not working, but I believe you) I need it to start here because I need to calculate the time it spends as a gateway before it turns back into a warpgate. All of this needs to be done within the same trigger, so I may use the local variables that hold the duration. What do you mean?

    Theoretically, it should work with the wait at 0.0 seconds, so I will try that and get back. Maybe I goofed earlier. I did try a while loop, and I thought that would be equivalent to a wait with 0.0 seconds...

    I actually would prefer not to use a wait and use an event trigger (to check when the gateway turns back into a warpgate), instead, but I am not sure how to do that in this case and still have the time variable (that was calculated going from warpgate to gateway) available for use there. If you could explain to me, I would greatly appreciate it. Thanks!

    EDIT: Tried the 0.0, still getting stuck in the wait. :(

    Last edited Jan 28, 2013 by purakushi
    #4 Jan 29, 2013 at 02:25 UTC - 0 likes

    no no for the event
    any unit uses ability morph to warpgate (or whatever it is) at stage generic3 execute

    *voila*

    Last edited Jan 29, 2013 by willuwontu
    Name Size MD5
    Gate_way_transform.SC2Map 10.1 KiB 6bb921582bd8...
    #5 Jan 29, 2013 at 03:48 UTC - 0 likes

    @willuwontu: Go

    Oh, that's pretty neat. :) I did not know about the generics.

    I do need that check for gateway transform to be checked within the warpgate to gateway trigger, though, so I can not use an event trigger for this part.

    I managed to do it by checking when the number of abilities changes. The number of abilities for warpgates is 3, but gateways have 5. (Oddly enough, I thought warpgates had 4, if you count them in the data editor).

    Thanks!

    Last edited Jan 29, 2013 by purakushi
    #6 Jan 29, 2013 at 04:03 UTC - 0 likes

    you could also have the event trigger when the gateway finishes vchanging to generic6 - complete

  • 6 posts

You must login to post a comment. Don't have an account? Register to get one!