Cause [caster] to damage [target] problem -> implicit wait?

Overrated

New Member
Reaction score
0
Hi, I'm new to these forums, and currently just learning about mapmaking. Excuse my horrible grammar and/or spelling, as English is not my first language. I´v searched the forum to no avail, and now I turn to you guys for help.

I making a MUI (I think) Omnislash spell, but it randomly resets (to 1) my LDTempInt1 variable if I enable "Unit - Cause OmnislashCaster[LDTempInt1] to damage TempUnit...".

I made it work by using Dummy casters and spells instead, but I would really like to know the cause of this bug. We all know how Omnislash works, but my current code sometimes stops, and leaves the caster invulnerable, because the index variable I use to reference the different arrays resets to 1. I have commented out the "Unit-casue caster to damage..." line, and then it works.

Can that line somehow pause the trigger execution, and somehow allow different code to modify the variable? Am I missing something? Comments on leaks, non-MUI behaviour and such would also be welcome.

I outlined the codelines I think are of importance. Note that the formula for calculating the damage dealt is correct, and not the cause of the problem (tested).

Code:
Omnislash periodic
    Events
        Time - Every 0.05 seconds of game time
    Conditions
        (Number of units in OmnislashDummyGroup) Greater than 0
    Actions
        Unit Group - Pick every unit in OmnislashDummyGroup and do (Actions)
            Loop - Actions
               [COLOR="Red"] Set LDTempInt1 = (Custom value of (Picked unit))[/COLOR][COLOR="RoyalBlue"][SIZE="1"]<----- Getting my temp int to be used for referencing my caster and so on.[/SIZE][/COLOR]
                Set OmnislashTimer[LDTempInt1] = (OmnislashTimer[LDTempInt1] + 0.05)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        OmnislashTimer[LDTempInt1] Greater than or equal to OmnislashPeriod[LDTempInt1]
                    Then - Actions
                        Set Temp_Point = (Position of OmnislashCaster[LDTempInt1])
                        Set OmnislashTimer[LDTempInt1] = 0.00
                        Set Temp_Group = (Units within 600.00 of Temp_Point matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of OmnislashCaster[LDTempInt1])) Equal to True) and ((True E
                        Custom script:   call RemoveLocation(udg_Temp_Point)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Number of units in Temp_Group) Greater than 0
                            Then - Actions
                                Set TempUnit = (Random unit from Temp_Group)
                                Game - Display to (All players) the text: (Units in range:  + (String((Number of units in Temp_Group))))
                                Set Temp_Point = (Position of TempUnit)
                                Selection - Remove OmnislashCaster[LDTempInt1] from selection
                                Unit - Move OmnislashCaster[LDTempInt1] instantly to Temp_Point
                                Unit - Move (Picked unit) instantly to Temp_Point
                                Custom script:   call RemoveLocation(udg_Temp_Point)
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        And - All (Conditions) are true
                                            Conditions
                                                (Random integer number between 1 and 100) Less than or equal to (5 + ((Level of Whirlwind  for OmnislashCaster[LDTempInt1]) x 5))
                                    Then - Actions
                                        Game - Display to (All players) the text: Dealing AoE damage.
                                        Set Temp_Point = (Position of OmnislashCaster[LDTempInt1])
                                        Animation - Play OmnislashCaster[LDTempInt1]'s attack walk stand spin animation
                                        Special Effect - Create a special effect at Temp_Point using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
                                        Special Effect - Destroy (Last created special effect)
                                        Unit - Create 1 DummySelfcast for (Owner of (Picked unit)) at Temp_Point facing TempReal degrees
                                        Custom script:   call RemoveLocation(udg_Temp_Point)
                                        Unit - Add a 0.20 second Generic expiration timer to (Last created unit)
                                        Unit - Add Omnislash Aoe  to (Last created unit)
                                        Unit - Set level of Omnislash Aoe  for (Last created unit) to ((Level of Berserk  for OmnislashCaster[LDTempInt1]) + 1)
                                        Unit - Order (Last created unit) to Undead Lich - Frost Nova (Last created unit)
                                    Else - Actions
                                        Animation - Play OmnislashCaster[LDTempInt1]'s attack animation
                               [COLOR="DarkGreen"] Game - Display to (All players) the text: (LDTempInt:  + (String(LDTempInt1)))[/COLOR][COLOR="MediumTurquoise"]<--always correct tempint at this point.[/COLOR]
                                [SIZE="3"][COLOR="Red"]Unit - Cause OmnislashCaster[LDTempInt1] to damage TempUnit, dealing (Random real number between (75.00 + ((Real((Level of Berserk  for OmnislashCaster[LDTempInt1]))) x 25.00)) and (125.00 + ((Real((Level of Berserk  for OmnislashCaster[LDTempInt1]))) x 25.00))) damage of attack type Hero and damage type Universal[/COLOR][/SIZE][COLOR="DeepSkyBlue"]<---Disabeling this line makes the spell work perfectly. Why?[/COLOR]
                                Game - Display to (All players) the text: (Name of tempunit:  + (Name of TempUnit))
                               [COLOR="DarkGreen"] Game - Display to (All players) the text: (LDTempInt:  + (String(LDTempInt1)))[/COLOR][COLOR="MediumTurquoise"]<--- at this point, tempint sometimes has reverted to 1. Woooot[/COLOR]?:banghead:
                                Set Temp_Point = (Position of OmnislashCaster[LDTempInt1])
                                Custom script:   call RemoveLocation(udg_Temp_Point)
                                Special Effect - Create a special effect attached to the chest of OmnislashCaster[LDTempInt1] using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
                                Special Effect - Destroy (Last created special effect)
                                Set OmnislashAttacksPreformed[LDTempInt1] = (OmnislashAttacksPreformed[LDTempInt1] + 1)
                                Game - Display to (All players) the text: ((Increasing attackcounter to:  + (((String(OmnislashAttacksPreformed[LDTempInt1])) + /) + (String(OmnislashAttackLimit[LDTempInt1])))) + <Empty String>)
                            Else - Actions
                                Game - Display to (All players) the text: No units in range.
                                Set OmnislashAttacksPreformed[LDTempInt1] = OmnislashAttackLimit[LDTempInt1]
                        Custom script:   call DestroyGroup(udg_Temp_Group)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                OmnislashAttacksPreformed[LDTempInt1] Greater than or equal to OmnislashAttackLimit[LDTempInt1]
                            Then - Actions
                                Game - Display to (All players) the text: Omnislash End.
                                Unit - Remove (Picked unit) from the game
                                Set OmnislashAttackLimit[LDTempInt1] = 0
                                Set OmnislashAttacksPreformed[LDTempInt1] = 0
                                Set OmnislashTimer[LDTempInt1] = 0.00
                                Set OmnislashPeriod[LDTempInt1] = 0.00
                                Selection - Add OmnislashCaster[LDTempInt1] to selection for (Owner of OmnislashCaster[LDTempInt1])
                                Animation - Change OmnislashCaster[LDTempInt1]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
                                Animation - Play OmnislashCaster[LDTempInt1]'s stand ready animation
                                Unit - Make OmnislashCaster[LDTempInt1] Vulnerable
                                Set OmnislashCaster[LDTempInt1] = No unit
                            Else - Actions
                    Else - Actions
 

BarzahdX

Active Member
Reaction score
18
First of all, welcome to TheHelper.net! I hope you enjoy your stay as much as I do. :)

I've never attempted making an Omnislash trigger, so I don't know how they work. I also didn't bother reading the whole trigger because it would be futile.

HOWEVER! I did noticed what you colored red.. I think the problem is, you're setting 1 variable to all the picked units.. Which is impossible, it would constantly just change between the picked units until it hits the last one.. I could be wrong. Try setting it to an array, and + 1 on it too, so it's always a different variable, but that's essentially just a guess.

So although I don't have your answer, hopefully I found your problem--goodluck.
 

Overrated

New Member
Reaction score
0
First of all, welcome to TheHelper.net! I hope you enjoy your stay as much as I do. :)

I've never attempted making an Omnislash trigger, so I don't know how they work. I also didn't bother reading the whole trigger because it would be futile.

HOWEVER! I did noticed what you colored red.. I think the problem is, you're setting 1 variable to all the picked units.. Which is impossible, it would constantly just change between the picked units until it hits the last one.. I could be wrong. Try setting it to an array, and + 1 on it too, so it's always a different variable, but that's essentially just a guess.

So although I don't have your answer, hopefully I found your problem--goodluck.
Thank you for the response, but unfortunatly that is essentially what I'm already doing at spell init (not posted) - as instructed by Flare in his GUI MUI guide. The problem is very odd... Everything works perfectly if I use FrostNova casting dummy units instead of "make caster damage target"... That single line makes LDTempInt1 go from whatever its value is to 0. As I'm using that TempInt in several triggers, it makes me think that maybe the function (caster cause damage) makes the trigger lose scope, wait or otherwise make other triggers run for a short while, thereby interrupting the Omnislash trigger. And yes, that's probably waaay off...
 

BarzahdX

Active Member
Reaction score
18
OmnislashCaster[LDTempInt1]

"[LDTemptInt1]" Is that the index array for OmislashCaster? I tried using other statements for indexes in arrays before, it just didn't work properly.. IF it IS an index, change it to a number, not a name.. Worked for me, hopefully it will do the same to you.

P.S: An alternative, would be copying this trigger, converting it to JASS, and posting it in the JASS section. :p
 

Naga'sShadow

Ultra Cool Member
Reaction score
49
Your idea about the buggy unit damage target command is possible. I was using the same command in a trigger recently and after having it fail for no reason so many times I changed it to a spell that did the damage. Then the spell worked like it was supposed to. Are you using the NewGen editor, because I'm honestly thinking there is an issue with newgen and the current 1.22 patch editor.
 

Overrated

New Member
Reaction score
0
"[LDTemptInt1]" Is that the index array for OmislashCaster? I tried using other statements for indexes in arrays before, it just didn't work properly.. IF it IS an index, change it to a number, not a name.. Worked for me, hopefully it will do the same to you.

P.S: An alternative, would be copying this trigger, converting it to JASS, and posting it in the JASS section. :p

LDTempInt1 is a integer, and should work as a number. Converting it to Jass is hairy as hell....

Your idea about the buggy unit damage target command is possible. I was using the same command in a trigger recently and after having it fail for no reason so many times I changed it to a spell that did the damage. Then the spell worked like it was supposed to. Are you using the NewGen editor, because I'm honestly thinking there is an issue with newgen and the current 1.22 patch editor.

Actually I'm using vanilla mac editor. As I can find no good explanation for the trigger failing, I've changed the whole thing to dummy casters. Too bad, as I really wanted random damage (could make a lot of levels maybe, and randomize that way).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top