1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Solved] Triggering Spell problem

Discussion in 'World Editor Help Zone' started by Xzere, May 7, 2020.

  1. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    Hello, the spell itself works good, but why is it killing everything instantly, no matter the HP of the picked units?
    Note: It does work as intended if it hits only 1 or 2 units.

    • Fire Slash Work
      • Events
        • Game - GDD_Event becomes Equal to 0.00
      • Conditions
        • (Level of Fire Slash for GDD_DamageSource) Greater than 0
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Random real number between 0.00 and 1.00) Less than or equal to FireSlash_Chance[(Level of Fire Slash for GDD_DamageSource)]
          • Then - Actions
            • Animation - Play GDD_DamageSource's Spell Slam Third animation
            • Set VariableSet FireSlash_Damage = ((Base Damage of GDD_DamageSource for weapon index 0) + (Strength of GDD_DamageSource (Include bonuses)))
            • Set VariableSet FireSlash_CPoint = (Position of GDD_DamageSource)
            • Set VariableSet FireSlash_Group = (Units within 200.00 of FireSlash_CPoint.)
            • Unit Group - Pick every unit in FireSlash_Group and do (Actions)
              • Loop - Actions
                • Set VariableSet FireSlash_Target = (Picked unit)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (FireSlash_Target is A structure) Equal to False
                    • (FireSlash_Target is Mechanical) Equal to False
                    • (Owner of FireSlash_Target) Equal to Player 12 (Brown)
                    • (FireSlash_Target is alive) Equal to True
                  • Then - Actions
                    • Unit - Cause GDD_DamageSource to damage FireSlash_Target, dealing (Real(FireSlash_Damage)) damage of attack type Spells and damage type Normal
                  • Else - Actions
            • Custom script: call RemoveLocation(udg_FireSlash_CPoint)
            • Custom script: call DestroyGroup(udg_FireSlash_Group)
          • Else - Actions
     
  2. Makossj

    Makossj

    Joined:
    Sep 2, 2016
    Messages:
    39
    Resources:
    0
    Resources:
    0
    Isn't "GDD_Event becomes Equal to 0.00" all the time? SHouldn't it be "1.00" to represent the damage detection moment?
     
  3. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    I guess that's different depending on what system you use. I've used 0 for almost everything and it's been working as intended.
     
  4. Makossj

    Makossj

    Joined:
    Sep 2, 2016
    Messages:
    39
    Resources:
    0
    Resources:
    0
    Ooooh! I see it now. When you do damage with this Fire Slash this trigger fires again. It's obviously recurrent!
    Before the line:
    Unit - Cause GDD_DamageSource to damage FireSlash_Target
    Turn off <this trigger>
    and after it
    Turn on <this trigger>
     
  5. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    Yes! Now it works properly, thanks a lot! :)