make sure its getting past those conditions by adding a text message at actions. if you text message doesn't display when u play the map check the conditions if it does check the create unit
The problem is in where the unit is spawning. The triggering unit is dead and therefore has no position. To fix this, create a new point variable and set it to position of triggering unit and spawn the unit at that point.
That is not accurate. Variables are needed because the unit is being created at the position of a unit after the unit has died. Dead units do not retain their positions.
His action is giving him an error because it's having trouble placing the unit at the position of a unit which died 30 seconds ago.
If he sets a point variable to the position of the unit without wait, then the variable will carry the position for the unit which spawns in 30 seconds.
Local variable: (Real) = facing of triggering unit
Local variable: (Point) = position of triggering unit
Local variable: (Unit type) = unit type of triggering unit
Wait 30 seconds
Create (unit type) at (point) facing (real).
This will work. Ignore all the above posts saying you don't need variables; you do.
A nice thing to remember is that dead units don't retain a lot of their qualities they had while they were alive. You can't really get the position of a dead unit because it no longer exists, can't get it's unit type, etc. Keep in mind, variables set the instant the unit died will still work even though they're technically set after the unit died.
Although you used a variable, it's still set to the unit that died. Therefore, you're still trying to get that data from the dead unit.
Like TyaStarcraft said, setting the unit type will work due to the fact that it's being set as the unit died and that it's not connected to the unit at all.
Store the facing just like you did for the other properties, then change your trigger action from "Create unit type with default facing" to "Create unit type facing angle".
Time to go semi-offtopic, it's still about zombies, and it's still about triggers, and it's still about the mechanic alltogether, but now I would love some neat ideas, been doing some ai for the zombie computer what to do if I attack them. (unfortunatly I dont know how to expand the trigger for example if a unit gets in range of the unit to use the ability)
I know there is an "idea factory" part of the forum, tho I still think I should continue to write in this thread and harvest an idea or two.
But so far so good, was very fun to play with ai triggers, if banshee gets attacked it cloaks etc, standard ai.
Tho as I said earlier, the units with spells only react by using their spells if they get attacked, not if you get close to them, so easy to move close to them and then start attacking them, would be more fun if they reacted even if you got close to them.
For example:
If range of Banshee = true, then cloak, if not in range = true, then decloak to save energy.
You know what I mean :)
P.S I know I linked infestor trigger, I just took banshee as an example.
I also have a trigger for an infestor that is burrowed, it casts infestad terrans all over the place like a mad man if u attack it.
I don't normally use a variable to store triggering data like you have. One way I do it is by the set variable action.
Have you tried replacing all uses of TempUnit with Triggering unit? It would also save you a variable.
Why would I want to "save" a variable?
Variables are not in the way, and makes it easier to change a trigger if you totally remake them later on.
I use variables on all my triggers except "picked unit".
Also you save memory by using variables, the more "triggering unit" you use, the more memory your map uses, which is bad.
Use variables on "triggering unit" aswell mate.
You want to keep these as low as possible, and by using variables you lower them greatly.
Let's say you have a trigger that you use 15x "triggering unit" on, a long trigger, if you use a variable instead to replace "triggering unit" with the "triggering unit variable" you save 14x function calls.
If you're thinking of optimising the map to be as small as possible with the fewest amount of variables/triggers/action-definitions (ADs) then every bit counts. Unless I'm making really huge triggers/ADs and expecting to change triggers often then that's not a worry either.
Dude, relax and listen carefully. I'm sharing my way of triggering that works and it may work for you. According to what you said, wouldn't a slight inefficiency be worth something that works? Is it really that hard to spend a few seconds modifying your trigger?
I always assumed triggering unit was a somewhat hidden local variable that's set whenever the trigger runs. If it involves function calling then you're right and thanks for the info ;)
At this point (in typing this post) I just went through this thread again and found out you did get this working XD. Don't mind me, I thought you were still having problems and wanted to help.
Good luck with your project!
Got the impression that you thought I was being rude and offended, if so I'm sorry, wasn't rude at all was just telling you how it is :)
And yes, we want to have as few function calls as possible to make our maps as smooth and fast as we can (optimized).
Therefor use variables for everything you can, for my triggers where I only use the function call once with the variable it wouldn't matter if I used triggering unit, but It's a habit I like to have, and it's a good habit! ;P
Would really appreciate some help with making the Zombies on my map "wander around", but so far I can't seem to ADD an ability or behaviour to a unit in any way.
Just "add behaviour from caster" which is a bullshit trigger that doesn't work.
Wish I was good with custom scripts and it might be a bit easier, but since I don't I would really appreciate som help with the "wander" system.
And as you know I can't go to data tab and give the units wander behaviour since they would wander around for players aswell :P
Add behavior to unit from caster works...I use it all the time. How exactly are you using it?
Rollback Post to RevisionRollBack
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
To post a comment, please login or register a new account.
Trying to make a zombie melee map, if a unit gets killed and is not player 9, the units respawns as player 9.
But ofc it doesn't work since I'm not map maker pr0 leagues heroes.
So what's wrong?
Thx
make sure its getting past those conditions by adding a text message at actions. if you text message doesn't display when u play the map check the conditions if it does check the create unit
You could also use one condition instead of 8, "(Owner of TempUnit) != 9".
@redbean87: Go
The problem is in where the unit is spawning. The triggering unit is dead and therefore has no position. To fix this, create a new point variable and set it to position of triggering unit and spawn the unit at that point.
I assume it should work like in imba league right? No variables are required.
do it this way:
EVENT unit dies
CONDITION owner of triggering unit != player 9
ACTIONS wait 'X' ingame seconds
create 1 ' position of 'triggering unit' ' for player '9' facing '270' degrees.'ignore placemet requirements'
that should do it :)
@IcyJay: Go
That is not accurate. Variables are needed because the unit is being created at the position of a unit after the unit has died. Dead units do not retain their positions.
His action is giving him an error because it's having trouble placing the unit at the position of a unit which died 30 seconds ago.
If he sets a point variable to the position of the unit without wait, then the variable will carry the position for the unit which spawns in 30 seconds.
Unit Dies
Owner of unit (Triggering unit) =/= 9
Local variable: (Real) = facing of triggering unit
Local variable: (Point) = position of triggering unit
Local variable: (Unit type) = unit type of triggering unit
Wait 30 seconds
Create (unit type) at (point) facing (real).
This will work. Ignore all the above posts saying you don't need variables; you do.
Thanks for the help guys, not quite there yet, but I'll keep at it, will post again if I won't solve it.
And YES, you DO NEED variables for this kind of stuff, same with wc3, tho I am very rusty now, haven't been mapping much for many years.
The map is for me and the friends only tho, and we would love to play Zombie League Heroes on different original blizz ladder maps! ;)
@redbean87: Go
1. Only one person said you don't need variables.
2. You don't need variables. That's not the only way to save data by a long shot.
lol on a small note fyi you don't need all those conditions? Using "=!" means does not equal, so you can just set it to player 9.
Something is really wrong, still doesn't work and get a lot of red texts of doom ingame : /
Bump
Change the variable type of "TempUnit" from "unit" to "unit type", and then update your create unit action with this change.
@redbean87: Go
A nice thing to remember is that dead units don't retain a lot of their qualities they had while they were alive. You can't really get the position of a dead unit because it no longer exists, can't get it's unit type, etc. Keep in mind, variables set the instant the unit died will still work even though they're technically set after the unit died.
Although you used a variable, it's still set to the unit that died. Therefore, you're still trying to get that data from the dead unit.
Like TyaStarcraft said, setting the unit type will work due to the fact that it's being set as the unit died and that it's not connected to the unit at all.
Aaaahhh alright I got it now! Thanks! :)
(Works like a charm)
Tho I probably should change the default facing to a bit more random point, it looks a little bit too symmetric ;P
Store the facing just like you did for the other properties, then change your trigger action from "Create unit type with default facing" to "Create unit type facing angle".
Time to go semi-offtopic, it's still about zombies, and it's still about triggers, and it's still about the mechanic alltogether, but now I would love some neat ideas, been doing some ai for the zombie computer what to do if I attack them. (unfortunatly I dont know how to expand the trigger for example if a unit gets in range of the unit to use the ability) I know there is an "idea factory" part of the forum, tho I still think I should continue to write in this thread and harvest an idea or two.
But so far so good, was very fun to play with ai triggers, if banshee gets attacked it cloaks etc, standard ai. Tho as I said earlier, the units with spells only react by using their spells if they get attacked, not if you get close to them, so easy to move close to them and then start attacking them, would be more fun if they reacted even if you got close to them.
For example:
If range of Banshee = true, then cloak, if not in range = true, then decloak to save energy. You know what I mean :)
P.S I know I linked infestor trigger, I just took banshee as an example. I also have a trigger for an infestor that is burrowed, it casts infestad terrans all over the place like a mad man if u attack it.
Why would I want to "save" a variable? Variables are not in the way, and makes it easier to change a trigger if you totally remake them later on. I use variables on all my triggers except "picked unit".
Also you save memory by using variables, the more "triggering unit" you use, the more memory your map uses, which is bad. Use variables on "triggering unit" aswell mate.
You want to keep these as low as possible, and by using variables you lower them greatly. Let's say you have a trigger that you use 15x "triggering unit" on, a long trigger, if you use a variable instead to replace "triggering unit" with the "triggering unit variable" you save 14x function calls.
Got the impression that you thought I was being rude and offended, if so I'm sorry, wasn't rude at all was just telling you how it is :) And yes, we want to have as few function calls as possible to make our maps as smooth and fast as we can (optimized).
Therefor use variables for everything you can, for my triggers where I only use the function call once with the variable it wouldn't matter if I used triggering unit, but It's a habit I like to have, and it's a good habit! ;P
Back to the semi-topic!!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would really appreciate some help with making the Zombies on my map "wander around", but so far I can't seem to ADD an ability or behaviour to a unit in any way. Just "add behaviour from caster" which is a bullshit trigger that doesn't work.
Wish I was good with custom scripts and it might be a bit easier, but since I don't I would really appreciate som help with the "wander" system.
And as you know I can't go to data tab and give the units wander behaviour since they would wander around for players aswell :P
@redbean87: Go
Add behavior to unit from caster works...I use it all the time. How exactly are you using it?