Im starting off on my map and i cant get tree's to spawn again with a set limit... i have it spawn trees at a random point in Wood Total Area <gen> after 30 seconds but then no matter what i try i cant get what i want it to do. I want after a certain amount of time for trees to spawn in Wood Total Area <gen>. 1 for every 1 that has died. Here are my triggers so far for this...
-- Tree Count Events Time - Elapsed game time is 30.00 seconds Conditions Actions For each (Integer A) from 1 to 30, do (Actions) Loop - Actions Destructible - Create a TREE!!! at (Random point in Wood Total Area <gen>) facing (Random angle) with scale 1.00 and variation 0 Trigger - Turn on Tree Respawn <gen>
-- Tree Count Dead Events Destructible - A destructible within (Entire map) dies Conditions Actions Set DeadTreeCount = (DeadTreeCount + 1.00)
-- Tree Respawn Events Time - Every 30.00 seconds of game time Conditions Actions For each (Integer A) from 1 to (Integer(DeadTreeCount)), do (Actions) Loop - Actions Destructible - Create a TREE!!! at (Random point in Wood Total Area <gen>) facing (Random angle) with scale 1.00 and variation 0 Set DeadTreeCount = (DeadTreeCount - 1.00)
i think i know your problem. its within the last trigger you did.
Tree Respawn Events Time - Every 30.00 seconds of game time Conditions Actions For each (Integer A) from 1 to (Integer(DeadTreeCount)), do (Actions) Loop - Actions Destructible - Create a TREE!!! at (Random point in Wood Total Area <gen>) facing (Random angle) with scale 1.00 and variation 0 Set DeadTreeCount = (DeadTreeCount - 1.00)
you should change this to event every 30 sec conditions actions for 1 to DeadTreeCount do //create your tree //endfor set DeadTreeCount = 0
becouse the way you did it, it decreased the DeadTreeCounter while waiting to reach it - if you change it's value within the loop, you change it in the endloop condition as well. so if you want to crate, lets sey 10 trees you would only create 5.
loop1 create tree TreeCounter = TreeCounter - 1 counter = counter+1 exit if counter = TreeCounter endloop
thats the the trigger you created... you see that it does not exactly what you wanted.
Lord Raszuletc... loop1 create tree TreeCounter = TreeCounter - 1 counter = counter+1 exit if counter = TreeCounter endloop
thats the the trigger you created... you see that it does not exactly what you wanted.
hope you understood what i ment.
- Raszul
-although i'm not totally sure on this-, i'm pretty sure the internal structure of the loop actions actually go bj_loopvarA = 1 bj_finishvarA = treecount
and then it loops using those 2 variables instead of the actual variable
although what you said is true under other circumstances
but maybe ur right if his problem is only getting 1/2 the trees
as for the original question
the other thing i'd ask is why use a real variable when you can just use an integer for incrementing treedeadcount
if its still not working display a text message of the value of deadtreecount, to see if its actually increasing the variable correctly