• 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.

[Solved] Spell keeps self-casting itself

Status
Not open for further replies.
Level 20
Joined
Apr 14, 2012
Messages
2,901
Hello;

I'm just going to get straight to the point: I made a spell which does some things, and I made a two triggers for it: one that triggers at cast, and one that does the loop.

The triggers:


  • ER Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Earth's Rampage
    • Actions
      • Set ER_Caster[1] = (Triggering unit)
      • Set ER_TempPlayer = (Owner of ER_Caster[1])
      • Selection - Remove ER_Caster[1] from selection for ER_TempPlayer
      • Unit - Pause ER_Caster[1]
      • Unit - Make ER_Caster[1] Invulnerable
      • Set ER_StartPoint = (Position of ER_Caster[1])
      • For each (Integer ER_TempInteger) from 1 to 7, do (Actions)
        • Loop - Actions
          • Set ER_TempReal = (ER_TempReal + 200.00)
          • Set ER_TempPoint = (ER_StartPoint offset by ER_TempReal towards (Facing of ER_Caster[1]) degrees)
          • Unit - Create 1 ER_Dummy for ER_TempPlayer at ER_TempPoint facing Default building facing degrees
          • Set ER_AoE = 250.00
          • Set ER_Dummy[ER_TempInteger] = (Last created unit)
          • Set ER_DummyPoint = (Position of ER_Dummy[ER_TempInteger])
          • Set ER_DumymGroup = (Units within ER_AoE of ER_DummyPoint matching (((Matching unit) belongs to an enemy of ER_TempPlayer) Equal to True))
          • Unit Group - Add ER_Dummy[ER_TempInteger] to ER_DumymGroup
          • Unit Group - Pick every unit in ER_DumymGroup and do (Actions)
            • Loop - Actions
              • Unit - Cause ER_Dummy[ER_TempInteger] to damage (Picked unit), dealing 300.00 damage of attack type Chaos and damage type Divine
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Dummy Impale for ER_Dummy[ER_TempInteger]) Equal to 0
                • Then - Actions
                  • Unit - Add Dummy Impale to ER_Dummy[ER_TempInteger]
                  • Unit - Order ER_Dummy[ER_TempInteger] to Undead Crypt Lord - Impale ER_DummyPoint
                  • Unit - Remove Dummy Impale from ER_Dummy[ER_TempInteger]
                • Else - Actions
          • Set ER_Wait[1] = 1.00
          • Unit - Add a ER_Wait[1] second Generic expiration timer to ER_Dummy[ER_TempInteger]
          • Wait ER_Wait[1] seconds
      • For each (Integer ER_TempInteger) from 1 to 7, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in ER_DumymGroup and do (Actions)
            • Loop - Actions
              • Unit Group - Remove (Picked unit) from ER_DumymGroup
          • Custom script: set udg_ER_Dummy[udg_ER_TempInteger] = null
      • Custom script: call RemoveLocation(udg_ER_TempPoint)
      • Countdown Timer - Start ER_Timer as a One-shot timer that will expire in ER_Wait[1] seconds
      • Trigger - Turn on ER Loop <gen>


and:


  • ER Loop
    • Events
      • Time - ER_Timer expires
    • Conditions
    • Actions
      • For each (Integer ER_TempInteger) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set ER_TempReal = (Random real number between 1.00 and 360.00)
          • Set ER_TempPoint = (ER_StartPoint offset by 200.00 towards ER_TempReal degrees)
          • Unit - Create 1 ER_Dummy for ER_TempPlayer at ER_TempPoint facing Default building facing degrees
          • Set ER_Dummy[ER_TempInteger] = (Last created unit)
          • Set ER_DummyPoint = (Position of ER_Dummy[ER_TempInteger])
          • Set ER_DumymGroup = (Units within ER_AoE of ER_DummyPoint matching (((Matching unit) belongs to an enemy of ER_TempPlayer) Equal to True))
          • Unit Group - Add ER_Dummy[ER_TempInteger] to ER_DumymGroup
          • Unit Group - Pick every unit in ER_DumymGroup and do (Actions)
            • Loop - Actions
              • Unit - Cause ER_Dummy[ER_TempInteger] to damage (Picked unit), dealing 300.00 damage of attack type Chaos and damage type Divine
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Dummy Impale for ER_Dummy[ER_TempInteger]) Equal to 0
                • Then - Actions
                  • Unit - Add Dummy Impale to ER_Dummy[ER_TempInteger]
                  • Unit - Order ER_Dummy[ER_TempInteger] to Undead Crypt Lord - Impale ER_DummyPoint
                  • Unit - Remove Dummy Impale from ER_Dummy[ER_TempInteger]
                • Else - Actions
          • Set ER_Wait[1] = 1.00
          • Unit - Add a ER_Wait[1] second Generic expiration timer to ER_Dummy[ER_TempInteger]
          • Wait ER_Wait[1] seconds
      • Selection - Add ER_Caster[1] to selection for ER_TempPlayer
      • Unit - Unpause ER_Caster[1]
      • Unit - Make ER_Caster[1] Vulnerable
      • Trigger - Turn off (This trigger)


What's weird is the first time it is cast, it will always loop the two triggers infinitely.

Help?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Don't use Pause unit for spells. It's bad spell making.

As an alternative, you could use a hidden ability based on channel and making it disable other abilities. But even that might have side effects and it blacks out the command card.

Try using channel, and adjusting follow through time. If the caster stops casting, break the spell.

SetUnitPropWindow(unit, 0) makes the unit unable to move, but it can turn and do other stuff also.
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
Don't use Pause unit for spells. It's bad spell making.


Try using channel, and adjusting follow through time. If the caster stops casting, break the spell.

SetUnitPropWindow(unit, 0) makes the unit unable to move, but it can turn and do other stuff also.

Maybe I'll try to use SetUnitPropWindow first; instead of Pause Unit.

What do i do with Channel? Do I base the ability of that or give it to a dummy?
 
Level 7
Joined
Jan 22, 2013
Messages
293
So I should base the ability on Channel? Is that what you're saying?

Lol, I love how they all say the same thing but still don't answer the new question you ask.

The channel spell has a way to lock a hero into a trance like state similar to pause unit. Only it will allow you to play animations and such.

The way to lock this person is the Follow Through time.


Also to make the spell work at all you need to set the ability to visible. or w/e I don't know the location of that in the channel spells data off the top of my head.


Yes you should use channel, while the followthrough time is the lasting time of all the spell effects going on.\

Edit: Overall I would say use BigBadVoodoo Ability, because you can order stop when you want lol.
 
Level 7
Joined
Jan 22, 2013
Messages
293
what is this spell supposed to do exactly ?

u should also know that this spell is not MUI this way.

like the others said the problem is the wait.

Whats wrong with pausing units ? i never knew this to be a problem...


This spell is from my workshop he is asking for aid, he is working on a request of gumx or something like that.


I will bring over what the spell is ment to do.





HERE:


Name: Earth's Rampage
Target Type: No Target
Levels: 1
Spell Type: Hero

Description: The hero is enraged and stomps in a line creating 7 earthquakes(war stomp basically). Distance of each earthquake from the next is 200.
Number of stomps on the ground is 10 in any direction. Each earthquake deals 300 damage pure and stuns 2 seconds. Delay time for each stomp is 1 second. AOE of each earthquake is 250.

Extra:
> The hero stomps first where he is facing creating 7 earthquakes (warstomp)
> Hero cannot be controlled during the spell
> The hero damages units in front of him and in 250 AOE of each earthquake (warstomp) gets damaged 300 pure and stuns 2 seconds
> One second has pasted and another stomp from the hero comes. But, it is random where he chooses to stomp for example like a directions (north, north east, north west, west, east, south west, south east, south.)
> The hero repeats 10 times.
> not interrupt-able
> Hero is now controllable after 10 stomps

Additional Information:
- okay this one is very confusing i'm sorry about that.
- So stomps in a line is impale but instead of impale effect can it be warstomp?
- Number of stomps is 10 in any direction. This one is the hero can stomp in any direction. For example, North, North West, West, South West, South, South East, East, and North East. So the hero can turn in direction within these areas.
- The hero stomps 10 times means 10 impales with the warstomp effect
- The hero cannot be controlled during this spell.
- Creating 7 earthquakes oh this is the effect of warstomp in possible can u make 7 of them?
- this one must be channeling :D

GUI - True


I gave Gave him a bonus suggestion here:

Your spell is very detailed, I understand ever single part of it. I honestly like your creativity. Keep it up, I like that. I do have one suggestion, why make it a channel? I can make it have like 7 individual fissures that travel infront of him dealing damage where the randoming zigzagging lines are going. Just a suggestion for you to think about.


He agreed to the update.






So The spell is ment to work in these stages:

>Hero Stomps
>Loop setting 7 different earthquake dummies.
//Info: After a dummy casts the earthquake, that dummy is removed and a new dummy is made at the location the earthquakes target location was, then it forms a new direction adding a random angle left or right of current travel angle by 1-20 to the left or 1-20 to the right, this throws a line of impale travel working like a fissure traveling along the earth, with 7 different starters, each one has a % chance of splitting brining a new line of impales, I think the fair amount would be for it to only travel 2-3 times short distances to have a zig zag effect.

The spell isn't really hard, it should be possible to fit it all into one trigger in GUI using local real's and local units. + it was no longer requested to be a channel spell.


truly all you to do is this:


Local shadows

create 7 dummies to cast impales
> Random angle each dummy to cast matching distance away
> research the time for the spells effects to reach that point then start new travel angle with % chance to produces 1-2 bonus traveling fissures.
> units that are hit by them are damaged and are stunned.
Yada Yada
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
what is this spell supposed to do exactly ?

u should also know that this spell is not MUI this way.

like the others said the problem is the wait.

Whats wrong with pausing units ? i never knew this to be a problem...


I am very much in knowledge that this spell is MUI; I'm going to use a unit indexer once I know this spell works with one unit.
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
Okay I tried the indexing method and this is what I got:

  • ER Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Earth's Rampage
    • Actions
      • Set ER_MaxIndex = (ER_MaxIndex + 1)
      • Set ER_Caster[ER_MaxIndex] = (Triggering unit)
      • Set ER_TempPlayer[ER_MaxIndex] = (Owner of ER_Caster[ER_MaxIndex])
      • Selection - Remove ER_Caster[ER_MaxIndex] from selection for ER_TempPlayer[ER_MaxIndex]
      • Unit - Make ER_Caster[ER_MaxIndex] Invulnerable
      • Set ER_StartPoint[ER_MaxIndex] = (Position of ER_Caster[ER_MaxIndex])
      • For each (Integer ER_TempMax) from 1 to ER_MaxIndex, do (Actions)
        • Loop - Actions
          • For each (Integer ER_TempInteger) from 1 to 7, do (Actions)
            • Loop - Actions
              • Set ER_TempReal = (ER_TempReal + 200.00)
              • Set ER_TempPoint[ER_MaxIndex] = (ER_StartPoint[ER_MaxIndex] offset by ER_TempReal towards (Facing of ER_Caster[ER_MaxIndex]) degrees)
              • Unit - Create 1 ER_Dummy for ER_TempPlayer[ER_MaxIndex] at ER_TempPoint[ER_MaxIndex] facing Default building facing degrees
              • Set ER_AoE = 250.00
              • Set ER_Dummy[ER_TempInteger] = (Last created unit)
              • Set ER_DummyPoint = (Position of ER_Dummy[ER_TempInteger])
              • Set ER_DumymGroup = (Units within ER_AoE of ER_DummyPoint matching (((Matching unit) belongs to an enemy of ER_TempPlayer[ER_MaxIndex]) Equal to True))
              • Unit Group - Add ER_Dummy[ER_TempInteger] to ER_DumymGroup
              • Unit Group - Pick every unit in ER_DumymGroup and do (Actions)
                • Loop - Actions
                  • Unit - Cause ER_Dummy[ER_TempInteger] to damage (Picked unit), dealing 300.00 damage of attack type Chaos and damage type Divine
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Dummy Impale for ER_Dummy[ER_TempInteger]) Equal to 0
                    • Then - Actions
                      • Unit - Add Dummy Impale to ER_Dummy[ER_TempInteger]
                      • Unit - Order ER_Dummy[ER_TempInteger] to Undead Crypt Lord - Impale ER_DummyPoint
                      • Unit - Remove Dummy Impale from ER_Dummy[ER_TempInteger]
                    • Else - Actions
              • Set ER_Wait[ER_MaxIndex] = 1.00
              • Unit - Add a ER_Wait[ER_MaxIndex] second Generic expiration timer to ER_Dummy[ER_TempInteger]
              • Wait ER_Wait[ER_MaxIndex] seconds
      • For each (Integer ER_TempInteger) from 1 to 7, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in ER_DumymGroup and do (Actions)
            • Loop - Actions
              • Unit Group - Remove (Picked unit) from ER_DumymGroup
          • Custom script: set udg_ER_Dummy[udg_ER_TempInteger] = null
      • Countdown Timer - Start ER_Timer as a One-shot timer that will expire in ER_Wait[ER_MaxIndex] seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ER_MaxIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on ER Loop <gen>
        • Else - Actions



  • ER Loop
    • Events
      • Time - ER_Timer expires
    • Conditions
    • Actions
      • For each (Integer ER_TempInteger) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set ER_TempReal = (Random real number between 1.00 and 360.00)
          • Set ER_TempPoint[ER_TempInteger] = (ER_StartPoint[ER_MaxIndex] offset by 200.00 towards ER_TempReal degrees)
          • Unit - Create 1 ER_Dummy for ER_TempPlayer[ER_MaxIndex] at ER_TempPoint[ER_TempInteger] facing Default building facing degrees
          • Set ER_Dummy[ER_TempInteger] = (Last created unit)
          • Set ER_DummyPoint = (Position of ER_Dummy[ER_TempInteger])
          • Set ER_DumymGroup = (Units within 250.00 of ER_DummyPoint matching (((Matching unit) belongs to an enemy of ER_TempPlayer[ER_MaxIndex]) Equal to True))
          • Unit Group - Add ER_Dummy[ER_TempInteger] to ER_DumymGroup
          • Unit Group - Pick every unit in ER_DumymGroup and do (Actions)
            • Loop - Actions
              • Unit - Cause ER_Dummy[ER_TempInteger] to damage (Picked unit), dealing 300.00 damage of attack type Chaos and damage type Divine
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Dummy Impale for ER_Dummy[ER_TempInteger]) Equal to 0
                • Then - Actions
                  • Unit - Add Dummy Impale to ER_Dummy[ER_TempInteger]
                  • Unit - Order ER_Dummy[ER_TempInteger] to Undead Crypt Lord - Impale ER_DummyPoint
                  • Unit - Remove Dummy Impale from ER_Dummy[ER_TempInteger]
                • Else - Actions
          • Set ER_Wait[ER_MaxIndex] = 1.00
          • Unit - Add a ER_Wait[ER_MaxIndex] second Generic expiration timer to ER_Dummy[ER_TempInteger]
          • Wait ER_Wait[ER_MaxIndex] seconds
      • Selection - Add ER_Caster[ER_MaxIndex] to selection for ER_TempPlayer[ER_MaxIndex]
      • Unit - Make ER_Caster[ER_MaxIndex] Vulnerable
      • Trigger - Turn off (This trigger)
 
ok almost correct. a few things to change tho.
first in ur loop trigger u have to deindex when the instance has ended.

u dont need the timer as event just use every 1 seconds. get rid of the countdown timers completely.

get rid of the waits and instead use an integer to do ur counting.

u need to clean ur leaks. points and groups
ur loop in the loop trigger should be for each integer tempInt from 1 to ER_MaxIndex
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
ok almost correct. a few things to change tho.
first in ur loop trigger u have to deindex when the instance has ended.

u dont need the timer as event just use every 1 seconds. get rid of the countdown timers completely.

get rid of the waits and instead use an integer to do ur counting.

u need to clean ur leaks. points and groups
ur loop in the loop trigger should be for each integer tempInt from 1 to ER_MaxIndex

Wait I almost got it:

When you say deindex I have to: Set Max Index = Max index - 1 right?

When you say use an integer to do my counting, what do you mean and how?

How about the loop in the first trigger, did I do it right?
 
Wait I almost got it:

When you say deindex I have to: Set Max Index = Max index - 1 right?

When you say use an integer to do my counting, what do you mean and how?

How about the loop in the first trigger, did I do it right?

yes deindex by decreasing the max index. u also need to deindex the things u have saved. umm look at how i have that in my example in the loop trigger. i do set unit[ tempInt] = unit[ maxindex]
then u de-index

i mean if ur spell last 120 seconds and ur periodic event is every 1 second.

u set an integer like this everytime the spell runs.
counterInt = counterInt + 1
then do an ITE
if couterInt >= 120 then
deindex everything

in the first trigger i wouldnt damage the units let that be in the loop trigger.
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
here u go give this a try. i changed it a bit lol. u can select the unit but it removes the selection every .04 seconds so by the time u select it and it gets deselected u cant do anything to it.

Wow you really changed it... but the original concept disappeared...

The caster was supposed to stay in place and summon the dummy units; not move around.

Hmm... can I request your help again in making the original trigger MUI and never mind the selection problem?
 
Wow you really changed it... but the original concept disappeared...

The caster was supposed to stay in place and summon the dummy units; not move around.

Hmm... can I request your help again in making the original trigger MUI and never mind the selection problem?

ooo dang i mustve misread it lol.

i should be able to change it lol

heres the new one i left the old one that moves on there to. also i still keep it from moving as much as possible
 

Attachments

  • Earth's Rampage.w3x
    22.7 KB · Views: 51
As the request states, the caster will create 7 war stomps in a row, in front of him. The 7 stomps I assumed would need a dummy unit... with each stomp having a delay in between.

lol i must be really tired haha here u go the unit to change is in the casting trigger.
 

Attachments

  • Earth's Rampage.w3x
    23.1 KB · Views: 77
Last edited:
Level 20
Joined
Apr 14, 2012
Messages
2,901
Okay I updated my trigger:

  • ER Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Earth's Rampage
    • Actions
      • Selection - Remove ER_Caster[ER_MaxIndex] from selection for ER_TempPlayer[ER_MaxIndex]
      • Unit - Make ER_Caster[ER_MaxIndex] Invulnerable
      • Set ER_MaxIndex = (ER_MaxIndex + 1)
      • Set ER_Caster[ER_MaxIndex] = (Triggering unit)
      • Set ER_StartPoint[ER_MaxIndex] = (Position of ER_Caster[ER_MaxIndex])
      • Set ER_TempPlayer[ER_MaxIndex] = (Owner of ER_Caster[ER_MaxIndex])
      • Set ER_MaxUnits[ER_MaxIndex] = 7
      • Set ER_CreatedUnits[ER_MaxIndex] = 0
      • Set ER_TempReal[ER_MaxIndex] = 0.00
      • Set ER_FinalReal[ER_MaxIndex] = 0.00
      • Set ER_Counter[ER_MaxIndex] = 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ER_MaxIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on ER Loop <gen>
        • Else - Actions



  • ER Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ER_CurrentIndex) from 1 to ER_MaxIndex, do (Actions)
        • Loop - Actions
          • Set ER_Counter[ER_CurrentIndex] = (ER_Counter[ER_CurrentIndex] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ER_Counter[ER_CurrentIndex] Equal to 33
            • Then - Actions
              • Set ER_TempReal[ER_CurrentIndex] = (ER_TempReal[ER_CurrentIndex] + 200.00)
              • Set ER_TempPoint[ER_CurrentIndex] = (ER_StartPoint[ER_CurrentIndex] offset by ER_TempReal[ER_CurrentIndex] towards (Facing of ER_Caster[ER_CurrentIndex]) degrees)
              • Unit - Create 1 ER_Dummy for ER_TempPlayer[ER_CurrentIndex] at ER_TempPoint[ER_CurrentIndex] facing Default building facing degrees
              • Set ER_Counter[ER_CurrentIndex] = 0
              • Set ER_AoE = 250.00
              • Set ER_Dummy[ER_CurrentIndex] = (Last created unit)
              • Set ER_DummyPoint = (Position of ER_Dummy[ER_CurrentIndex])
              • Set ER_DumymGroup = (Units within ER_AoE of ER_DummyPoint matching (((Matching unit) belongs to an enemy of ER_TempPlayer[ER_CurrentIndex]) Equal to True))
              • Unit Group - Add ER_Dummy[ER_CurrentIndex] to ER_DumymGroup
              • Unit Group - Pick every unit in ER_DumymGroup and do (Actions)
                • Loop - Actions
                  • Unit - Cause ER_Dummy[ER_CurrentIndex] to damage (Picked unit), dealing 300.00 damage of attack type Chaos and damage type Divine
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Dummy Impale for ER_Dummy[ER_CurrentIndex]) Equal to 0
                    • Then - Actions
                      • Unit - Add Dummy Impale to ER_Dummy[ER_CurrentIndex]
                      • Unit - Order ER_Dummy[ER_CurrentIndex] to Undead Crypt Lord - Impale ER_DummyPoint
                      • Unit - Remove Dummy Impale from ER_Dummy[ER_CurrentIndex]
                    • Else - Actions
              • Custom script: call DestroyGroup(udg_ER_DumymGroup)
              • -------- Recycling --------
              • Custom script: call RemoveLocation(udg_ER_TempPoint[udg_ER_CurrentIndex])
              • Custom script: call RemoveLocation(udg_ER_DummyPoint)
              • Set ER_CreatedUnits[ER_CurrentIndex] = (ER_CreatedUnits[ER_CurrentIndex] + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ER_CreatedUnits[ER_CurrentIndex] Equal to ER_MaxUnits[ER_CurrentIndex]
                • Then - Actions
                  • For each (Integer ER_TempInt) from 1 to 10, do (Actions)
                    • Loop - Actions
                      • Set ER_FinalReal[ER_TempInt] = (Random real number between 1.00 and 360.00)
                      • Set ER_TempPoint[ER_TempInt] = (ER_StartPoint[ER_TempInt] offset by 200.00 towards ER_FinalReal[ER_TempInt] degrees)
                      • Unit - Create 1 ER_Dummy for ER_TempPlayer[ER_TempInt] at ER_TempPoint[ER_TempInt] facing Default building facing degrees
                      • Set ER_Dummy[ER_TempInt] = (Last created unit)
                      • Set ER_DummyPoint = (Position of ER_Dummy[ER_TempInt])
                      • Set ER_DumymGroup = (Units within 250.00 of ER_DummyPoint matching (((Matching unit) belongs to an enemy of ER_TempPlayer[ER_TempInt]) Equal to True))
                      • Unit Group - Add ER_Dummy[ER_TempInt] to ER_DumymGroup
                      • Unit Group - Pick every unit in ER_DumymGroup and do (Actions)
                        • Loop - Actions
                          • Unit - Cause ER_Dummy[ER_TempInt] to damage (Picked unit), dealing 300.00 damage of attack type Chaos and damage type Divine
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Level of Dummy Impale for ER_Dummy[ER_TempInt]) Equal to 0
                            • Then - Actions
                              • Unit - Add Dummy Impale to ER_Dummy[ER_TempInt]
                              • Unit - Order ER_Dummy[ER_TempInt] to Undead Crypt Lord - Impale ER_DummyPoint
                              • Unit - Remove Dummy Impale from ER_Dummy[ER_TempInt]
                            • Else - Actions
                      • Custom script: call DestroyGroup(udg_ER_DumymGroup)
                      • Custom script: call RemoveLocation(udg_ER_DummyPoint)
                      • Custom script: call RemoveLocation(udg_ER_TempPoint[udg_ER_TempInt])
                  • Selection - Add ER_Caster[ER_MaxIndex] to selection for ER_TempPlayer[ER_MaxIndex]
                  • Unit - Make ER_Caster[ER_MaxIndex] Vulnerable
                  • Set ER_TempPoint[ER_CurrentIndex] = ER_TempPoint[ER_MaxIndex]
                  • Set ER_TempReal[ER_CurrentIndex] = ER_TempReal[ER_MaxIndex]
                  • Set ER_FinalReal[ER_TempInt] = ER_FinalReal[ER_MaxIndex]
                  • Set ER_Caster[ER_CurrentIndex] = ER_Caster[ER_MaxIndex]
                  • Set ER_Counter[ER_CurrentIndex] = ER_Counter[ER_MaxIndex]
                  • Set ER_CreatedUnits[ER_CurrentIndex] = ER_CreatedUnits[ER_MaxIndex]
                  • Set ER_MaxIndex = (ER_MaxIndex - 1)
                  • Set ER_CurrentIndex = (ER_CurrentIndex - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ER_MaxIndex Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
            • Else - Actions


Now, pay attention to the very last loop you see, which is: For Each Integer (ER_TempInt)...

It's supposed to create war stomps at different degrees from the caster but in the same offset. The problem is it only creates one war stomp, at a constant degree.

How do I fix this? Please help.
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
Maybe there are 10 loops, but the effects are created at the same point. Have you unticked File -> preferences -> test map -> Use fixed random seed?

Use game - display text message (convert temp index to string) to see if it loops 10 times.

I have done both:

I unticked Use Fixed Random Seed = no noticeable change.

I used Game - Display Text... = I know that it loops now, thanks. But the effects are created at one point.

Any recommended fix?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243

  • For each (Integer ER_TempInt) from 1 to 10, do (Actions)
    • Loop - Actions
      • Set ER_DummyPoint = (ER_StartPoint[ER_CurrentIndex] offset by 200.00 towards (36.00 x (Real(ER_TempInt))) degrees)
      • Unit - Create 1 ER_Dummy for ER_TempPlayer[ER_CurrentIndex] at ER_DummyPoint facing Default building facing degrees
      • Set ER_Dummy[ER_TempInt] = (Last created unit)
      • Set ER_DumymGroup = (Units within 250.00 of ER_DummyPoint matching (((Matching unit) belongs to an enemy of ER_TempPlayer[ER_TempInt]) Equal to True))
      • Unit Group - Pick every unit in ER_DumymGroup and do (Actions)
        • Loop - Actions
          • Unit - Cause ER_Dummy[ER_TempInt] to damage (Picked unit), dealing 300.00 damage of attack type Chaos and damage type Divine
      • Unit - Add a 0.30 second Generic expiration timer to ER_Dummy[ER_TempInt]
      • Custom script: call DestroyGroup(udg_ER_DumymGroup)
      • Custom script: call RemoveLocation(udg_ER_DummyPoint)
 
Status
Not open for further replies.
Top