• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Super Walk MUI bug

Status
Not open for further replies.
Level 10
Joined
Feb 20, 2008
Messages
448
Super Walk MUI bug + tips

i tryed to created a super walk system that work on mouse click or order gived, of course mine work but, mine also have some glitch!!

its can only target point, i tryed to added other issue of order but its make ubber lag!! how could i fix it ??

if the caster spamm the click he goes faster and far than he supposed to ! how can i fix it ?

i cannot use hashtable becuz its a request and the guy dont have new patch anyway!


here is the code, i doubt also this is the best way to do it

  • Harm Gate
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • ((Triggering unit) has buff Super Walk ) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Charge_Index_Size Equal to 0
        • Then - Actions
          • Trigger - Turn on Harm GateLoop <gen>
        • Else - Actions
      • -------- Dynamic Index End --------
      • -------- -------------------------------------- --------
      • -------- Increase the index size --------
      • Set Charge_Index_Size = (Charge_Index_Size + 1)
      • -------- Dynamic Index --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Charge_Index_Size Greater than Charge_Index_maxSize
        • Then - Actions
          • Set Charge_Index[Charge_Index_Size] = Charge_Index_Size
          • Set Charge_Index_maxSize = Charge_Index_Size
        • Else - Actions
      • Set Charged_TheIndex = Charge_Index[Charge_Index_Size]
      • -------- -------------------------------------- --------
      • -------- here we set variable --------
      • Set Charge_Caster[Charged_TheIndex] = (Triggering unit)
      • Set Charge_Point[1] = (Position of Charge_Caster[Charged_TheIndex])
      • Set Charge_Point[2] = (Target point of issued order)
      • Set Charge_Angle[Charged_TheIndex] = (Angle from Charge_Point[1] to Charge_Point[2])
      • Set Charge_Fade[Charged_TheIndex] = 0.00
      • Set Charge_CurDistance[Charged_TheIndex] = 0.00
      • Set Charge_SPEED[Charged_TheIndex] = 32.00
      • Set Charge_MaxDistance[Charged_TheIndex] = (Distance between Charge_Point[1] and Charge_Point[2])
      • Set Charge_Damage[Charged_TheIndex] = ((Real((Level of Gate Jump - Up for Charge_Caster[Charged_TheIndex]))) / 2.00)
      • Set Knockback_Boolean[Charged_TheIndex] = True
      • Set Knockback_CurDistance[Charged_TheIndex] = 0.00
      • Set Knockback_MaxDistance[Charged_TheIndex] = 800.00
      • Set Knockback_Speed[Charged_TheIndex] = 25.00
      • -------- -------------------------------------- --------
      • Unit - Turn collision for Charge_Caster[Charged_TheIndex] Off
      • Unit - Make Charge_Caster[Charged_TheIndex] Invulnerable
      • Unit - Make Charge_Caster[Charged_TheIndex] face Charge_Point[2] over 0.00 seconds
      • Custom script: call RemoveLocation (udg_Charge_Point[1])
      • Custom script: call RemoveLocation (udg_Charge_Point[2])
  • Harm GateLoop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Charge_LOOP) from 1 to Charge_Index_Size, do (Actions)
        • Loop - Actions
          • Set Charged_TheIndex = Charge_Index[Charge_LOOP]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Charge_CurDistance[Charged_TheIndex] Less than Charge_MaxDistance[Charged_TheIndex]
            • Then - Actions
              • Set Charge_Point[3] = (Position of Charge_Caster[Charged_TheIndex])
              • Set Charge_Point[4] = (Charge_Point[3] offset by Charge_SPEED[Charged_TheIndex] towards Charge_Angle[Charged_TheIndex] degrees)
              • Set Charge_Point[5] = (Position of (Picked unit))
              • Set Charge_Point[6] = (Charge_Point[5] offset by Charge_SPEED[Charged_TheIndex] towards Charge_Angle[Charged_TheIndex] degrees)
              • Set Charge_Fade[Charged_TheIndex] = (Charge_Fade[Charged_TheIndex] + 4.00)
              • Set Charge_Angle2[Charged_TheIndex] = (Angle from Charge_Point[3] to Charge_Point[5])
              • Special Effect - Create a special effect at Charge_Point[3] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Move Charge_Caster[Charged_TheIndex] instantly to Charge_Point[4]
              • Unit - Create 1 Dummy Taijustsu Master for (Owner of Charge_Caster[Charged_TheIndex]) at Charge_Point[3] facing Charge_Angle[Charged_TheIndex] degrees
              • Set Charge_Dummy[Charged_TheIndex] = (Last created unit)
              • Unit - Turn collision for Charge_Dummy[Charged_TheIndex] Off
              • Animation - Play Charge_Dummy[Charged_TheIndex]'s walk animation
              • Animation - Change Charge_Dummy[Charged_TheIndex]'s vertex coloring to (100.00%, 100.00%, 100.00%) with Charge_Fade[Charged_TheIndex]% transparency
              • Unit - Add a 0.30 second Generic expiration timer to Charge_Dummy[Charged_TheIndex]
              • Set Charge_Group[Charged_TheIndex] = (Units within 250.00 of Charge_Point[3] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of Charge_Caster[Charged_TheIndex])) Equal to True) and (((Matching unit) is in Charge_Group2[Charged_TheI
              • Destructible - Pick every destructible within 250.00 of Charge_Point[3] and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked destructible) is alive) Equal to True
                    • Then - Actions
                      • Destructible - Kill (Picked destructible)
                    • Else - Actions
              • Set Charge_CurDistance[Charged_TheIndex] = (Charge_CurDistance[Charged_TheIndex] + Charge_SPEED[Charged_TheIndex])
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in Charge_Group[Charged_TheIndex] and do (Actions)
                • Loop - Actions
                  • Unit - Cause Charge_Caster[Charged_TheIndex] to damage (Picked unit), dealing Charge_Damage[Charged_TheIndex] damage of attack type Spells and damage type Normal
                  • Unit Group - Add (Picked unit) to Charge_Group2[Charged_TheIndex]
                  • -------- knockback system --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Knockback_Boolean[Charged_TheIndex] Equal to True
                      • ((Picked unit) is in Charge_Group2[Charged_TheIndex]) Equal to True
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Knockback_CurDistance[Charged_TheIndex] Less than Knockback_MaxDistance[Charged_TheIndex]
                        • Then - Actions
                          • Set Knockback_CurDistance[Charged_TheIndex] = (Knockback_CurDistance[Charged_TheIndex] + Knockback_Speed[Charged_TheIndex])
                          • Unit - Move (Picked unit) instantly to Charge_Point[6], facing Charge_Angle2[Charged_TheIndex] degrees
                          • Special Effect - Create a special effect at Charge_Point[5] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
                          • Special Effect - Destroy (Last created special effect)
                        • Else - Actions
                    • Else - Actions
              • Custom script: call RemoveLocation (udg_Charge_Point[3])
              • Custom script: call RemoveLocation (udg_Charge_Point[4])
              • Custom script: call RemoveLocation (udg_Charge_Point[5])
              • Custom script: call RemoveLocation (udg_Charge_Point[6])
            • Else - Actions
              • Unit - Make Charge_Caster[Charged_TheIndex] Vulnerable
              • Animation - Play Charge_Caster[Charged_TheIndex]'s attack - 2 animation
              • Unit - Turn collision for Charge_Caster[Charged_TheIndex] On
              • Unit Group - Remove all units from Charge_Group2[Charged_TheIndex]
              • -------- RecycleIndex --------
              • Set Charge_Index[Charge_LOOP] = Charge_Index[Charge_Index_Size]
              • Set Charge_Index[Charge_Index_Size] = Charged_TheIndex
              • Set Charge_Index_Size = (Charge_Index_Size - 1)
              • Set Charge_LOOP = (Charge_LOOP - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Charge_Index_Size Equal to 0
            • Then - Actions
              • Trigger - Turn off (This trigger)
            • Else - Actions
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Actions
    • Set Charge_Index_Size = (Charge_Index_Size + 1)
    • -------- Dynamic Index End --------
    • -------- -------------------------------------- --------
    • -------- Increase the index size --------
    • Set Charge_Index_Size = (Charge_Index_Size + 1)
    • -------- Dynamic Index --------

Whay increase it twice?

Post the map with the ability, that would help a lot.
 
Level 10
Joined
Feb 20, 2008
Messages
448
If he's so stubborn about making your job harder, don't make the thing for him. Simple.
lol, i agree but im more comfortable with indexing :/ so its not a metter for me,

Dr Super Good said:
Um, this makes no sense. The person can just patch to 1.24 in 10 seconds instead of us having to not use hashtables. Also providing him with handlevar systems would be stupid as only he could use them as they no longer work in 1.24.
whats does he mean by handle var system no longer work in 1.24 ?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
Incorrect, it was only fixed in 1.24. All versions prior (1.23 and older) still could use it.

This was to try and make the game more robust and faster (I just kid you). . .
Actually it was to stop a potential security issue with WC3 letting it execute dangerous code which could ac as trojens, worms or viruses if used by the wrong people.
A side affect was hashtables and natives for the removed functionality, which are faster, more reliable and more flexible.

The bug actually has not been fully removed, it just has been removed in its easiest and most common forms. The actual modding community however has deemed the use of the remaining return bugs depricated as they are capable of being removed at any time with another WC3 patch.
 
Level 9
Joined
Dec 12, 2007
Messages
489
if the caster spamm the click he goes faster and far than he supposed to ! how can i fix it ?

well, in a rough math example:
1st click -> unit registered, moving in x distance per interval.
2nd click -> unit registered for the 2nd time, moving in x+x distance per interval.
3rd click -> unit registered for the 3rd time, moving in x+x+x distance per interval. and so on.

I think you should check if the unit is currently moving by Super Walk.
 
Level 10
Joined
Feb 20, 2008
Messages
448
well, in a rough math example:
1st click -> unit registered, moving in x distance per interval.
2nd click -> unit registered for the 2nd time, moving in x+x distance per interval.
3rd click -> unit registered for the 3rd time, moving in x+x+x distance per interval. and so on.

I think you should check if the unit is currently moving by Super Walk.

yeah you are right i will try this!!but how could i do this ? by checking a unit in group would work ?

@Dr Super Good return bug is only in jass right ?i do know hashtable are faster, i saw the difference between each type of indexing system!My indexing system is more efficient than normal 1 that use only 1 index with 2 array to check it!!

i will try to make more people use new patch, becuz in forum i use most of using old server and aren't playing b.net!!Anyway like i said earlier im confortable with Dynamic indexing,i will try to make a good hashtable template to make my next spell better!!
 
Last edited:
Status
Not open for further replies.
Top