HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to work around this ?

07-27-2003, 05:11 PM#1
hodi
Yo

I made an ability that "destroys" trees, the trees have to die at a certain time, one after another. Right now I gave all tree´s 10 life and made a 2nd Trigger that damages the trees with 1dmg every second.
Ok fine, this works alright, BUT if there are more than 3 trees (I tested it with 3) the trees die too late, and if there are less than 3 they die too fast.
Is there anyway to make a Generic-Timer for a tree? I´d say no, so I ask: Is there any way around a Generic Timer which can be placed in a Loop Action?

I hope you understood what I wrote above (and I also hope that some1 answers this, unlike some other threads of mine)
hodi emote_sweat
07-27-2003, 07:37 PM#2
Kerry
Quote:
Originally posted by hodi
I made an ability that "destroys" trees, the trees have to die at a certain time, one after another. Right now I gave all tree´s 10 life and made a 2nd Trigger that damages the trees with 1dmg every second.
Ok fine, this works alright, BUT if there are more than 3 trees (I tested it with 3) the trees die too late, and if there are less than 3 they die too fast.
Is there anyway to make a Generic-Timer for a tree? I´d say no, so I ask: Is there any way around a Generic Timer which can be placed in a Loop Action?

Can't you just put a wait of 10 seconds after the spell is cast and then when 10 seconds have passed it picks the targeted trees and kills them.

Quote:
I hope you understood what I wrote above (and I also hope that some1 answers this, unlike some other threads of mine)
hodi emote_sweat


There are a lot of topics in this forum and it is hard to answer everything but the moderators and certain members help as good as they can.
07-27-2003, 08:13 PM#3
hodi
I can´t just kill it after 10 seconds, the spell targets every unit around the caster 1 after another if I set a wait 10sec into this loop it will take 10 seconds till the next tree gets "attacked" and this´ll bore the player. If I put the wait 10 sec after the loop it won´t kill the trees at the right time.

Mostly, threads don´t get answered because it´s a simple question which can be found with the search button, why no one tries to at least give a hint in threads with "hard"/rare problems is something I ll never understand.

thx for the answer tho, but if it was that simple I´d already figured it out.

hodi

PS: If some1 has an idea just post it, I have enough time to try it next week.
07-27-2003, 08:59 PM#4
Newhydra
In pseudo code:

event-spell is started
conditions-spell=killtrees
actions-
set array = trees targetted
wait 10 seconds
for each i from 1 to end of array destroy array[i]
07-27-2003, 09:02 PM#5
hodi
Yes, that´s excatly what I though, but everytime I did so it killed all targetted trees at once ;(
Hmm gonna try this over and over again then I guess...

thx
07-27-2003, 09:14 PM#6
Newhydra
Huh? I thought you wanted all the trees to die at the same time...Explain exactly what you need ;)
07-27-2003, 09:27 PM#7
hodi
OK,

blabla 1
Events
Unit - xxx Finishes casting an ability
Conditions
(Ability being cast) Equal to yyy
Actions
Set FluteUser = (Triggering unit)
Set x = 0
Unit - Pause FluteUser
Destructible - Pick every destructible within 300.00 of (Position of FluteUser) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Destructible-type of (Picked destructible)) Equal to Ruins Tree Wall
((Matching destructible) is alive) Equal to True
((Matching destructible) is invulnerable) Equal to False
Then - Actions
Set x = (x + 1)
Set FluteTargets[x] = (Picked destructible)
Else - Actions
Do nothing

this is what I did, After this there Is a Loop Action for each Interger A from 1 to x.
Now I want to add something like an Generic Timer for each targetted tree. I´ve made a seconde Trigger that I command to run in the Loop but this makes the Ability run an endless loop ... looks funny, but really is a pain in the ***.