I made one the same as another in the same map that works except this one won't show up even though I have the show to all action on. Also my timers won't destroy. How can I fix these?
Also, I have a unit that spawns. i want to revive that unit if they click the dialog item to do so. However since the event is dialog item is clicked, I cant use triggering unit to revive the unit. So how do I revive it? I also solved the dialog not showing up problem so dont worry about that.
Sounds like you need to store the unit as a global variable for your problem. Then you can refer to the unit whenever you want. I think what most people are doing nowadays though is just never letting the hero die, just hiding it until it respawns, or in your case, they click on said dialog. Can do that pretty easily with a modified kerrigan never die behavior.
Well, to be more specific, the variable is just plain deleted after whatever function/trigger it was in is done running. It is recreated every time you run said function/trigger, but can only be used there unless you pass it at some point inside your function/trigger to a different function/global variable. So long story short, just use a fricking global variable, lol.
Yea i knew that I just couldnt explain it in understandable manners since english isnt my main language :P
Anyways, local variables are useful when you need to run the same trigger many times at the same time.
Every instance of the trigger will create its own local variables. Therefore avoiding any conflict.
well i tried it and it isnt working. i have multiple hero's so i made an array on the variable and put triggering player as the number so i wouldnt have to make like 10 variables.
Make sure everyhting is correct, set up debug messages to see whether all values are right
Does you hero have a "death time"? (Or are you preventing it from dying?)
Find a tutorial, follow it step by step, if it works, modify it to your needs.
Last but not least, post the trigger here (Select all actions, right click, "Copy as Text", paste into post. Use [*code] [/code*] (without the *s) to make it easer to read.)
"Variable - Set respawn unit[(Triggering player)] = (Last created unit)"
You didn't create a unit, so this variable is still empty. You need to set the hero to the variable in the same trigger it is created in
EDIT: Also, that event... Will not work in multiplayer and totally mess things up. What is it supposed to achieve? Right now it will only fire for player number (players on team 1)
In other words, if you have 3 players on team 1, that event will only fire if player 3 presses the button.
If you want to restrict the use of the trigger to one team only, check whether the triggering player is in player group (Players on team x)
EDIT 2: Also, player numbers aren't the same as lobby location, so player 3 doesn't even have to be on team 1.
oh, well what i was trying to achieve is when a player's hero dies, i want to make a dialog appear to either revive the hero or pick a new hero (which they use a probe for) and i put the team 1 thing there because if the hero is on a player of team 1, then the hero will spawn in a different place then the one on team 2.
I cant just create a unit there though. because i dont know what their unit was... they choose from 6 units at the beginning so i have no way of knowing which they picked.
@TheAlmaity: Go
they choose from 6 units at the beginning so i have no way of knowing which they picked.
And where is THAT trigger? Just add "Set (HeroArray[(Triggering Player)] == Last created unit)" after the "Create Unit" action.
Also, this might come in handy:
"Last Created Unit" refers to the last "Creat Unit" action, and nothing else. If you want the unit that caused the event, you have to use "Created Unit" (When you select a function/action, there is text in the box below. Read when you are using such functions, it will make things clearer)
EDIT 2:
also, "And" is the default state for conditions, so if you just list many conditions, they ALL have to be true, whether you use And or not. If you want only 1 condition to be true, use "Or" and list them all there. If you do that, THEN you use "And" if you want a few conditions to count as in 1 the "Or" list.
I made one the same as another in the same map that works except this one won't show up even though I have the show to all action on. Also my timers won't destroy. How can I fix these?
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
Also, I have a unit that spawns. i want to revive that unit if they click the dialog item to do so. However since the event is dialog item is clicked, I cant use triggering unit to revive the unit. So how do I revive it? I also solved the dialog not showing up problem so dont worry about that.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
@fishy77: Go
im not sure to understand exactly what your problem is.
Have you tried to use a variable for that unit ? all you have to do then is revive the variable and it will revive the unit attached to it.
In order to attach a variable to a unit that is not pre-placed use, Last Created Unit
As example:
Create 1 Unit()
Set "Hero" to "Last Created Unit"
@fishy77: Go
Sounds like you need to store the unit as a global variable for your problem. Then you can refer to the unit whenever you want. I think what most people are doing nowadays though is just never letting the hero die, just hiding it until it respawns, or in your case, they click on said dialog. Can do that pretty easily with a modified kerrigan never die behavior.
Oh yeah i totaly forgot to mention, the variable must be global or else it will be reset everytime the trigger fires, or something like that.
@StonedMapster: Go
Well, to be more specific, the variable is just plain deleted after whatever function/trigger it was in is done running. It is recreated every time you run said function/trigger, but can only be used there unless you pass it at some point inside your function/trigger to a different function/global variable. So long story short, just use a fricking global variable, lol.
@Deadzergling: Go
Yea i knew that I just couldnt explain it in understandable manners since english isnt my main language :P
Anyways, local variables are useful when you need to run the same trigger many times at the same time. Every instance of the trigger will create its own local variables. Therefore avoiding any conflict.
Ok cool. I will try those when I get a chance.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
well i tried it and it isnt working. i have multiple hero's so i made an array on the variable and put triggering player as the number so i wouldnt have to make like 10 variables.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
no matter what i put, nothing seems to revive the unit. what do i do?
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
@fishy77: Go
the revive unit is my variable i tried to add the unit to when it dies.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
@fishy77: Go
"Variable - Set respawn unit[(Triggering player)] = (Last created unit)"
You didn't create a unit, so this variable is still empty. You need to set the hero to the variable in the same trigger it is created in
EDIT: Also, that event... Will not work in multiplayer and totally mess things up. What is it supposed to achieve? Right now it will only fire for player number (players on team 1)
In other words, if you have 3 players on team 1, that event will only fire if player 3 presses the button.
If you want to restrict the use of the trigger to one team only, check whether the triggering player is in player group (Players on team x)
EDIT 2: Also, player numbers aren't the same as lobby location, so player 3 doesn't even have to be on team 1.
[reply=785444]
oh, well what i was trying to achieve is when a player's hero dies, i want to make a dialog appear to either revive the hero or pick a new hero (which they use a probe for) and i put the team 1 thing there because if the hero is on a player of team 1, then the hero will spawn in a different place then the one on team 2.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
@fishy77: Go
Well, there's an easier way to make it spawn on a different place... Just use an If/then/else.
If
(owner of (hero)) is in player group (Players on Team 1)
Then
create hero in team 1 location
else
create hero in team 2 location
No need for seperate triggers :p
Anyway, you managed to fix it? Also, sorry if I sounded a bit rude/offensive yesterday, dunno what was up with me >.> Didnt get much sleep.
I also had this... and no i didnt fix it yet. im trying to do something different with the players. i havent tested it yet though
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
@TheAlmaity: Go
I cant just create a unit there though. because i dont know what their unit was... they choose from 6 units at the beginning so i have no way of knowing which they picked.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
I tried this and it didnt work
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
And where is THAT trigger? Just add "Set (HeroArray[(Triggering Player)] == Last created unit)" after the "Create Unit" action.
Also, this might come in handy:
"Last Created Unit" refers to the last "Creat Unit" action, and nothing else. If you want the unit that caused the event, you have to use "Created Unit" (When you select a function/action, there is text in the box below. Read when you are using such functions, it will make things clearer)
EDIT 2:
also, "And" is the default state for conditions, so if you just list many conditions, they ALL have to be true, whether you use And or not. If you want only 1 condition to be true, use "Or" and list them all there. If you do that, THEN you use "And" if you want a few conditions to count as in 1 the "Or" list.
@TheAlmaity: Go
oh... i shall try that
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here