what I want is when my hero unit uses a ability that spawns a turret. I want something to count the number of turrets on the field for that player ,and if it goes higher the abilities' current allowed turrets it destroys the oldest turret.
easiest way to do it is have an integer variable, everytime u make a turret increase value by 1, and everytime u make a turrent run a seperate trigger that checks the integer value, if its 3 or less then do nothing if its more then you'd have to use other variables for each of the 3 turrets to tell it to kill the oldest one, make sense?
let me get a little more indepth...your event would be unit uses ability, then you'd have to find the ability your referencing...
you would first need an integer variable thats initially 0 and goes up 1 everytime the abliity is used...then when it is used you'd need to run a conditions check that checks the valuable of the integer variable and use the value to tell it what to do, IE: destroy unit 1 or 2 or 4 or whatever
ok let me c if i can give u a demonstration here without taking too much time....
event: unit uses ability-create turret
action: increase turrentvariable +1
if then else-
if value of turretvariable=3 or less then do nothing
if then else-
if value of turretvariable =4 then destroy turret#1 (first created tower that would have to be designated a unit variable upon creation), then: modify variable value of turretvariable =turretvariable -1
Ok so why not have your trigger move 'RegionX' on your turret that is created from the ability, remove that turret and create a new one. That way it is created from the trigger.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
^that is my question
bump
bump
bump
can someone plz help with this?
have you tried something like...
Event Unit is created
condition unit "triggering unit" belongs to player 1
action add triggering unit to unit group "player1units"
something of that nature perhaps?
yes but i dont want it to kill my hero unit
So i need to some how add the turret to the unit group but no the hero
with all due respect man, maybe you should actually explain your problem. You'd probably get a lot more help if you did that... >.>
what I want is when my hero unit uses a ability that spawns a turret. I want something to count the number of turrets on the field for that player ,and if it goes higher the abilities' current allowed turrets it destroys the oldest turret.
isnt there a different way to do it like, perhaps add a stock time and stock limit? almost like a purchase
but then how would it destory the oldest turret if you reach the limmit?
easiest way to do it is have an integer variable, everytime u make a turret increase value by 1, and everytime u make a turrent run a seperate trigger that checks the integer value, if its 3 or less then do nothing if its more then you'd have to use other variables for each of the 3 turrets to tell it to kill the oldest one, make sense?
but how does it even know if i place a turret?
how would i reference it in a trigger?
let me get a little more indepth...your event would be unit uses ability, then you'd have to find the ability your referencing... you would first need an integer variable thats initially 0 and goes up 1 everytime the abliity is used...then when it is used you'd need to run a conditions check that checks the valuable of the integer variable and use the value to tell it what to do, IE: destroy unit 1 or 2 or 4 or whatever
but the unit wont be on the field i think so there is no way to kill it
ok let me c if i can give u a demonstration here without taking too much time....
event: unit uses ability-create turret
action: increase turrentvariable +1 if then else- if value of turretvariable=3 or less then do nothing if then else- if value of turretvariable =4 then destroy turret#1 (first created tower that would have to be designated a unit variable upon creation), then: modify variable value of turretvariable =turretvariable -1
make sense?
first created tower that would have to be designated a unit variable upon creation ______________
how would you do that part? because i still do not know how to reference that turret QQ
@mfirelord: Go
referencing the unit would be "last created unit"
but it wasnt created in the trigger it was made from the ability
@mfirelord: Go
Ok so why not have your trigger move 'RegionX' on your turret that is created from the ability, remove that turret and create a new one. That way it is created from the trigger.