Hero dies ---> Respawn in beginning

Kebabnisse

New Member
Reaction score
1
Hello

I need help with hero spawn, when it dies it should spawn at the place i want. In my case the beginning.
It says that it will be revived at altar, but i want it to auto respawn after death at a certain place.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
This is probably something like you want:
Trigger:
  • Hero Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set TempPoint = (Center of (Playable map area))
      • Hero - Instantly revive (Triggering unit) at TempPoint, Show revival graphics
      • Custom script: call RemoveLocation(udg_TempPoint)


Just change the "(Center of (Playable map area))" to wherever you want it to respawn...

And also, feel free to add a wait or something before the action, to make the revive dealy :D
 

Kebabnisse

New Member
Reaction score
1
This is probably something like you want:
Trigger:
  • Hero Respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set TempPoint = (Center of (Playable map area))
      • Hero - Instantly revive (Triggering unit) at TempPoint, Show revival graphics
      • Custom script: call RemoveLocation(udg_TempPoint)


Just change the "(Center of (Playable map area))" to wherever you want it to respawn...

And also, feel free to add a wait or something before the action, to make the revive dealy :D

Dont you need a script for that?
the "custom script" thing, im a newbie on triggers etc so...
and where can i find the third thing? I can't find it:S
I've been wondering about that for some hours x|
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, the action is called "Custom Script", and there you can write words instead of pre-existing stuff... So just simple copy this to where it says "Script Code" in red:

call RemoveLocation(udg_TempPoint)

And for this you'll need a Point variable called TempPoint, and it's also case-sensitive so don't name it tempPoint or something ;)
 

Kebabnisse

New Member
Reaction score
1
Well, the action is called "Custom Script", and there you can write words instead of pre-existing stuff... So just simple copy this to where it says "Script Code" in red:

call RemoveLocation(udg_TempPoint)

And for this you'll need a Point variable called TempPoint, and it's also case-sensitive so don't name it tempPoint or something ;)

ok, thx.
I'll try it now. Hope it works;)
 

Kebabnisse

New Member
Reaction score
1
Trigger:
  • Hero respawn
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Doom Guard 0040 <gen> is A Hero) Equal to True
    • Actions
      • Set TempPoint = (Center of START <gen>)
      • Hero - Instantly revive Doom Guard 0040 <gen> at (Center of START <gen>), Show revival graphics
      • Custom script: call RemoveLocation(udg_TempPoint)


Is this right? It says it dosnt work and it dosnt.
Have you tested it?
 

wc3ed

New Member
Reaction score
0
don't make it so hard on yourself, try this:

event - a unit dies (generic unit event)

condition - dying unit is an hero equal to true (boolean comp)

action - instantly revive (your hero) at (your region), hide/show revival grafics (Hero revive (instantly))

GL, ;)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
First, use Triggering unit instead of Dying unit :D

Second, your trigger leaks, which is why I have the custom script and the variable setting :D

Use my trigger for efficiency, use his trigger for easyness :D

But, as he said... You're not supposed to pick an actuall unit in that condition, but use Triggering unit :D
 

Kebabnisse

New Member
Reaction score
1
don't make it so hard on yourself, try this:

event - a unit dies (generic unit event)

condition - dying unit is an hero equal to true (boolean comp)

action - instantly revive (your hero) at (your region), hide/show revival grafics (Hero revive (instantly))

GL, ;)

It works now!
Thanks Very Very much dude!
:))))
 

Kebabnisse

New Member
Reaction score
1
First, use Triggering unit instead of Dying unit :D

Second, your trigger leaks, which is why I have the custom script and the variable setting :D

Use my trigger for efficiency, use his trigger for easyness :D

But, as he said... You're not supposed to pick an actuall unit in that condition, but use Triggering unit :D

well, im not so good at this so i go the easy way, thanks for the help anyway.
and if i would get any more problem i post again
 

wc3ed

New Member
Reaction score
0
First, use Triggering unit instead of Dying unit :D

Second, your trigger leaks, which is why I have the custom script and the variable setting :D

Use my trigger for efficiency, use his trigger for easyness :D

But, as he said... You're not supposed to pick an actuall unit in that condition, but use Triggering unit :D

first of all, he's a beginner so using costum script is way to difficult.. and i'd written that this is a EASY way.. right..
and second, using dying unit isn't a crime and it works.. :)

but you're right it leaks i've made it to quick, it has to be triggering unit or dying unit, srry for that..:D
 

Kebabnisse

New Member
Reaction score
1
ey guys i think i found another way to

Trigger:
  • Untitled Trigger 003
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Hero - Instantly revive (Dying unit) at (Center of START <gen>), Show revival graphics



this also works fine for me =)
I'm fooling around in the triggers to learn xP
 

wc3ed

New Member
Reaction score
0
ey guys i think i found another way to

Trigger:
  • Untitled Trigger 003
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Hero - Instantly revive (Dying unit) at (Center of START <gen>), Show revival graphics



this also works fine for me =)
I'm fooling around in the triggers to learn xP

what did you change?? this one?

Hero - Instantly revive (Dying unit) at (Center of START <gen>), Show revival graphics[/WC3]?

we already told you to do that, because that way you won't get a bug if some other hero dies.. look up :D
 

LoveRPG

Member
Reaction score
6
ey guys i think i found another way to

Trigger:
  • Untitled Trigger 003
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Hero - Instantly revive (Dying unit) at (Center of START &lt;gen&gt;), Show revival graphics



this also works fine for me =)
I'm fooling around in the triggers to learn xP

Though intstead of Dying unit, use triggering unit.
 

LoveRPG

Member
Reaction score
6
first, did not read all posts, someone got to write it before me.

Though a very important thing if you are having perhaps heros that are on the creep side. If u make the trigger only check if they are heros it will certainly respawn the Player 12(player 12 since neutrals cant respawn) at start. And it is probably a boss in that case. So add this condition:

Owner of triggering unit NOT equal to (Player 12)(Player comparison)

this way it wont respawn the player 12. Then to respawn bosses u need to make a new trigger for that.
 

TomTTT

New Member
Reaction score
44
and it's also case-sensitive so don't name it tempPoint or something ;)
Didn't you kind of confused him?
You don't have to set it EXACTLY to TempPoint, what you do have to make sure, is that in the custom script you write the exact name of the variable.

tempPoint
Trigger:
  • call RemoveLocation(udg_tempPoint)


SUPER_DUPER
Trigger:
  • call RemoveLocation(udg_SUPER_DUPER)
 

Squeekems

TH.net Regular
Reaction score
11
When writing these sort of triggers, it is best to be as broad as possible without leaking. Try to think of it as plain English.

Trigger:
  • Hero respawn
    • Events
      • Unit - A unit Dies //A unit dies.
    • Conditions
      • ((Triggering Unit) is A Hero) Equal to True //The unit who started this trigger is a hero.
    • Actions
      • Set TempPoint = (Center of START &lt;gen&gt;) //Because points can leak, it is best to clear them. The only way to clear them is to set them to a variable.
      • Hero - Instantly revive (Triggering Unit) at TempPoint, Show revival graphics //This is the only line in the actions that you would need to make this trigger work properly, but because we&#039;re trying to be efficient, we&#039;re going to use the variable.
      • Custom script: call RemoveLocation(udg_TempPoint) //This line clears the variable.


When I was a complete noob, I used this site, the World Editor Tutorials. This links you to a page that may be a little advanced for you, but it's no bad to get a look at. Tells you more about leaks.

Here's an example for why it is important to clear leaks:
Every second, every player gets one unit created for them. If there was no leak clearing system, can you imagine how hard it would be to remember all of that information? Every second, a twelve new leaks would be created. 12...24...36...48...60...72...etc. How long will that game map play before the game, or even the computer, crashes. Computers are powerful, but unless you've got an actual super computer, you'll be going at 1 FPS within 10 minutes.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top