have problem with wait

008

New Member
Reaction score
0
If the code is not in the editor it's because i translate some :p
When i don't put the wait - 4.00 it's all good but when i put it it doesn't work

Code:
try
    Event
        Unit - Paladin 0000 <gen>begin casting a spell
    Conditions
    Actions
        Set groupe = (Units within 300.00 of (Position of (Triggering unit)))
        Groupe unit - Pick every unit in groupe and do (Actions)
            loops - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    if - Conditions
                        (Picked unit) not equal to Paladin 0000 <gen>
                    Then - Actions
                        Unit - Pause (Picked unit)
                        special effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\NightElf\EntanglingRoots\EntanglingRootsTarget.mdl
                        Wait 4.00 seconds
                       special effect - Destroy (Last created special effect)
                        Unit - Pause (Picked unit)
                        Unit - Move (Picked unit) instantly to (Position of (Picked unit)), facing (Position of (Picked unit))
                   else - Actions
                        Do nothing
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Read the little text in the picture... I'll qoute it:
Use 'picked unit' to refer each unit as it is picked. This works for every unit in the group, including dead units. Wait actions should not be used within this function. Add actions to this function in the main display.

Basically... avoid using waits in a "pick every..." loop.

Hence split it up like this:
Code:
Untitled Trigger 003
    Events
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Special Effect - Create a special effect at (Center of (Playable map area)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
        Wait 4.00 seconds
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Unit - Pause (Picked unit)
Do note, this is just an example!:)
 

Attachments

  • yesj.jpg
    yesj.jpg
    71.3 KB · Views: 365

dragonhord

Knowledge is true opinion. - Plato
Reaction score
82
Generally it's because you're using picked unit, which is not maintained after a wait, but the above statement is right. Would work better :p. Problem is if they are paused it won't be the same units, so you might want to add all units within 300 aoe to a unit group, so it remembers the units that were hit by your spell, then you wait 4 seconds and then bring them all to the position of your hero like you intend... That would work better than both methods :p.
 

008

New Member
Reaction score
0
I don't understand all but now i'm not using with in the function but it's not working ...
Code:
try
    Event
        Unit - Paladin 0000 <gen> begin casting an ability
    Conditions
    Actions
        Set groupe = (Units within 300.00 of (Position of (Triggering unit)))
        Groupe unit - Pick every unit in groupe and do (Actions)
           Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    if - Conditions
                        (Picked unit) not equal toPaladin 0000 <gen>
                    Then - Actions
                        special effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\NightElf\EntanglingRoots\EntanglingRootsTarget.mdl
                        Unit - Pause (Picked unit)
                    Then - Actions
                        Do nothing
        Wait 4.00 seconds
        Groupe unit - Pick every unit in groupe and do (Actions)
            Loop - Actions
                special effect- Destroy (Last created special effect)
                Unit - (wake up ) (Picked unit)
                Unit - Move (Picked unit) instantly to (Position of (Picked unit)), facing (Position of (Picked unit))
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
>>>Unit - Move (Picked unit) instantly to (Position of (Picked unit)), facing (Position of (Picked unit))

Should maybe be more like this:
Unit - Move (Picked unit) instantly to (Position of (Triggering unit)), facing (Position of (Picked unit))

The event "Begins casting" should be "Starts the effect of ability"...
The difference?
Begins casting: this event fires, takes in action, before the unit has used the ability, before the unit has lost mana, before the cooldown on the ability has started... Hence, if a unit begins casting it, then orders to stop/move/do something else... The trigger will fire, but the unit will not lose mana and the cooldown wont start!
 

008

New Member
Reaction score
0
When i don't destroy the special effect in the same loop I create it it doesn't work.It just destroy one of the effect.
 

RedSword

New Member
Reaction score
4
That've already happened to me; simply do this :

Trigger:
  • Special Effect - Create a special effect at Temp_Point2 using Abilities\Spells\Human\Heal\HealTarget.mdl
    • Wait for (Last played sound) to be 0.00 seconds from finished playing
    • Special Effect - Destroy (Last created special effect)


(the middle line is your (fake-)wait ^^ (yes; 0 seconds), even if you have no sound, since it comes with the SFX model)
 

008

New Member
Reaction score
0
not working i try these thing but it don't do the action after the wait function
I try this
Code:
Groupe unit - Pick every unit in groupe and do (Actions)
    Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Picked unit) Not equal to Paladin 0000 <gen>
Then - Actions
    special effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\NightElf\EntanglingRoots\EntanglingRootsTarget.mdl
    Wait for (Last played sound) to be 0.00 seconds from finished playing
    Unit - Pause (Picked unit)
    special effect - Destroy (Last created special effect)
    Unit - ( wake up ) (Picked unit)
    Unit - Move (Picked unit) instantly to (Position of (Picked unit)), facing (Position of (Picked unit))

try this

Code:
Groupe unit - Pick every unit in groupe and do (Actions)
    Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Picked unit) Not equal to Paladin 0000 <gen>
Then - Actions
    special effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\NightElf\EntanglingRoots\EntanglingRootsTarget.mdl
    Wait for (Last played sound) to be 0.00 seconds from finished playing
    Unit - Pause (Picked unit)
   Wait 2.00 seconds
 special effect - Destroy (Last created special effect)
    Unit - ( wake up ) (Picked unit)
    Unit - Move (Picked unit) instantly to (Position of (Picked unit)), facing (Position of (Picked unit))
But it never work
 

RedSword

New Member
Reaction score
4
Try with "start effect of an ability" as event

EDIT : And have you tryed without pausing your unit ?
 

008

New Member
Reaction score
0
If i don't pause my unit it's just my unit can move but the special effect is not destroy.

Anyway goodnight and I hope someone have the answer :p
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
U cant use last created efect after waits u hav to store it in a variable then destroy the variable after the wait.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Create a new special efect variable. Then after u create ur special efect then set <ur variable> = last created special efect. After wait destroy special efect <ur variable>
 

008

New Member
Reaction score
0
now i have that
Then - Actions
special effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\NightElf\EntanglingRoots\EntanglingRootsTarget.mdl
Set speEffect = (Last created special effect)
special effect- Destroy (Last created special effect)
Unit - Move (Picked unit) instantly to (Position of (Picked unit)), facing (Position of (Picked unit))
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
U stil said destroy last created efect it needs to be destroy speEffect
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top