• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Freeze when using if condition ?

Status
Not open for further replies.
Level 2
Joined
Oct 23, 2016
Messages
8
I'm using Bribe's Damage Engine (DE) to create On-hit Ability (Flak Cannon), i also create my own custom Auto-attack for Multishot Ability purpose, the problem is i only want Flak Cannon work it that damage is from Multishot Projectiles. So i'm using DamageEventType to archive that, but i don't know why my game freeze when using DamageEventType = DamageType...... from DE. Please help
P/S: Sorry for my bad english.... not my main langauge =~=

P/S: Passive Cooldown System is my system, it didn't deal anydamage

P/S: I know there are lot of leaks, this just temporary to know it is work or not...

P/S: The game freeze in this part
  • If - Conditions
    • DamageEventType Equal to (==) DamageTypeIsMultishots
  • Then - Actions
  • Else - Actions
    • Skip remaining actions


  • Flak Cannons
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of Flak Cannons |cffffd700[Q]|r [P-Base] for DamageEventSource) Not equal to (!=) 0
      • IsDamageSpell Equal to (==) False
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Multishot Marker for DamageEventSource) Not equal to (!=) 0
        • Then - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DamageEventType Equal to (==) DamageTypeIsMultishots
            • Then - Actions
            • Else - Actions
              • Skip remaining actions
        • Else - Actions
      • Special Effect - Create a special effect at (Position of DamageEventTarget) using Abilities\Spells\Other\Transmute\GoldBottleMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set PCS_Caster = DamageEventSource
      • Set PCS_BaseAbility = Flak Cannons |cffffd700[Q]|r [P-Base]
      • Set PCS_DummyAbility = Flak Cannons |cffffd700[Q]|r [P-Cooldown]
      • Set PCS_AbilityLevel = (Level of PCS_BaseAbility for PCS_Caster)
      • Set PCS_AbilityCooldown = (7.00 - ((Real(PCS_AbilityLevel)) x 0.25))
      • Trigger - Run Passive Cooldown System <gen> (checking conditions)

  • Trigger 1
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • DamageEventSource Equal to (==) Ranger 0011 <gen>
      • IsDamageSpell Equal to (==) False
      • DamageEventType Not equal to (!=) DamageTypeIsMultishots
      • (Level of Multishot Marker for DamageEventSource) Not equal to (!=) 0
    • Actions
      • Unit Group - Pick every unit in (Units within 250.00 of (Position of DamageEventTarget)) and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of DamageEventSource)) Equal to (==) True
            • Then - Actions
              • Unit - Create 1 MS Projectile Dummy [Ranger] for (Owner of DamageEventSource) at (Position of DamageEventSource) facing (Facing of Ranger 0011 <gen>) degrees
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Successful: Order (Last created unit) to Attack (Picked unit)) Equal to (==) True
                  • Then - Actions
                    • Set TempInt = (Custom value of (Last created unit))
                    • Set MS_DamageSource[TempInt] = DamageEventSource
                    • Set MS_DamageAmount[TempInt] = DamageEventAmount
                    • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                  • Else - Actions
                    • Unit - Remove (Last created unit) from the game
            • Else - Actions
      • Set DamageEventAmount = 0.00

  • Trigger 2
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventSource) Equal to (==) Dummy
    • Actions
      • Set TempInt = (Custom value of DamageEventSource)
      • Set NextDamageType = DamageTypeIsMultishots
      • Unit - Cause MS_DamageSource[TempInt] to damage DamageEventTarget, dealing MS_DamageAmount[TempInt] damage of attack type Hero and damage type Normal
      • Trigger - Run ClearDamageEvent (checking conditions)
      • Set DamageEventAmount = 0.00

I attached the map in this post, please help...
 

Attachments

  • Byn's CUSTOM Hero Survival.w3x
    74.1 KB · Views: 70
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
It's not strictly that If that's the problem, when I try to attack the allied wisp even with the If disabled it will freeze after a few attacks. To debug this properly you probably need to isolate the problems a little bit more, there are a lot of moving parts between your Passive Cooldown Sys, Bribe's dmg engine, and all the modifications you do to the damage. You're almost certainly creating an infinite loop somewhere. It will make it easier for people to help if your map is readily open to everyone.

Try not to use the "buggy" UMSWE GUI functions as these are not standard and will cause some people's editors to crash.
 
Level 2
Joined
Oct 23, 2016
Messages
8
Sorry for long time no reply but i had just find out one more thing. The game freeze in this block. Only "then" block freeze, "else" block is normal (only freeze when condition is TRUE). Btw, i test it with no additional actions, only testing with this if block

  • [/B]
  • [B]If - Conditions
    • DamageEventType Equal to (==) DamageTypeIsMultishots
  • Then - Actions
  • Else - Actions
    • Skip remaining actions
 
Level 13
Joined
May 10, 2009
Messages
868
All right, after spending minutes looking for something in the triggers that could possibly be causing this, I found out that it has nothing to do with them. Even though, I disabled that same if/then/else block that you've pointed out, and it worked, surprisingly! However, the real problem lies in the object editor: You based your Flak Cannons spell on Pillage, then you set its Data - Accumulation Step field to 0. For some reason, setting it to 0 freezes the game (maybe infinite loop?). Change all accumulation step fields to 1, and keep the other field Data - Salvage Cost Ratio as 0.00. Then, you're done; It won't freeze your game anymore, and your unit won't earn any income either.
 
Status
Not open for further replies.
Top