• 🏆 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!

Movement speed glitch ?

Status
Not open for further replies.
Level 10
Joined
Feb 20, 2008
Messages
448
Hi poeple i am building a kind of Burning and cold spell!!

the spell work on spell duration : if a certain boolean is true the unit will get movement speed slowed!!

but what if happen if this targeted unit had a buff speed with Experation timed example 500. if this buff end up while the cold is not end he will gets his 500 buff speed without getting the real buff itself. how can i fix that ?

here is my code im not sure if i did right some1 can help me

  • Burn Call
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • -------- CALL BEGIN --------
      • -------- the groupvariable u have to set --------
      • Set BurnCall_Group = (Units within 512.00 of (Center of (Playable map area)) matching (((Triggering unit) is A structure) Equal to True))
      • -------- -------------------------------------------------- --------
      • -------- owner of burned unit :) --------
      • Set BurnCall_OwnerSource = (Triggering unit)
      • -------- -------------------------------------------------- --------
      • -------- sfx for unit getting burned --------
      • Set BurnCall_SpecialEffectString = !Amaterasu.mdx
      • -------- -------------------------------------------------- --------
      • -------- Damage --------
      • Set BurnCall_Damage = 40.00
      • -------- -------------------------------------------------- --------
      • -------- do not change unless your change the event of the loop if you did please be sure they are same --------
      • Set BurnCall_SpeedCounter = 0.05
      • -------- -------------------------------------------------- --------
      • -------- in second --------
      • Set BurnCall_MaxDuration = 1.00
      • -------- -------------------------------------------------- --------
      • -------- Damage type fire :) since it burn --------
      • Set BurnCall_DamageType = Fire
      • -------- -------------------------------------------------- --------
      • -------- CHAOS FOR THE WIN FUCK THEM MAGIC ARMOR :D --------
      • Set BurnCall_AttackType = Chaos
      • -------- -------------------------------------------------- --------
      • -------- This is the interval for Damage & Special effect : if it 4 mean 0.20 secon interval between each action(dmg+sfx) --------
      • -------- Formula= X* 0,05 // X is your number interval --------
      • Set BurnCall_RealTimeInterval = 2.00
      • -------- -------------------------------------------------- --------
      • -------- COLD CONFIGURATION --------
      • -------- -------------------------------------------------- --------
      • -------- True = Cold & Burn/// False = Only Burn --------
      • Set BurnCold_Boolean = False
      • -------- -------------------------------------------------- --------
      • -------- this variable will be use as reference for the cold effect end --------
      • Set Cold_OriginMovementSpeed = (Current movement speed of BurnCall_OwnerSource)
      • -------- -------------------------------------------------- --------
      • -------- this variable will be use for movement speed reduction --------
      • Set Cold_OriginMS_FormulaCounter = Cold_OriginMovementSpeed
      • -------- -------------------------------------------------- --------
      • -------- Movement speed Reduction --------
      • Set Cold_MS_Reduction = 50.00
      • -------- -------------------------------------------------- --------
      • Trigger - Run Burn Engine <gen> (checking conditions)
      • -------- -------------------------------------------------- --------
      • -------- CALL END --------
  • Burn Engine
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BURN_Index_Size Equal to 0
        • Then - Actions
          • Trigger - Turn on Burn Engine Loop <gen>
        • Else - Actions
      • -------- Increase the index size --------
      • Set BURN_Index_Size = (BURN_Index_Size + 1)
      • -------- Dynamic Index --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BURN_Index_Size Greater than BURN_Index_maxSize
        • Then - Actions
          • Set BURN_Index[BURN_Index_Size] = BURN_Index_Size
          • Set BURN_Index_maxSize = BURN_Index_Size
        • Else - Actions
      • -------- Dynamic Index End --------
      • Set TempInt = BURN_Index[BURN_Index_Size]
      • -------- Setup those arrays --------
      • -------- ------------------- --------
      • -------- in order to not glitch the mui we make a boolean to be sure the action to happen only 1 time for this useage --------
      • Set BURN_BOOLEAN[TempInt] = True
      • -------- ------------------- --------
      • -------- must be alway to 0 --------
      • Set BURN_CurrentDuration[TempInt] = 0.00
      • -------- ------------------- --------
      • -------- must be alway at 0 here --------
      • Set BURN_RealTimeCounter[TempInt] = 0.00
      • -------- ------------------- --------
      • Set BURN_RealTimeInterval[TempInt] = BurnCall_RealTimeInterval
      • -------- ------------------- --------
      • -------- CONFIGURATION --------
      • -------- ------------------- --------
      • -------- owner of burned unit :) --------
      • Set BURN_CASTER[TempInt] = BurnCall_OwnerSource
      • -------- ------------------- --------
      • -------- preparing the unit group for the burned unit --------
      • Custom script: set udg_BURN_Group[udg_TempInt]= CreateGroup()
      • Unit Group - Add all units of BurnCall_Group to BURN_Group[TempInt]
      • -------- ------------------- --------
      • Set BURN_SpecialEffectString[TempInt] = BurnCall_SpecialEffectString
      • -------- ------------------- --------
      • -------- Damage --------
      • Set BURN_Damage[TempInt] = BurnCall_Damage
      • -------- ------------------- --------
      • -------- do not change unless your change the event of the loop if you did please be sure they are same --------
      • Set BURN_SpeedCounter[TempInt] = BurnCall_SpeedCounter
      • -------- ------------------- --------
      • -------- in second --------
      • Set BURN_MaxDuration[TempInt] = BurnCall_MaxDuration
      • -------- ------------------- --------
      • -------- Damage type fire :) since it burn --------
      • Set BURN_DamageType[TempInt] = BurnCall_DamageType
      • -------- ------------------- --------
      • -------- CHAOS FOR THE WIN FUCK THEM MAGIC ARMOR :D --------
      • Set BURN_AttackType[TempInt] = BurnCall_AttackType
      • -------- ------------------- --------
      • -------- COLD CONFIGURATION --------
      • -------- ------------------- --------
      • Set BURNCOLD_Boolean[TempInt] = BurnCold_Boolean
      • Set COLD_OriginMovementSpeed[TempInt] = Cold_OriginMovementSpeed
      • Set COLD_OriginMS_FormulaCounter[TempInt] = Cold_OriginMS_FormulaCounter
      • Set COLD_MS_Reduction[TempInt] = Cold_MS_Reduction
      • -------- ------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BURNCOLD_Boolean[TempInt] Equal to True
        • Then - Actions
          • Unit Group - Pick every unit in BURN_Group[TempInt] and do (Actions)
            • Loop - Actions
              • Animation - Change (Picked unit)'s animation speed to 75.00% of its original speed
              • Unit - Set (Picked unit) movement speed to (COLD_OriginMS_FormulaCounter[TempInt] - COLD_MS_Reduction[TempInt])
        • Else - Actions
      • -------- Configuration end lets make sure the unit in old group is empty --------
      • Unit Group - Remove all units of BurnCall_Group from BurnCall_Group
  • Burn Engine Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • For each (Integer BURN_LOOP) from 1 to BURN_Index_Size, do (Actions)
        • Loop - Actions
          • -------- This let look everything cleaner. --------
          • Set TempInt = BURN_Index[BURN_LOOP]
          • -------- Condition... --------
          • Set BURN_CurrentDuration[TempInt] = (BURN_CurrentDuration[TempInt] + BURN_SpeedCounter[TempInt])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BURN_CurrentDuration[TempInt] Less than BURN_MaxDuration[TempInt]
            • Then - Actions
              • -------- Actions --------
              • Game - Display to (All players) the text: BURN
              • Set BURN_RealTimeCounter[TempInt] = (BURN_RealTimeCounter[TempInt] + 1.00)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BURN_RealTimeCounter[TempInt] Greater than or equal to BURN_RealTimeInterval[TempInt]
                • Then - Actions
                  • Set BURN_RealTimeCounter[TempInt] = 0.00
                  • Unit Group - Pick every unit in BURN_Group[TempInt] and do (Actions)
                    • Loop - Actions
                      • Unit - Cause BURN_CASTER[TempInt] to damage (Picked unit), dealing BURN_Damage[TempInt] damage of attack type BURN_AttackType[TempInt] and damage type BURN_DamageType[TempInt]
                      • Special Effect - Create a special effect attached to the origin of (Picked unit) using BURN_SpecialEffectString[TempInt]
                      • Special Effect - Destroy (Last created special effect)
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BURN_BOOLEAN[TempInt] Equal to True
                • Then - Actions
                  • Set BURN_BOOLEAN[TempInt] = False
                  • Unit Group - Pick every unit in BURN_Group[TempInt] and do (Actions)
                    • Loop - Actions
                      • Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed
                      • Set COLD_OriginMS_FormulaCounter[TempInt] = (Current movement speed of BurnCall_OwnerSource)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • COLD_OriginMS_FormulaCounter[TempInt] Greater than or equal to (COLD_OriginMovementSpeed[TempInt] - 50.00)
                        • Then - Actions
                          • Unit - Set (Picked unit) movement speed to (COLD_OriginMS_FormulaCounter[TempInt] + COLD_MS_Reduction[TempInt])
                        • Else - Actions
                          • Unit - Set (Picked unit) movement speed to (COLD_OriginMovementSpeed[TempInt] + COLD_MS_Reduction[TempInt])
                  • -------- Destroy handles --------
                  • Custom script: call DestroyGroup(udg_BURN_Group[udg_TempInt])
                  • -------- RecycleIndex --------
                  • Set BURN_Index[BURN_LOOP] = BURN_Index[BURN_Index_Size]
                  • Set BURN_Index[BURN_Index_Size] = TempInt
                  • Set BURN_Index_Size = (BURN_Index_Size - 1)
                  • Set BURN_LOOP = (BURN_LOOP - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BURN_Index_Size Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
      • -------- Turn the trigger again off if the index_size is below 0... --------
 
Level 10
Joined
Feb 20, 2008
Messages
448
I have thought about it but imagin if the map have alot of different speed buff :/ wanted to use this as last resort

isnt there a way to compare speed begin and end to make it like if the speed at the end is 2 different from the origin than we do a fix formula &?

Begin 500

getting 350 in middle of spell

spell end put begin speed = 500
 
Status
Not open for further replies.
Top