• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Death/Gold

Status
Not open for further replies.
Level 5
Joined
Jun 24, 2009
Messages
118
Hello! I want to create a new trigger - well,I tried but something didn't worked so I need a help. I want to when the player (x) kills another player (x) then died hero loses 300gold and player who killed died hero gets his 300gold if he is a hero.Also if he is a creep then he looses 150gold.And I want that he later (after x secs) revives. If he is at team1 at regionX and if at team2 then at regionX (differend regions,coz map is divided into two parts). Please,help me!
Thank you already!:)
 
Level 10
Joined
Feb 22, 2008
Messages
619
Okay, thats a whole lot of things in one trigger and I don't really have the patience to write the answers for all of that right now so just tell me, wich part of that do you want done first? I will help if you do and maybe I will help with the others after but I don't know where to start...
 
Level 10
Joined
Aug 15, 2008
Messages
720
  • HERO KILL
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to (==) True
    • Actions
      • Set TrigUnit = (Triggering unit)
      • Set Killer = (Killing unit)
      • Player - Add 300 to (Owner of Killer) Current gold
      • Player - Add -300 to (Owner of TrigUnit) Current gold
  • REVIVE MAH HERO Team 1
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to (==) True
      • ((Triggering player) is an enemy of <Any player in Team 2> ) Equal to (==) True
    • Actions
      • Set tempPoint = (Center of (<Team 1 Loc>))
      • Set TrigUnit = (Triggering unit)
      • Hero - Instantly revive (TrigUnit) at tempPoint, Show revival graphics
  • REVIVE MAH HERO Team 2
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to (==) True
      • ((Triggering player) is an enemy of <Any player in Team 1>) Equal to (==) True
    • Actions
      • Set tempPoint = (Center of (<Team 2 Loc>))
      • Set TrigUnit = (Triggering unit)
      • Hero - Instantly revive TrigUnit at tempPoint, Show revival graphics
Huzaahhh Done, If solved, if not then tell what another trigger I must do

Ohhh Just spotted, if I heard right then about creep it could be:
  • HERO KILL
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to (==) True
        • Then - Actions
          • Set TrigUnit = (Triggering unit)
          • Set Killer = (Killing unit)
          • Player - Add 300 to (Owner of Killer) Current gold
          • Player - Add -300 to (Owner of TrigUnit) Current gold
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Not equal to (!=) True
        • Then - Actions
          • Set TrigUnit = (Triggering unit)
          • Set Killer = (Killing unit)
          • Player - Add 150 to (Owner of Killer) Current gold
          • Player - Add -150 to (Owner of TrigUnit) Current gold
        • Else - Actions
 
Level 10
Joined
Sep 6, 2008
Messages
423
Azerocs triggers should work BUT you don't need to put (Triggering unit) and (Killing unit) in variables (not leaking) and you need to clear the tempPoints variable with a custom script (using Jass) in actions find "custom script" and write "call removelocatio(udg_tempPoint)" if your point variable is named tempPoint.
Here you have a example of clearing a point leak with the name tempPoint
  • Custom script: call removelocation(udg_tempPoint)
EDIT: The clearing should be used before the next time you set a point or at the end of the trigger. If the point setting is not done twice in the same trigger just clear it at the end.
 
Level 10
Joined
Aug 15, 2008
Messages
720
Ah yes forgot about tempPoint thing...

No need to explain me memory leaks, This was fast reply, besides I think he will ask what that custom script do.

But Anyway no need to always post those memory fixes, People know em anyway , so they can place em themselfs...
 
Level 5
Joined
Jun 24, 2009
Messages
118
Why Triggering Unit created in variable TrigUnit? why?
I'll check ur triggers and if all will work then rep for all. :)

There's trigger (without customscript coz then trigger don't working.) But now when I test map(in the worldedit ctrl+F9)- and kill some enemy then I have critical error. :eek:

  • Death
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to True
        • Then - Actions
          • Set TrigUnit = (Triggering unit)
          • Set Killer = (Killing unit)
          • Player - Add 300 to (Owner of Killer) Current gold
          • Player - Add -300 to (Owner of TrigUnit) Current gold
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Not equal to True
        • Then - Actions
          • Set TrigUnit = (Triggering unit)
          • Set Killer = (Killing unit)
          • Player - Add -150 to (Owner of Killer) Current gold
          • Player - Add 150 to (Owner of TrigUnit) Current gold
        • Else - Actions
  • Destroyers
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Triggering player) is an enemy of Player 6 (Orange)) Equal to True
    • Actions
      • Set tempPoint = (Center of Teleport Destroyers Region <gen>)
      • Set Killer = (Killing unit)
      • Set TrigUnit = (Triggering unit)
      • Countdown Timer - Create a timer window for (Last started timer) with title Respawn in
      • Countdown Timer - Start (Expiring timer) as a One-shot timer that will expire in 30.00 seconds
      • Countdown Timer - Show (Last created timer window) for (Owner of TrigUnit)
      • Wait 30.00 seconds
      • Hero - Instantly revive TrigUnit at tempPoint, Hide revival graphics
      • Hero - Set (Triggering unit) Hero-level to (Level of (Dying unit)), Hide level-up graphics
  • Guards
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Triggering player) is an enemy of Player 1 (Red)) Equal to True
    • Actions
      • Set tempPoint2 = (Center of Teleport Guards Region <gen>)
      • Set Killer = (Killing unit)
      • Set TrigUnit = (Triggering unit)
      • Countdown Timer - Create a timer window for (Last started timer) with title Respawn in
      • Countdown Timer - Start (Expiring timer) as a One-shot timer that will expire in 30.00 seconds
      • Countdown Timer - Show (Last created timer window) for (Owner of TrigUnit)
      • Wait 30.00 seconds
      • Hero - Instantly revive TrigUnit at tempPoint2, Hide revival graphics
      • Hero - Set (Triggering unit) Hero-level to (Level of (Dying unit)), Hide level-up graphics
 
Last edited:
Level 8
Joined
Dec 8, 2007
Messages
312
First of all your Death is not good. you can make it with only one if/then/else. And I'm not shore it triggering unit is recognized as the one died. better use Dying unit.
your trigger should look like this.
  • Death
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) is A Hero) Equal to True
        • Then - Actions
          • Player - Add 300 to (Owner of (Killing unit)) Current gold
          • Player - Add -300 to (Owner of (Dying unit)) Current gold
        • Else - Actions
          • Player - Add -150 to (Owner of (Killing unit)) Current gold
          • Player - Add 150 to (Owner of (Dying unit)) Current gold
In your other triggers you misplaced order for countdown timers.
you must start the timer first and only then create timer window.
and why you are using timer anyway? your trigger will review hero after 30 seconds without timer.
 
Level 8
Joined
Dec 8, 2007
Messages
312
What I see from your trigger it would work only for one player and timer window will stay after review and new will come after hero dies again.
If you want to make it all in one trigger then I suggest you make. Timer and Timer Window variables with array for each player. that would be 12 or 10(depends from how many players you will have)
Trigger should be something like this:
  • trig
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) is A Hero) Equal to True
          • ((Owner of (Dying unit)) is an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • Countdown Timer - Start ReviewTimer[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in 30.00 seconds
          • Countdown Timer - Create a timer window for (Last started timer) with title Respawn
          • Countdown Timer - Show (Last created timer window)
          • Set Timer_Window[(Player number of (Owner of (Dying unit)))] = (Last created timer window)
          • Wait 30.00 seconds
          • Set ReviewPoint = (Your point)
          • Hero - Instantly revive (Dying unit) at ReviewPoint, Hide revival graphics
          • Countdown Timer - Destroy Timer_Window[(Player number of (Owner of (Dying unit)))]
        • Else - Actions
notice that you should set review point after 30 seconds to make shore review point won't be change by other trigger for any reason. But if team1 and team2 review points newer change it would be better to set them only once in map initialization
 
Level 5
Joined
Jun 24, 2009
Messages
118
ohh, I need just a timer for respawn.That what u created is working for all and I dont need any counting for trigger.Just a timer - ''Respawn in X(seconds).'' and that's all. Anyway rep for you and a bit later i'll check is that working,thanks if even no. :)
 
Status
Not open for further replies.
Top