• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Duration Problem

Status
Not open for further replies.
Level 12
Joined
Mar 13, 2012
Messages
1,121
You want to remove them after some time? Then you have store them and remove them, your trigger does nothing of that kind so far.

If Im getting something wrong here, please tell me.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
you means trigger is uncomplete? what i miss in trigger? tell me please

Save those trees in variables and destroy them after some time, thats whats missing. You just create them. Is that ok as a solution or should I provide a testmap?
 
Level 4
Joined
Jan 12, 2014
Messages
64
  • Regrow
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to regrow 22
    • Actions
      • Set p1 = (Target point of ability being cast)
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set p2 = (p1 offset by 150.00 towards (Real((45 x (Integer A)))) degrees)
          • Destructible - Create a Ashenvale Tree Wall at p2 facing (Random angle) with scale 1.00 and variation 0
          • Custom script: call RemoveLocation(udg_p2)
      • Custom script: call RemoveLocation(udg_p1)
No One Can't Help Me For This Problem??:ogre_icwydt:
 

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
  • Regrow
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to regrow 22
    • Actions
      • Set p1 = (Target point of ability being cast)
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set p2 = (p1 offset by 150.00 towards (Real((45 x (Integer A)))) degrees)
          • Destructible - Create a Ashenvale Tree Wall at p2 facing (Random angle) with scale 1.00 and variation 0
          • Custom script: call RemoveLocation(udg_p2)
      • Custom script: call RemoveLocation(udg_p1)
No One Can't Help Me For This Problem??:ogre_icwydt:

Do you want to make the trees invisible? Or remove/destroy them after a period of time?

To any of those, use some sort of timer (I don't recommend using waits). Store an integer variable for every group of trees (use arrays) and have it increase every second, for example -- and when it reaches a certain amount (the desired time), use 'Destructible - Kill / Remove / Hide' depending on what you want to happen.

I'm assuming you want them to fall, so you should use 'Destructible - Kill'.
 
Level 5
Joined
Jan 27, 2014
Messages
164
Code:
Creation
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Animate Dead
    Actions
        Set p1 = (Target point of ability being cast)
        For each (Integer A) from 1 to 8, do (Actions)
            Loop - Actions
                Set p2 = (p1 offset by 150.00 towards (45.00 x (Real((Integer A)))) degrees)
                Destructible - Create a Summer Tree Wall at p2 facing (Random angle) with scale 1.00 and variation 0
                Trigger - Run Duration <gen> (checking conditions)

Code:
Duration
    Events
    Conditions
    Actions
        Custom script:   local destructable udg_destruc_var
        Set destruc_var = (Last created destructible)
        Wait (5.00 x (Real((Level of Animate Dead for (Triggering unit))))) game-time seconds
        Destructible - Remove destruc_var
        Set destruc_var = No destructible

This, I believe. Settle the leaks yourself. I believe you're capable of doing it.
 
Level 4
Joined
Jan 12, 2014
Messages
64
Do you want to make the trees invisible? Or remove/destroy them after a period of time?

To any of those, use some sort of timer (I don't recommend using waits). Store an integer variable for every group of trees (use arrays) and have it increase every second, for example -- and when it reaches a certain amount (the desired time), use 'Destructible - Kill / Remove / Hide' depending on what you want to happen.

I'm assuming you want them to fall, so you should use 'Destructible - Kill'.
i think remove trees is better because i write a regrow trigger for die trees, about your recommend , i don't understand what exactly you mean ,can you please tell me with trigger? please
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Use a local destructible array to store the trees. As you create them you increment a counter and store at the counter index the destructible. Use trigger sleep action with some loop that polls a timer (do not use polled wait as it leaks) to do the duration as it should be accurate to approximately a second. Finally you use another counter to loop through the local destructible array to remove them and null the array index (to prevent a leak).
 

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
Code:
        Custom script:   local destructable udg_destruc_var

This, I believe. Settle the leaks yourself. I believe you're capable of doing it.

Is it not 'destructible'? I don't know much about jass though so idk.

Also, maybe the trigger tags would be better.

This is probably exactly what you're looking for, OP. His/her whole post, I mean.

EDIT: Wow, it actually is, 'destructable'. Why? That's not even a word :<
 
Last edited:
Level 5
Joined
Jan 27, 2014
Messages
164
> Is it not 'destructible'?
Can't remember this completely myself.
As far as I know JASS recognises it as Destructable.

The trigger I posted is MUI.
It's up to you to try it or use another's opinion.
Obviously, if what I provided is indeed what you wanted.
Your description is pretty vague.
 
Status
Not open for further replies.
Top