• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] trigger doesnt work :(

Status
Not open for further replies.
why doesnt this trigger work? oO

  • revive
    • Events
      • unit - A unit dies
    • Bedingungen
      • (DyingUnit is a Hero) equal to True
    • Aktionen
      • Set DyingUnit = (Dying unit)
      • Set TempLoc00 = (Position of DyingUnit)
      • game - Display to (All allies of (Owner of DyingUnit)) the text: (((Name of DyingUnit) + will be revived in ) + ((String(((Level of DyingUnit) x 3))) + seconds.))
      • Wait (3.00 x (Real((Level of DyingUnit)))) seconds
      • If (((Owner of DyingUnit) is in (All allies of player 6 (Orange))) equal to True) then do (Held - Instantly revive DyingUnit at (Center of HeroSpawnAllianz <gen>), showing revival graphics) else do (Do nothing)
      • If (((Owner of DyingUnit) is in (All allies of player 12 (brown))) equal to True) then do (Held - Instantly revive DyingUnit at (Center of HeroSpawnHorde <gen>), showing revival graphics) else do (Do nothing)
      • camera - Pan camera for (Owner of DyingUnit) to TempLoc00 over 2.00 seconds
      • Custom script: call RemoveLocation(udg_TempLoc00)
      • Custom script: set udg_DyingUnit = null
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
First: always state what your trigger is supposed to do.
Second: always state what's not working in your trigger.
I think I have already told you this in some other thread. :p

Well, anyways, I suppose the whole trigger does not fire.

(DyingUnit is a Hero) equal to True
This is your problem. You are referencing to a Variable you didn't even set.

It should look like this:
((Dying unit) is a Hero) equal to True)

On a sidenote: DO NOT use Waits. Use PolledWaits. Simply because Wait doesn't wait through lag and I think it might even cause game splits, which I'm not sure about.
 
  • revive
  • Events
  • unit - A unit dies
  • Bedingungen
  • (DyingUnit is a Hero) equal to True
  • Aktionen
  • Set DyingUnit = (Triggering unit)
  • Set TempLoc00 = (Position of DyingUnit)
  • game - Display to (All allies of (Owner of DyingUnit)) the text: (((Name of DyingUnit) + will be revived in ) + ((String(((Level of DyingUnit) x 3))) + seconds.))
  • Wait (3.00 x (Real((Level of DyingUnit)))) seconds
  • If (((Owner of DyingUnit) is in (All allies of player 6 (Orange))) equal to True) then do (Held - Instantly revive DyingUnit at (Center of HeroSpawnAllianz <gen>), showing revival graphics) else do (Do nothing)
  • If (((Owner of DyingUnit) is in (All allies of player 12 (brown))) equal to True) then do (Held - Instantly revive DyingUnit at (Center of HeroSpawnHorde <gen>), showing revival graphics) else do (Do nothing)
  • camera - Pan camera for (Owner of DyingUnit) to TempLoc00 over 2.00 seconds
  • Custom script: call RemoveLocation(udg_TempLoc00)
  • Custom script: set udg_DyingUnit = null
better like this?

what are polled waits? give an example plz

:) thx
 
Last edited:
Level 17
Joined
Apr 13, 2008
Messages
1,608
Er no. You missed the point.

  • Set DyingUnit = (Triggering unit)
You see, here you set a GLOBAL variable to something and then

  • Wait (3.00 x (Real((Level of DyingUnit)))) seconds
You wait here.. Which means:
If someone else would die your DyingUnit variable get owerwritten.
GhostWolf said that you should forget about this whole DyingUnit global variable stuff and use Triggerint Unit instead.


But you still haven't solved your main problem yet:
  • Conditions:
  • (DyingUnit is a Hero) equal to True
You are yet to swap this with Dying Unit or Triggering Unit. READ MY FIRST POST.

I would like to note that Triggering Unit is always executed faster by your Computer's Processor than any of its equialents (Dying Unit, Entering Unit, etc.).
 
...next try

  • revive
    • events
      • unit - A unit dies
    • conditions
      • ((Triggering unit) is a hero) equal to True
    • actions
      • Set TempLoc00 = (Position of (Triggering unit))
      • Set TempLoc01 = (Center of HeroSpawnAllianz <gen>)
      • Set TempLoc02 = (Center of HeroSpawnHorde <gen>)
      • game - Display to (All allies of (Owner of (Triggering unit))) the text: (((Name of (Triggering unit)) + will be revived in ) + ((String(((Level of (Triggering unit)) x 3))) + seconds.))
      • Wait (3.00 x (Real((Level of (Triggering unit))))) seconds
      • If (((Owner of (Triggering unit)) is in (All allies of Spieler 6 (Orange))) equal to True) then do (hero - Instantly revive (Triggering unit) at TempLoc01, showing revival graphics) else do (Do nothing)
      • If (((Owner of (Triggering unit)) is in (All allies of Spieler 12 (Braun))) equal to True) then do (hero - Instantly revive (Triggering unit) at TempLoc02, showing revival graphics) else do (Do nothing)
      • camera - Pan camera for (Owner of (Triggering unit)) to TempLoc00 over 2.00 seconds
      • Custom script: call RemoveLocation(udg_TempLoc00)
      • Custom script: call RemoveLocation(udg_TempLoc01)
      • Custom script: call RemoveLocation(udg_TempLoc02)
hmm hope i got it now ;)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
what are polled waits? give an example plz

Polls waits, in contrast to normal waits, respond to lags / other things that make the game stop.
This means that when you use a normal wait and a player lags, for example, the wait will still continue to decrease while a polled wait wouldn't.

I won't get into accuracy as there are at least one million threads about it.

I would also suggest you to never use a global (either a variable you declared or a event response such as Killing Unit, Casting Unit, and every other event response other then Triggering Unit which isn't a global) with waits, as it will be overwritten if the event fires again within the wait time.
 
Level 17
Joined
May 6, 2008
Messages
1,598
I don't know if it's said already, but you can't use a variable condition if the variable is being set in the actions of the trigger.
 
Status
Not open for further replies.
Top