1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] MUI not working properly with this spell

Discussion in 'Triggers & Scripts' started by Krakenn99, Mar 21, 2019.

  1. Krakenn99

    Krakenn99

    Joined:
    Jun 26, 2014
    Messages:
    480
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Spell idea: Channel spell - when channeled the hero shoots out projectiles at the direction of a target enemy, each projectile deals damage to all enemies on it's path once. Bullets also poison the enemies by giving them slowing aura ability.
    Bugs so far:
    1. When one hero stops casting the ability, the other heroes continue casting it but the bullets stop going out.
    2. Sometimes the spell will work properly for one player, but for another player the bullets will not deal any damage at all.
    Triggers:
    • Ratatatataaaa
      • Events
        • Unit - A unit Begins casting an ability
      • Conditions
        • (Ability being cast) Equal to Ratatatataaaa!
      • Actions
        • Set tempPoint[0] = (Position of (Casting unit))
        • Set spRataIndex = (spRataIndex + 1)
        • Set spRataMui = (spRataMui + 1)
        • Set spRataCaster[spRataMui] = (Casting unit)
        • Set spRataTarget[spRataMui] = (Target unit of ability being cast)
        • Set spRataDummy[spRataMui] = (Last created unit)
        • Sound - Play Ratatataaa <gen> at 100.00% volume, located at tempPoint[0] with Z offset 0.00
        • Trigger - Turn on Ratatatataaaa Cast Loop <gen>
        • Custom script: call RemoveLocation(udg_tempPoint[0])

    • Ratatatataaaa Cast Loop
      • Events
        • Time - Every 0.20 seconds of game time
      • Conditions
      • Actions
        • For each (Integer A) from 1 to spRataMui, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((spRataCaster[(Integer A)] is alive) Equal to True) and ((spRataTarget[(Integer A)] is alive) Equal to True)
              • Then - Actions
                • Set tempPoint[0] = (Position of spRataCaster[(Integer A)])
                • Set tempPoint[1] = (Position of spRataTarget[(Integer A)])
                • Unit - Make spRataCaster[(Integer A)] face (Angle from tempPoint[0] to tempPoint[1]) over 0.10 seconds
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Distance between tempPoint[0] and tempPoint[1]) Greater than or equal to 700.00
                  • Then - Actions
                    • Unit - Order spRataCaster[(Integer A)] to Stop
                  • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Mana of spRataCaster[(Integer A)]) Less than (3.00 x (Real((Level of Ratatatataaaa! for spRataCaster[(Integer A)]))))
                      • Then - Actions
                        • Unit - Order spRataCaster[(Integer A)] to Stop
                      • Else - Actions
                        • Set spRataBulletIndex = (spRataBulletIndex + 1)
                        • Set spRataBulletMui = (spRataBulletMui + 1)
                        • Unit - Create 1 Stinky Bullet for (Owner of spRataCaster[(Integer A)]) at tempPoint[0] facing tempPoint[1]
                        • Unit - Add a 0.60 second Generic expiration timer to (Last created unit)
                        • Set spRataDummy[spRataBulletMui] = (Last created unit)
                        • Set spRataBulletCaster[spRataBulletMui] = spRataCaster[(Integer A)]
                        • Set spRataDamage[spRataBulletMui] = ((1.00 x (Real((Agility of spRataBulletCaster[spRataBulletMui] (Include bonuses))))) + (5.00 + (10.00 x (Real((Level of Ratatatataaaa! for spRataBulletCaster[spRataBulletMui]))))))
                        • Set spRataGroup[spRataBulletMui] = (Units owned by Player 1 (Red))
                        • Unit Group - Remove all units from spRataGroup[(Integer A)]
                        • Unit - Set mana of spRataCaster[(Integer A)] to ((Mana of spRataCaster[(Integer A)]) - (3.00 x (Real((Level of Ratatatataaaa! for spRataCaster[(Integer A)])))))
                        • Trigger - Turn on Ratatatataaaa Bullet Loop <gen>
                • Custom script: call RemoveLocation(udg_tempPoint[1])
                • Custom script: call RemoveLocation(udg_tempPoint[0])
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • spRataCaster[(Integer A)] Not equal to No unit
                  • Then - Actions
                    • Unit - Order spRataCaster[(Integer A)] to Stop
                    • Set spRataCaster[(Integer A)] = No unit
                    • Set spRataIndex = (spRataIndex - 1)
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • spRataIndex Less than or equal to 0
                      • Then - Actions
                        • Set spRataIndex = 0
                        • Set spRataMui = 0
                        • Trigger - Turn off (This trigger)
                      • Else - Actions
                  • Else - Actions

    • Ratatatataaaa Bullet Loop
      • Events
        • Time - Every 0.03 seconds of game time
      • Conditions
      • Actions
        • For each (Integer A) from 1 to spRataBulletMui, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (spRataDummy[(Integer A)] is alive) Equal to True
              • Then - Actions
                • Set tempPoint[0] = (Position of spRataDummy[(Integer A)])
                • Set tempPoint[1] = (tempPoint[0] offset by 40.00 towards (Facing of spRataDummy[(Integer A)]) degrees)
                • Unit - Move spRataDummy[(Integer A)] instantly to tempPoint[1]
                • Set tempGroup[0] = (Units within 60.00 of tempPoint[1] matching ((((Matching unit) belongs to an enemy of (Owner of spRataDummy[(Integer A)])) Equal to True) and (((Matching unit) is alive) Equal to True)))
                • Unit Group - Pick every unit in tempGroup[0] and do (Actions)
                  • Loop - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • ((Picked unit) is in spRataGroup[(Integer A)]) Equal to True
                      • Then - Actions
                      • Else - Actions
                        • Unit - Cause spRataBulletCaster[(Integer A)] to damage (Picked unit), dealing (0.20 x spRataDamage[(Integer A)]) damage of attack type Hero and damage type Normal
                        • Unit Group - Add (Picked unit) to spRataGroup[(Integer A)]
                        • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\Rifle\RifleImpact.mdl
                        • Special Effect - Destroy (Last created special effect)
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (((Picked unit) is alive) Equal to True) and (((Picked unit) is in spSSgroup) Equal to False)
                      • Then - Actions
                        • Unit - Add Stinky's Secret Decoction (Slow) to (Picked unit)
                        • Unit Group - Add (Picked unit) to spSSgroup
                        • Trigger - Turn on Stinkys Special Buff Loop <gen>
                      • Else - Actions
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • ((Picked unit) is alive) Equal to True
                          • Then - Actions
                            • Unit - Set level of Stinky's Secret Decoction (Slow) for (Picked unit) to 1
                          • Else - Actions
                            • Unit - Remove Stinky's Secret Decoction (Slow) from (Picked unit)
                            • Unit - Remove Stinky's Secret Decoction buff from (Picked unit)
                            • Unit Group - Remove (Picked unit) from spSSgroup
                • Custom script: call DestroyGroup(udg_tempGroup[0])
                • Custom script: call RemoveLocation(udg_tempPoint[1])
                • Custom script: call RemoveLocation(udg_tempPoint[0])
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • spRataDummy[(Integer A)] Not equal to No unit
                  • Then - Actions
                    • Set spRataDummy[(Integer A)] = No unit
                    • Set spRataBulletIndex = (spRataBulletIndex - 1)
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • spRataBulletIndex Less than or equal to 0
                      • Then - Actions
                        • Set spRataBulletIndex = 0
                        • Set spRataBulletMui = 0
                        • Trigger - Turn off (This trigger)
                      • Else - Actions
                  • Else - Actions

    • Ratatatataaaa Stop
      • Events
        • Unit - A unit Stops casting an ability
        • Unit - A unit Finishes casting an ability
      • Conditions
        • (Ability being cast) Equal to Ratatatataaaa!
      • Actions
        • For each (Integer A) from 1 to spRataMui, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Triggering unit) Equal to spRataCaster[(Integer A)]) and (spRataCaster[(Integer A)] Not equal to No unit)
              • Then - Actions
                • Set spRataCaster[(Integer A)] = No unit
                • Set spRataIndex = (spRataIndex - 1)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • spRataIndex Less than or equal to 0
                  • Then - Actions
                    • Set spRataIndex = 0
                    • Set spRataMui = 0
                    • Trigger - Turn off Ratatatataaaa Cast Loop <gen>
                  • Else - Actions
              • Else - Actions
     
  2. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,043
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Did you check to see if this one is also affected by Integer A looping being weird?
     
  3. Krakenn99

    Krakenn99

    Joined:
    Jun 26, 2014
    Messages:
    480
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Most probably, I just fixed all my triggers into having different Integer A's, lots' of potential bugs should be fixed I hope. I also improved the spell's stop/finish trigger and should work better. Thank you for your time.