[Trigger] Gate trigger with transfer issue

Level 2
Joined
Jun 28, 2015
Messages
20
i cant figure out why these triggers wont work. they're pretty basic and should work as is, but wont.
  • gates Bottom Left Open
    • Events
      • Unit - Gate Switch 0280 <gen> Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Open Gates
    • Actions
      • Wait 1.00 seconds
      • Destructible - Open Elven Gate (Horizontal) 5898 <gen>
      • Destructible - Open Elven Gate (Horizontal) 5899 <gen>
  • Gates Bottom Left Close
    • Events
      • Unit - Gate Switch 0280 <gen> Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Close Gates
    • Actions
      • Wait 1.00 seconds
      • Destructible - Close Elven Gate (Horizontal) 5898 <gen>
      • Destructible - Close Elven Gate (Horizontal) 5899 <gen>
  • Ownership
    • Events
      • Unit - A unit enters Bottom Left Base Claim <gen>
    • Conditions
    • Actions
      • Unit - Change ownership of Circle of Power 0282 <gen> to (Owner of (Triggering unit)) and Change color
      • Unit - Change ownership of Gate Switch 0280 <gen> to (Owner of (Triggering unit)) and Change color
      • Trigger - Turn off (This trigger)
the transfer from neutral passive to the triggering player works fine, but the gates wont open and close afterwards. im not sure if its the transfer from neutral passive to the triggering player that messes it up, but i changed specific unit to unit in region (and of course created a small region around the lever) and it still didn't work.

i am pretty new to all this and could be missing something painfully obvious, but if anyone can shed some light on this i'd be grateful.
 
Level 6
Joined
Mar 17, 2012
Messages
105
I think your problem is that you are calling "Finishing casting ability" with the condition "Ability being cast". After the ability has finished being cast, it is no longer being cast.

You can fix this by changing "Finishing casting ability" to either "Begins casting an ability" or "Begins the effect of an ability"
 
Level 2
Joined
Jun 28, 2015
Messages
20
i changed the trigger around some from this
  • gates Bottom Left Open
  • Events
  • Unit - Gate Switch 0280 <gen> Finishes casting an ability
  • Conditions
  • (Ability being cast) Equal to Open Gates
  • Actions
  • Wait 1.00 seconds
  • Destructible - Open Elven Gate (Horizontal) 5898 <gen>
  • Destructible - Open Elven Gate (Horizontal) 5899 <gen>
to what marine suggested, this

  • gates Bottom Left Open
    • Events
      • Unit - Gate Switch 0280 <gen> Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Open Gates
    • Actions
      • Wait 1.00 seconds
      • Destructible - Open Elven Gate (Horizontal) 5898 <gen>
      • Destructible - Open Elven Gate (Horizontal) 5899 <gen>
still no cigar.
it does seem to at least interact with the gates though, as when the dummy ability is cast it'll restore the gates to full hp, but still refuses to open them.
 
Level 5
Joined
Jun 28, 2010
Messages
110
i changed the trigger around some from this
  • gates Bottom Left Open
  • Events
  • Unit - Gate Switch 0280 <gen> Finishes casting an ability
  • Conditions
  • (Ability being cast) Equal to Open Gates
  • Actions
  • Wait 1.00 seconds
  • Destructible - Open Elven Gate (Horizontal) 5898 <gen>
  • Destructible - Open Elven Gate (Horizontal) 5899 <gen>
to what marine suggested, this

  • gates Bottom Left Open
    • Events
      • Unit - Gate Switch 0280 <gen> Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Open Gates
    • Actions
      • Wait 1.00 seconds
      • Destructible - Open Elven Gate (Horizontal) 5898 <gen>
      • Destructible - Open Elven Gate (Horizontal) 5899 <gen>
still no cigar.
it does seem to at least interact with the gates though, as when the dummy ability is cast it'll restore the gates to full hp, but still refuses to open them.

Don't use "Unit - Begins casting an ability", use "Unit - A unit Starts the effect of an ability" instead.

"Begins" will cause bug if they cancel their animations and then cast it again, the result is the spell not going on cooldown, mana is not wasted etc... just use "Starts" dude don't use "Begins"

Next thing, i think you don't need to use wait - which means TriggerSleepAction in JASS, neither recommend using this because its not accurate, if you need wait, just use

  • Custom script: call PolledWait(1.0)
 
Level 2
Joined
Jan 2, 2013
Messages
24
I'm sorry, I might be wrong, but why would PolledWait be better then TriggerSleepAction? PolledWait basically uses a lot of TSL till the time is expired, which leads to SURE delays. Why not using TSA in the first place?? From the code, PW also seems to leak the timer
 
Level 2
Joined
Jun 28, 2015
Messages
20
thanks to everyone who helped, i have it working now! :ogre_haosis:

EDIT:
finished trigger for anyone who looks at this in the future:
  • gates Bottom Left Open
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Bottom left lever <gen> contains (Triggering unit)) Equal to True
      • (Ability being cast) Equal to Open Gates
    • Actions
      • Custom script: call PolledWait(1.0)
      • Destructible - Open Gate (Horizontal) 4837 <gen>
      • Destructible - Open Gate (Horizontal) 4838 <gen>
      • Trigger - Turn off (This trigger)
      • Trigger - Turn on Gates Bottom Left Close <gen>
 
Top