• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Trigger] Game Crashes with Custom Spell

Status
Not open for further replies.
Level 2
Joined
Jun 19, 2017
Messages
8
Hi everyone, I've been learning years with this forum and I'm so thankfull for this community, I also have learned most of things by myself. Never posted here before, but this time I'm facing something that are getting up on my nerves. I can't simply figure out what's happening. I created a Naruto character and made his spells similar to his technique he had in his fight against pain. Problem is, after some time game crashed. I skinned this guy off to see if I could find any leak, I fixed them all, and I made all programming the simplest I could. But fatal error still happened. Then I tried to test only 1 skill at time in different matches to see which one was causing the crash. I found out it happened only with "Sennin Mode" which you can see below. What I can't understand is that this spell doesn't have any points on map, any unit groups, anything that leaks. It only works with boolean and integers. That's all. The crash happens when at some time in the game I use the spell. I click on it, and it crashes. I couldn't understand why so I'm asking you beloved community to help me out in this.

PS 1: Don't tell me about not using "waits" if you're not willing to teach in a easy way, I tried to learn that hashtable thing and I couldn't understand how to use that and the logic behind it. No one made a nice-easy topic to learn or any good explanation, just some random tips that I could find here. I've been using waits since 5 years to now and never had any problem with it.
PS 2: I tried to disable all the triggers to see if the problem was in the use of the base spell (Starfall), and it's not. No crash at all.
PS 3: Pls don't tell me to do something in JASS or to learn it. I almost don't have time even to make some custom heroes to have some fun imagine learning a completly new language. I'm good, I pass it on!

So let me explain how Sennin Mode works:
It's a Starfall based spell with a lazy .tga icon. Naruto must be out of combat in order to cast this spell, when he's attacked or he attacks the ability is removed, and comes back after the combat mode is off (it's that countdown timer expiring stuff). He keeps chanelling the spell until he reaches 100 Senjutsu points, then he is ordered to stop and is added the ability of Sennin Mode (Endurance Aura based ability). Also he earns 20 points in dodge rating and 10 in critical (it's a different mechanic I use in my custom heroes to ressemble like world of warcraft). When he's not chanelling the Sennin Mode (which is determined by a boolean) he looses 1 Senjutsu point every 1 second. When he reaches 0 the Sennin Mode (Endurance Aura) is removed and he looses the benefit of critical and doge rating. The "NarutoSenninModeBooleanChargin" is about channeling the ability or not, and the "NarutoSenninModeOnOffBoolean" means if he is in Sennin Mode or not. That's all this spell does. Would you guys please help me find why the hell this is crashing? These are the two triggers involved in this system, and an in-game print.

PS: I had before another completly different triggers, I was using like 6 triggers with "triggers on and off" functions and "periodic time" events. Also I wasn't using boolean I was using buffs and passive abilities to use as a "check (if)" system. I thought that was too jerry-rigged, then I erase all that and I made this one (below). But in these two ways, the crash was exactly the same. So I wonder that it must be something with the "NarutoSenjutsu" integer, it's the only thing I can think of. But anyway, I don't know why and how.

  • Sennin Mode
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sennin Mode
    • Actions
      • Set NarutoSenninModeBooleanChargin = True
      • For each (Integer NarutoSenninModeLoopCharging) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (NarutoSenjutsu Greater than or equal to 100) then do (Unit - Order Naruto to Stop) else do (Do nothing)
          • If ((NarutoSenjutsu Greater than or equal to 100) or (NarutoSenninModeBooleanChargin Equal to False)) then do (Skip remaining actions) else do (Do nothing)
          • Set NarutoSenjutsu = (NarutoSenjutsu + 10)
          • Wait 1.00 seconds
This is about loosing Senjutsu Points

  • Sennin Mode
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Sennin Mode
    • Actions
      • Set NarutoSenninModeBooleanChargin = False
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • NarutoSenjutsu Greater than 0
        • Then - Actions
          • Unit - Add Sennin Mode to Naruto
          • If (NarutoSenninModeOnOffBoolean Equal to False) then do (Set NarutoStatCriticalStrike = (NarutoStatCriticalStrike + 10)) else do (Do nothing)
          • If (NarutoSenninModeOnOffBoolean Equal to False) then do (Set NarutoStatDodge = (NarutoStatDodge + 20)) else do (Do nothing)
          • Set NarutoSenninModeOnOffBoolean = True
          • For each (Integer NarutoSenninModeLoopLoosing) from 1 to 120, do (Actions)
            • Loop - Actions
              • If (NarutoSenninModeBooleanChargin Equal to True) then do (Skip remaining actions) else do (Do nothing)
              • Set NarutoSenjutsu = (NarutoSenjutsu - 1)
              • Wait 1.00 seconds
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • NarutoSenjutsu Equal to 0
                • Then - Actions
                  • Unit - Remove Sennin Mode from Naruto
                  • Set NarutoSenninModeOnOffBoolean = False
                  • Set NarutoStatCriticalStrike = (NarutoStatCriticalStrike - 10)
                  • Set NarutoStatDodge = (NarutoStatDodge - 20)
                  • Skip remaining actions
                • Else - Actions
        • Else - Actions
naruto.png
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,024
@Thualluandra Next time you should create a new post in the Triggers & Scripts or World Editor Help Zone forums instead of replying to this tutorial. If you are having a problem with a specific tutorial, then it is reasonable to reply to that thread, but most standalone problems should create a new topic so that people are more likely to see it and respond. I reported your post to a moderator so that they can perhaps move it into a new thread (not because I think you broke any rules). That being said I really appreciate all of the information you supplied and the explanations you provided-- a model first post, welcome to HiveWorkshop! You should know that you can right click triggers/parts of triggers in the trigger editor, select "Copy as text", and paste them here between [trigger][/trigger] tags so you don't have to upload screenshots.

I looked over the code and read what you wrote. The game immediately exits to desktop with no error message and doesn't bring up a crash report/log? Nothing sticks out to me as an action that would cause a fatal game crash; as you said it's most just integer, real, and boolean variable assignment. This leads me to to believe it has something to do with your dodge or critical strike systems. Perhaps you've created an infinite loop by damaging a unit in a trigger that runs when a unit takes damage or you end up with a divide . It would help if you could post those triggers too or just upload a copy of your map.

It would also be helpful if you could describe the specific steps required to cause the crash and when exactly it happens. It sounds like you aren't sure of these things yet, just that it has to do with this ability. Does it occur when you start channeling the charge? Mid-channel? When the charge finishes? While the buffs are active but counting down to 0? When it reaches 0 and removes the buff? Does the crash only happen if you channel part of the way, stop, then start again? Does it only crash on the subsequent cast after the unit has died with the buff active, while channeling, or after the spell has been successfully cast N times? This sort of info would really help narrow it down to being a problem with this actual code vs. a problem with how other code/systems in your map interact with the unit as it's casting this spell.

Suggestion: don't use the single-line ifs because it forces you to do things like Else do (Do Nothing) which is totally unnecessary and just adds function calls to your code. The "If/then/else - multiple functions" is always preferable due to readability, ease of editing, flexibility, and reducing the operation count.
 
Level 2
Joined
Jun 19, 2017
Messages
8
@Thualluandra Next time you should create a new post in the Triggers & Scripts or World Editor Help Zone forums instead of replying to this tutorial. If you are having a problem with a specific tutorial, then it is reasonable to reply to that thread, but most standalone problems should create a new topic so that people are more likely to see it and respond. I reported your post to a moderator so that they can perhaps move it into a new thread (not because I think you broke any rules). That being said I really appreciate all of the information you supplied and the explanations you provided-- a model first post, welcome to HiveWorkshop! You should know that you can right click triggers/parts of triggers in the trigger editor, select "Copy as text", and paste them here between [trigger][/trigger] tags so you don't have to upload screenshots.

I looked over the code and read what you wrote. The game immediately exits to desktop with no error message and doesn't bring up a crash report/log? Nothing sticks out to me as an action that would cause a fatal game crash; as you said it's most just integer, real, and boolean variable assignment. This leads me to to believe it has something to do with your dodge or critical strike systems. Perhaps you've created an infinite loop by damaging a unit in a trigger that runs when a unit takes damage or you end up with a divide . It would help if you could post those triggers too or just upload a copy of your map.

It would also be helpful if you could describe the specific steps required to cause the crash and when exactly it happens. It sounds like you aren't sure of these things yet, just that it has to do with this ability. Does it occur when you start channeling the charge? Mid-channel? When the charge finishes? While the buffs are active but counting down to 0? When it reaches 0 and removes the buff? Does the crash only happen if you channel part of the way, stop, then start again? Does it only crash on the subsequent cast after the unit has died with the buff active, while channeling, or after the spell has been successfully cast N times? This sort of info would really help narrow it down to being a problem with this actual code vs. a problem with how other code/systems in your map interact with the unit as it's casting this spell.

Suggestion: don't use the single-line ifs because it forces you to do things like Else do (Do Nothing) which is totally unnecessary and just adds function calls to your code. The "If/then/else - multiple functions" is always preferable due to readability, ease of editing, flexibility, and reducing the operation count.

Thx bro for your answer, I didn't know I could create a topic. As you saw I'm new here. hehe.

1) The crash leaves a fatal error message of memory could not be learn. The famous memory leak.
I'll show you the triggers for critical and dodge system, but I dont believe it has something to do with those, because this is spell can only be used out of combat. So the "Real" functions would not be working at the same time, and if Naruto is channeling the Sennin Mode and gets attacked he's issued order to stop. Also I've been using this system with every custom hero I had since the beginning of this year. Never had any problem.

So Here's Naruto stats and how it works, critical is 50% of agility and dodge 40% of it.

  • Naruto Stats
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Leveling Hero) Equal to Naruto
    • Actions
      • Set NarutoStatCriticalStrike = (NarutoStatCriticalStrike + 0.50)
      • Set NarutoStatDodge = (NarutoStatDodge + 0.40)
      • Set NarutoStatStrength = (NarutoStatStrength + 2.50)
Here's Critical System

  • Naruto Critical Strike
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) Equal to Naruto) and ((Random integer number between 1 and 100) Less than or equal to (Integer(NarutoStatCriticalStrike)))
    • Actions
      • Wait 0.08 seconds
      • Unit - Cause Naruto to damage (Attacked unit), dealing ((5.00 + NarutoStatStrength) + ((NarutoStatStrength + 5.00) x ((Real(NarutoRageValue)) / 100.00))) damage of attack type Hero and damage type Normal
      • Floating Text - Destroy CriticalFloatingText
      • Floating Text - Create floating text that reads Critical! above (Attacked unit) with Z offset 0.00, using font size 7.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Set CriticalFloatingText = (Last created floating text)
      • Floating Text - Set the velocity of CriticalFloatingText to 150.00 towards 90.00 degrees
      • Floating Text - Change CriticalFloatingText: Disable permanence
      • Floating Text - Change the lifespan of CriticalFloatingText to 1.00 seconds
      • Special Effect - Create a special effect attached to the chest of (Attacked unit) using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
      • Set CriticalStrikeSE = (Last created special effect)
      • Special Effect - Destroy CriticalStrikeSE
And the dodge system (This evasion is 100%)

  • Naruto Dodge
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) Equal to Naruto) and ((Random integer number between 1 and 100) Less than or equal to (Integer(NarutoStatDodge)))
    • Actions
      • Unit - Add Evasion to Naruto
      • Wait 0.60 seconds
      • Unit - Remove Evasion from Naruto
Now let me explain how exactly this fatal error happens.
I tested a single match which I only used Sennin Mode, nothing more. I didn't even learn other abilities. The fatal error happened, like 0.5 seconds after casting, which I believe it's upon casting the spell, not in middle, not in the ending. It happened when I didn't have any senjutsu point, it happened when I had some points. it happened when I wasn't casting this spell and it also happened when I casted it while casting it. You got it right? Like i'm channeling the spell and I ask it to channel again. btw, the spell is 1.5 sec cooldown. So it crashes in whatever different scenarios, but they all crash at about 20, 30 uses of it and it happens always upon casting. That's the pattern, I wouldn't say it was crossing with other triggers, because I can't cast it while in combat, I only cast it alone. Thank you for your help.

PS: I will text 2 things to see if the faltal error changes,
First, I'll disable the dodge and critical system and play a little to see if it crashes,
Second, I'll avoid any combat and I'll be casting over and over at base to see if it crashes,
Third, I'll change the wait time to some seconds that aren't the same, to make it cross the least.
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,024
1) The crash leaves a fatal error message of memory could not be learn. The famous memory leak.
You mean access violation like in this thread (of course different memory addresses for your crash): Fatal Error
Now let me explain how exactly this fatal error happens.
I tested a single match which I only used Sennin Mode, nothing more. I didn't even learn other abilities. The fatal error happened, like 0.5 seconds after casting, which I believe it's upon casting the spell, not in middle, not in the ending. It happened when I didn't have any senjutsu point, it happened when I had some points. it happened when I wasn't casting this spell and it also happened when I casted it while casting it. You got it right? Like i'm channeling the spell and I ask it to channel again. btw, the spell is 1.5 sec cooldown. So it crashes in whatever different scenarios, but they all crash at about 20, 30 uses of it and it happens always upon casting. That's the pattern, I wouldn't say it was crossing with other triggers, because I can't cast it while in combat, I only cast it alone. Thank you for your help.
This is good information, thanks! If it doesn't happen immediately on casting it is definitely something that is occuring periodically (in another trigger) or is in some way due to the method of looped waiting you're using. From what I see in the triggers you posted it is indeed not the critical or dodge system causing this. Would you be willing to upload your map as an attachment here so I can mess with it myself and see the error in action?
PS: I will text 2 things to see if the faltal error changes,
First, I'll disable the dodge and critical system and play a little to see if it crashes,
Second, I'll avoid any combat and I'll be casting over and over at base to see if it crashes,
Third, I'll change the wait time to some seconds that aren't the same, to make it cross the least.
Please update with the results of these tests when you have done them. A fourth test I would suggest is disabling or deleting every trigger in your entire map except the ones explicitly required for this spell to work. If it still occurs that would completely rule out all of the triggers you disabled/deleted.
 
Level 2
Joined
Jun 19, 2017
Messages
8
You mean access violation like in this thread (of course different memory addresses for your crash): Fatal Error

This is good information, thanks! If it doesn't happen immediately on casting it is definitely something that is occuring periodically (in another trigger) or is in some way due to the method of looped waiting you're using. From what I see in the triggers you posted it is indeed not the critical or dodge system causing this. Would you be willing to upload your map as an attachment here so I can mess with it myself and see the error in action?

Please update with the results of these tests when you have done them. A fourth test I would suggest is disabling or deleting every trigger in your entire map except the ones explicitly required for this spell to work. If it still occurs that would completely rule out all of the triggers you disabled/deleted.

Hi, how you doing, I did all the tests and I'm really upset because it didn't become clear.

1) Disabling Dodge and Critical System to see if it crashes.
Result: It Crashed!
2) Avoiding any combat while spamming the skill at base.
Result: It didn't crash!
3) Deleting the triggers of one spell at time then another and kept narrowing it.
Result: It Crashed! (no matter which thing I'd turn off or on)
4) Changing the wait times in drops and gathering to prevent overlap.
Result: It Crashed!
5) Deleting all triggers and letting only the Sennin Mode`s triggers on.
Result: It didn't crash!

With these results I still can't guess which triggers are crossing against Sennin Mode.
I'm a little shy to share my map with you because I'm a little newbie, I will feel ashamed after someone sees my jerry-rigs haha. But I'm sharing anyway. I must confess I'm a little bit tired of this spell and I'm thinking about changing the mechs. It will even look more accurated to Naruto's mechs. I'll make a passive skill with no icon (like Sphere) that when Naruto is standing still will generate 1 Senjutsu Point every second. It will also have a new button that will summon 2 unusable bunshins (Feral Spirit based spell) close to the start location. If Naruto is issued any order it won't generate any Senjutsu Point and if he gets into combat he will lose like 3 or 5 points per second, which he can replenish by killing 1 bunshin he had at his base and let's pray to God that won't crash, what do you think? I don't want to waste your time, so don't feel pushed to help me out so deeply =)
Thx for your help.
 

Attachments

  • (8)MarketSquare.w3x
    1 MB · Views: 47
Level 2
Joined
Jun 19, 2017
Messages
8
@Pyrogasm Hi man, I have some news. I changed the mechs of the spell like I told you and now it's free of crash. I tested and It's working very fine. I'm really happy because now it looks like even better to Naruto's real mechs. I'll show you the triggers how I made it.
I used a Serpent Ward based spell. That's all.

  • Sennin Mode Stacking
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • ((Naruto is alive) Equal to True) and ((Level of Sennin Mode for Naruto) Greater than 0)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of Naruto) Equal to (Order(<Empty String>))
          • NarutoCombatMode Equal to False
        • Then - Actions
          • Set NarutoSenjutsu = (NarutoSenjutsu + 5)
          • Special Effect - Create a special effect attached to the origin of Naruto using Abilities\Spells\NightElf\MoonWell\MoonWellCasterArt.mdl
          • Set NarutoSenninModeSenjutsuSE = (Last created special effect)
          • Special Effect - Destroy NarutoSenninModeSenjutsuSE
          • Animation - Play Naruto's spell animation
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • NarutoSenjutsu Greater than or equal to 100
            • Then - Actions
              • Set NarutoSenjutsu = 100
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • NarutoSenninModeOnOffBoolean Equal to False
                • Then - Actions
                  • Unit - Add Sennin Mode (Passive) to Naruto
                  • Set NarutoSenninModeOnOffBoolean = True
                  • Set NarutoStatCriticalStrike = (NarutoStatCriticalStrike + 10.00)
                  • Set NarutoStatDodge = (NarutoStatDodge + 20.00)
                • Else - Actions
            • Else - Actions
        • Else - Actions
          • Set NarutoSenjutsu = (NarutoSenjutsu - 2)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • NarutoSenjutsu Less than or equal to 0
            • Then - Actions
              • Set NarutoSenjutsu = 0
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • NarutoSenninModeOnOffBoolean Equal to True
                • Then - Actions
                  • Unit - Remove Sennin Mode (Passive) from Naruto
                  • Unit - Remove Sennin Mode buff from Naruto
                  • Set NarutoSenninModeOnOffBoolean = False
                  • Set NarutoStatCriticalStrike = (NarutoStatCriticalStrike - 10.00)
                  • Set NarutoStatDodge = (NarutoStatDodge - 20.00)
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • NarutoCombatMode Equal to True
              • NarutoSenjutsu Less than or equal to 3
              • ((NarutoSenninModeBunshins[1] is alive) Equal to True) and ((NarutoSenninModeBunshins[2] is alive) Equal to True)
            • Then - Actions
              • Unit - Order Naruto to Stop
              • Animation - Play Naruto's spell animation
              • Special Effect - Create a special effect attached to the origin of NarutoSenninModeBunshins[1] using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
              • Set NarutoSenninModeBunshinDeathSE = (Last created special effect)
              • Special Effect - Destroy NarutoSenninModeBunshinDeathSE
              • Special Effect - Create a special effect attached to the origin of Naruto using Abilities\Spells\NightElf\MoonWell\MoonWellCasterArt.mdl
              • Set NarutoSenninModeSenjutsuSE = (Last created special effect)
              • Special Effect - Destroy NarutoSenninModeSenjutsuSE
              • Set NarutoSenjutsu = 100
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • NarutoSenninModeOnOffBoolean Equal to False
                • Then - Actions
                  • Unit - Add Sennin Mode (Passive) to Naruto
                  • Set NarutoSenninModeOnOffBoolean = True
                  • Set NarutoStatCriticalStrike = (NarutoStatCriticalStrike + 10.00)
                  • Set NarutoStatDodge = (NarutoStatDodge + 20.00)
                • Else - Actions
              • Wait 0.10 seconds
              • Unit - Kill NarutoSenninModeBunshins[1]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • NarutoCombatMode Equal to True
              • NarutoSenjutsu Less than or equal to 3
              • ((NarutoSenninModeBunshins[1] is dead) Equal to True) and ((NarutoSenninModeBunshins[2] is alive) Equal to True)
            • Then - Actions
              • Unit - Order Naruto to Stop
              • Animation - Play Naruto's spell animation
              • Special Effect - Create a special effect attached to the origin of NarutoSenninModeBunshins[2] using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
              • Set NarutoSenninModeBunshinDeathSE = (Last created special effect)
              • Special Effect - Destroy NarutoSenninModeBunshinDeathSE
              • Special Effect - Create a special effect attached to the origin of Naruto using Abilities\Spells\NightElf\MoonWell\MoonWellCasterArt.mdl
              • Set NarutoSenninModeSenjutsuSE = (Last created special effect)
              • Special Effect - Destroy NarutoSenninModeSenjutsuSE
              • Set NarutoSenjutsu = 100
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • NarutoSenninModeOnOffBoolean Equal to False
                • Then - Actions
                  • Unit - Add Sennin Mode (Passive) to Naruto
                  • Set NarutoSenninModeOnOffBoolean = True
                  • Set NarutoStatCriticalStrike = (NarutoStatCriticalStrike + 10.00)
                  • Set NarutoStatDodge = (NarutoStatDodge + 20.00)
                • Else - Actions
              • Wait 0.10 seconds
              • Unit - Kill NarutoSenninModeBunshins[2]
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • NarutoCombatMode Equal to True
              • NarutoSenjutsu Less than or equal to 3
              • ((NarutoSenninModeBunshins[1] is alive) Equal to True) and ((NarutoSenninModeBunshins[2] is dead) Equal to True)
            • Then - Actions
              • Unit - Order Naruto to Stop
              • Animation - Play Naruto's spell animation
              • Special Effect - Create a special effect attached to the origin of NarutoSenninModeBunshins[1] using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
              • Set NarutoSenninModeBunshinDeathSE = (Last created special effect)
              • Special Effect - Destroy NarutoSenninModeBunshinDeathSE
              • Special Effect - Create a special effect attached to the origin of Naruto using Abilities\Spells\NightElf\MoonWell\MoonWellCasterArt.mdl
              • Set NarutoSenninModeSenjutsuSE = (Last created special effect)
              • Special Effect - Destroy NarutoSenninModeSenjutsuSE
              • Set NarutoSenjutsu = 100
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • NarutoSenninModeOnOffBoolean Equal to False
                • Then - Actions
                  • Unit - Add Sennin Mode (Passive) to Naruto
                  • Set NarutoSenninModeOnOffBoolean = True
                  • Set NarutoStatCriticalStrike = (NarutoStatCriticalStrike + 10.00)
                  • Set NarutoStatDodge = (NarutoStatDodge + 20.00)
                • Else - Actions
              • Wait 0.10 seconds
              • Unit - Kill NarutoSenninModeBunshins[1]
            • Else - Actions
  • Sennin Mode Bunshin Point
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sennin Mode
    • Actions
      • Set NarutoSenninModeBunshinPoint[1] = ((Target point of ability being cast) offset by 50.00 towards 90.00 degrees)
      • Set NarutoSenninModeBunshinPoint[2] = ((Target point of ability being cast) offset by 50.00 towards 180.00 degrees)
      • Unit - Create 1 Uzumaki Naruto (1) for (Owner of Naruto) at NarutoSenninModeBunshinPoint[1] facing NarutoSenninModeBunshinPoint[2]
      • Set NarutoSenninModeBunshins[1] = (Last created unit)
      • Set NarutoBunshinsInteger = (NarutoBunshinsInteger + 1)
      • Special Effect - Create a special effect attached to the origin of NarutoSenninModeBunshins[1] using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
      • Set NarutoSenninModeBunshinDeathSE = (Last created special effect)
      • Special Effect - Destroy NarutoSenninModeBunshinDeathSE
      • Unit - Create 1 Uzumaki Naruto (2) for (Owner of Naruto) at NarutoSenninModeBunshinPoint[2] facing NarutoSenninModeBunshinPoint[1]
      • Set NarutoSenninModeBunshins[2] = (Last created unit)
      • Set NarutoBunshinsInteger = (NarutoBunshinsInteger + 1)
      • Special Effect - Create a special effect attached to the origin of NarutoSenninModeBunshins[2] using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
      • Set NarutoSenninModeBunshinDeathSE = (Last created special effect)
      • Special Effect - Destroy NarutoSenninModeBunshinDeathSE
      • Animation - Play NarutoSenninModeBunshins[1]'s spell channel animation
      • Animation - Play NarutoSenninModeBunshins[2]'s spell channel animation
      • Unit - Add a 120.00 second Generic expiration timer to NarutoSenninModeBunshins[1]
      • Unit - Add a 120.00 second Generic expiration timer to NarutoSenninModeBunshins[2]
      • Custom script: call RemoveLocation(udg_NarutoSenninModeBunshinPoint[1])
      • Custom script: call RemoveLocation(udg_NarutoSenninModeBunshinPoint[2])
  • Sennin Mode Bunshin Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) Equal to NarutoSenninModeBunshins[1]) or ((Dying unit) Equal to NarutoSenninModeBunshins[2])
    • Actions
      • Set NarutoBunshinsInteger = (NarutoBunshinsInteger - 1)
Thanks for you help man, unfortunatelly we couldn't find out what was happening to the older spell, but it's fine. I'm more satisfied with this. Actually I didn't think about it because I just found out that the command for "not doing anything" is the "Order(<Empty String)>". haha amazing.
 
Level 2
Joined
Jun 19, 2017
Messages
8
Glad you resolved the problem, even if you couldn't figure out what was happening! Sometimes the only solution is to remake or change it because wc3 does not have a code debugger.
@Pyrogasm hey whats up? I just found out an information you may want to know. I found out what was the problem of the crashes. I created another caracter which was Itachi, and I had to put a trigger that I would change his three spells into others, so the line would be like this
  • Unit - Remove [ability] from [Itachi]
  • Unit - Add [ability] to [Itachi]
I found out that after some "instachanges" it crashes, these kinds of triggers needs an "Wait 0.01" to prevent crashes.
 
Level 39
Joined
Feb 27, 2007
Messages
5,024
That's... not right. No way that causes a crash unless it's something specifically to do with the abilities you were trying to add/remove. What default wc3 abilities were those spells based on? Was the unit being ordered to use them as they were replaced?

The reason I'm so quick to say that can't have been the problem is that I have never encountered a crasg and needed to do that. Also people have been using the following trick for over a decade to get units to fly without being flying:

  • Unit - Add Crow Form to UNIT
  • Unit - Remove Crow Form from UNIT
  • Unit - Set UNIT's fly height to X over Y seconds //works instantly
 
Level 2
Joined
Jun 19, 2017
Messages
8
That's... not right. No way that causes a crash unless it's something specifically to do with the abilities you were trying to add/remove. What default wc3 abilities were those spells based on? Was the unit being ordered to use them as they were replaced?

The reason I'm so quick to say that can't have been the problem is that I have never encountered a crasg and needed to do that. Also people have been using the following trick for over a decade to get units to fly without being flying:

  • Unit - Add Crow Form to UNIT
  • Unit - Remove Crow Form from UNIT
  • Unit - Set UNIT's fly height to X over Y seconds //works instantly

Maybe it's not all the spells. I remember when I created a spell for Charm to be AOE. The spell converted random units in an area and after it added expiration time to the units, because I didn't want the units to be converted permanently. It was crashing, Then I added a Wait 0.01 between the order of converting units and adding expiration time, and it didn't crash anymore. Srsly. I think this world editor is a little buggy. I face a lot of bugged orders for AI's for example which was fixed by deleting the order and remaking it. That's not weird for me.
 
Status
Not open for further replies.
Top