Spell Pudge Wars on GUI - MPI

Dirac

22710180
Reaction score
147
Pudge Wars on GUI - MPI by Dirac Based on Pudge Wars Meat Hook by Trollvottel

Yep, thats it. A GUI version of Trollvottel Pugde Wars on GUI - MPI. Works very similar, but has some lag (in the pullback). Very customizable and friendly code for starters. Report any leaks - bugs.
No need for JASS :p

Update:
Lag reduced substancially
Most leaks cleared (help me to find em :p)
Removed the Multiple Unit Hook due bugs
Now is a MUI up to 12 ability (12 units can cast it at the same time whoever the owner is)
Added Some Customization Features at the Cast Trigger (DMGdone and MAXdistance)
Removed the Bounce due bugs (help me to find the propper equation)

The Code!
Trigger:
  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Meat Hook
    • Actions
      • Set Array = (Array + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer A) Equal to 13
        • Then - Actions
          • Set Array = 1
        • Else - Actions
      • Set Caster[Array] = (Casting unit)
      • Set PointTarget[Array] = ((Target point of ability being cast) offset by 3000.00 towards (Angle from (Position of Caster[(Integer A)]) to (Target point of ability being cast)) degrees)
      • Set PlayerBoolean[Array] = True
      • Set TempPoint = (Position of Caster[Array])
      • Set DMGdone[Array] = 100.00
      • Set MAXDistance[Array] = 3000.00
      • Unit - Create 1 Dummy2 for (Owner of Caster[Array]) at TempPoint facing (Angle from (Position of Caster[(Integer A)]) to PointTarget[(Integer A)]) degrees
      • Set Dummy2[Array] = (Last created unit)
      • Custom script: call RemoveLocation (udg_TempPoint)

Trigger:
  • Slide
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to Array, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerBoolean[(Integer A)] Equal to True
            • Then - Actions
              • Set Slide[(Integer A)] = (Slide[(Integer A)] + 1.00)
              • Set TempPoint2 = (Position of Dummy[((((Integer A) x 100) - 100) + NumberDummy[(Integer A)])])
              • Set TempPoint = (Position of Caster[(Integer A)])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FirstDummy[(Integer A)] Equal to True
                  • (Distance between TempPoint and TempPoint2) Greater than or equal to 55.00
                • Then - Actions
                  • Custom script: call RemoveLocation (udg_TempPoint)
                  • Set TempPoint = (Position of Caster[(Integer A)])
                  • Unit - Create 1 Dummy for (Owner of Caster[(Integer A)]) at TempPoint facing (Angle from TempPoint to (Position of Dummy[((((Integer A) x 100) - 100) + NumberDummy[(Integer A)])])) degrees
                  • Custom script: call RemoveLocation (udg_TempPoint2)
                  • Set NumberDummy[(Integer A)] = (NumberDummy[(Integer A)] + 1)
                  • Set Dummy[((((Integer A) x 100) - 100) + NumberDummy[(Integer A)])] = (Last created unit)
                • Else - Actions
              • Custom script: call RemoveLocation (udg_TempPoint)
              • Custom script: call RemoveLocation (udg_TempPoint2)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FirstDummy[(Integer A)] Equal to False
                • Then - Actions
                  • Set TempPoint = (Position of Caster[(Integer A)])
                  • Unit - Create 1 Dummy for (Owner of Caster[(Integer A)]) at TempPoint facing (Angle from TempPoint to PointTarget[(Integer A)]) degrees
                  • Custom script: call RemoveLocation (udg_TempPoint)
                  • Set NumberDummy[(Integer A)] = (NumberDummy[(Integer A)] + 1)
                  • Set Dummy[((((Integer A) x 100) - 100) + NumberDummy[(Integer A)])] = (Last created unit)
                  • Set FirstDummy[(Integer A)] = True
                • Else - Actions
              • For each (Integer B) from (((Integer A) x 100) - 99) to ((((Integer A) x 100) - 100) + NumberDummy[(Integer A)]), do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Dummy[(((Integer A) x 100) - 99)] Equal to Dummy[(Integer B)]
                    • Then - Actions
                      • Set TempPoint = ((Position of Dummy[(Integer B)]) offset by 20.00 towards (Angle from (Position of Dummy[(Integer B)]) to PointTarget[(Integer A)]) degrees)
                      • Unit - Move Dummy[(Integer B)] instantly to TempPoint, facing (Angle from (Position of Dummy[(Integer B)]) to PointTarget[(Integer A)]) degrees
                      • Custom script: call RemoveLocation (udg_TempPoint)
                      • Set TempPoint = ((Position of Dummy[(Integer B)]) offset by 20.00 towards (Angle from (Position of Dummy[(Integer B)]) to PointTarget[(Integer A)]) degrees)
                      • Unit - Move Dummy2[(Integer A)] instantly to TempPoint, facing (Angle from (Position of Dummy[(Integer B)]) to PointTarget[(Integer A)]) degrees
                      • Custom script: call RemoveLocation (udg_TempPoint)
                    • Else - Actions
                      • Set TempPoint = (Position of Dummy[(Integer B)])
                      • Set TempPoint2 = (Position of Dummy[((Integer B) - 1)])
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Distance between TempPoint and TempPoint2) Greater than or equal to 55.00
                        • Then - Actions
                          • Set TempPoint = ((Position of Dummy[((Integer B) - 1)]) offset by -55.00 towards (Angle from (Position of Dummy[(Integer B)]) to (Position of Dummy[((Integer B) - 1)])) degrees)
                          • Unit - Move Dummy[(Integer B)] instantly to TempPoint, facing (Angle from (Position of Dummy[(Integer B)]) to (Position of Dummy[((Integer B) - 1)])) degrees
                          • Custom script: call RemoveLocation (udg_TempPoint)
                        • Else - Actions
                      • Custom script: call RemoveLocation (udg_TempPoint)
                      • Custom script: call RemoveLocation (udg_TempPoint2)
              • -------- Set the max distance here --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Slide[(Integer A)] Greater than or equal to (MAXDistance[(Integer A)] / 20.00)
                • Then - Actions
                  • Set PlayerBoolean[(Integer A)] = False
                  • Set AbilityBoolean[(Integer A)] = True
                • Else - Actions
              • Set TempPoint = (Position of Dummy[(((Integer A) x 100) - 99)])
              • Set TempGroup = (Units within 120.00 of TempPoint matching (((Matching unit) Not equal to Caster[(Integer A)]) and (((Matching unit) is alive) Equal to True)))
              • Custom script: call RemoveLocation (udg_TempPoint)
              • -------- Set the damage done here --------
              • Unit Group - Pick every unit in TempGroup and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) belongs to an enemy of (Owner of Caster[(Integer A)])) Equal to True
                      • ((Picked unit) is A structure) Not equal to True
                    • Then - Actions
                      • Unit - Cause Caster[(Integer A)] to damage (Picked unit), dealing DMGdone[(Integer A)] damage of attack type Spells and damage type Normal
                      • Set Target[(Integer A)] = (Picked unit)
                      • Set AbilityBoolean[(Integer A)] = True
                      • Set PlayerBoolean[(Integer A)] = False
                    • Else - Actions
              • Custom script: call DestroyGroup (udg_TempGroup)
              • Set TempPoint = (Position of Dummy[(((Integer A) x 100) - 99)])
              • Set TempGroup = (Units within 120.00 of TempPoint matching (((Matching unit) Not equal to Caster[(Integer A)]) and (((Matching unit) is alive) Equal to True)))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TempGroup is empty) Equal to False
                  • AbilityBoolean[(Integer A)] Equal to True
                • Then - Actions
                  • Set PointTarget[(Integer A)] = ((Position of Dummy[(((Integer A) x 100) - 99)]) offset by 3000.00 towards ((Angle from (Position of Dummy[(((Integer A) x 100) - 99)]) to (Position of (Picked unit))) x 1.00) degrees)
                • Else - Actions
              • Custom script: call DestroyGroup (udg_TempGroup)
              • Custom script: call RemoveLocation (udg_TempPoint)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • AbilityBoolean[(Integer A)] Equal to True
                • Then - Actions
                  • For each (Integer B) from (((Integer A) x 100) - 99) to ((((Integer A) x 100) - 100) + 100), do (Actions)
                    • Loop - Actions
                      • Set TempPoint = (Position of Caster[(Integer A)])
                      • Set TempPoint2 = (Position of Dummy[(Integer B)])
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Distance between TempPoint and TempPoint2) Less than or equal to 50.00
                        • Then - Actions
                          • Custom script: call RemoveLocation (udg_TempPoint)
                          • Custom script: call RemoveLocation (udg_TempPoint2)
                          • Unit - Remove Dummy[(Integer B)] from the game
                          • Set NumberDummy[(Integer A)] = (NumberDummy[(Integer A)] - 1)
                        • Else - Actions
                          • Custom script: call RemoveLocation (udg_TempPoint)
                          • Custom script: call RemoveLocation (udg_TempPoint2)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Dummy[((((Integer A) x 100) - 100) + NumberDummy[(Integer A)])] Equal to Dummy[(Integer B)]
                            • Then - Actions
                              • Set TempPoint = ((Position of Dummy[(Integer B)]) offset by 20.00 towards (Angle from (Position of Dummy[(Integer B)]) to (Position of Caster[(Integer A)])) degrees)
                              • Unit - Move Dummy[(Integer B)] instantly to TempPoint, facing (Angle from (Position of Dummy[(Integer B)]) to PointTarget[(Integer A)]) degrees
                              • Custom script: call RemoveLocation (udg_TempPoint)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • Dummy[((Integer B) + 1)] Equal to No unit
                                • Then - Actions
                                  • Set TempPoint = ((Position of Dummy[(Integer B)]) offset by 20.00 towards (Angle from (Position of Dummy[(Integer B)]) to (Position of Caster[(Integer A)])) degrees)
                                • Else - Actions
                                  • Set TempPoint = ((Position of Dummy[(Integer B)]) offset by 20.00 towards (Angle from (Position of Dummy[(Integer B)]) to (Position of Dummy[((Integer B) + 1)])) degrees)
                              • Unit - Move Dummy[(Integer B)] instantly to TempPoint, facing (Angle from (Position of Dummy[((Integer B) + 1)]) to (Position of Dummy[(Integer B)])) degrees
                              • Custom script: call RemoveLocation (udg_TempPoint)
                              • Set TempPoint = (Position of Dummy[(((Integer A) x 100) - 99)])
                              • Unit - Move Dummy2[(Integer A)] instantly to TempPoint, facing (Facing of Dummy[(((Integer A) x 100) - 99)]) degrees
                              • Custom script: call RemoveLocation (udg_TempPoint)
                              • Set TempPoint = (Position of Dummy[(((Integer A) x 100) - 99)])
                              • Unit - Move Target[(Integer A)] instantly to TempPoint, facing (Angle from (Position of Dummy[(Integer B)]) to PointTarget[(Integer A)]) degrees
                              • Custom script: call RemoveLocation (udg_TempPoint)
                      • Set TempPoint = (Position of Caster[(Integer A)])
                      • Set TempPoint2 = (Position of Dummy2[(Integer A)])
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Distance between TempPoint and TempPoint2) Less than or equal to 50.00
                        • Then - Actions
                          • Custom script: call RemoveLocation (udg_TempPoint)
                          • Custom script: call RemoveLocation (udg_TempPoint2)
                          • Unit - Remove Dummy2[(Integer A)] from the game
                          • Set Target[(Integer A)] = No unit
                        • Else - Actions
                          • Custom script: call RemoveLocation (udg_TempPoint)
                          • Custom script: call RemoveLocation (udg_TempPoint2)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • NumberDummy[(Integer A)] Equal to 0
                    • Then - Actions
                      • Set AbilityBoolean[(Integer A)] = False
                      • Set Slide[(Integer A)] = 0.00
                      • Set NumberDummy[(Integer A)] = 0
                      • Set FirstDummy[(Integer A)] = False
                    • Else - Actions
                • Else - Actions
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Why is it every 0.02 seconds?
The minimum you should use is 0.03.
I'm sure users won't notice the 0.01, or is it noticeable?

EDIT: I'm guessing you mean this is the "Pudge Wars Meat Hook" ?
If so, we already have a couple of these on the site (that don't lag) .
And that are MUI (which is better then MPI) .
 

Draphoelix

It's not the wintercold that's killing me
Reaction score
132
We have? So far I've only seen two of theese kind of meat hook. This and by Trollvottel (gonna test this one).

Edit: Tested it. Pretty nice. But too bad it lags, and like I expected, the bounce doesn't work right. If you stand south of the houses and aim 135 degrees, it doesn't bounce right.

Edit: Also fix the leaks.
 

mordocai

New Member
Reaction score
17
how can i make it hook units according to this equation?
level of spell*1=units hooked
 

Dirac

22710180
Reaction score
147
Instead of setting a unit variable to the target create a unit group variable and add the hooked unit to it, then Pick All units in the unit group and move them to the position of the last dummy in the chain. Each time a unit is added to the group set and integer variable to +1. If Integer equal to (lvl of ability) then set Ability Boolean = True - Player Boolean = False
 

Trollvottel

never aging title
Reaction score
262
have you tested it with many units from different players casting it at once? im afraid it could cause this trigger to hit the op limit. anyway, good job, but unnecessary to do it in GUI =)

/Edit: it bounces weird and leaves the map :/

/edit2: you said it was easy to configure, but i dont see WHERE to configure it.
 

Dirac

22710180
Reaction score
147
Yeah, i tested it on multiplayer and had the most abnormal bug ever... i fixed some stuff and now Player's2 Hook shots after several seconds and for a short distance.

Help me to solve the bounce
Where do i clear the leaks?
 

Azlier

Old World Ghost
Reaction score
461
Trigger:
  • (Distance between (Position of Caster[(Integer A)]) and (Position of Dummy[NumberDummy[(Integer A)]])) Greater than or equal to 45.00


That line leaks two points. You are using lines like this quite often. Every 0.02 seconds.
AndrewGosu said:
Yes, that is a bad thing. I are serious.
 

Trollvottel

never aging title
Reaction score
262
well maybe we should add this to tutorials like "why should i use jass instead of GUI?". seriously i cant manage to tell what which piece of code is doing. its just weird and not overlookable. and laggs very hard :(
 

BlackRose

Forum User
Reaction score
239
OMG! I <3 you.

I was looking for something like this =]

+REP you (Shame I give only 1).

But reading those above, the code is bad? I can't be bothered reading it =[
 

Azlier

Old World Ghost
Reaction score
461
It may work almost correctly, but it leaks insanely and causes large amounts of lag. You even have some points stored in variables, but you leave them unused. Why?
 

Ghostwind

o________o
Reaction score
172
I'm sorry, but what is the point of this? It just encourages users to be too lazy to edit a few numbers in the easily implementable vjass version...
 

Blackrage

Ultra Cool Member
Reaction score
25
And a reason to use jass/vjass is for full MUI power, not just MPI.

And atleast make a regular jass one if your going to use the reason "Newgen doesn't work on macs".
 

Azlier

Old World Ghost
Reaction score
461
I've decided to give this another really quick scan-through. Found this:

Set PointTarget[Array] = ((Target point of ability being cast) offset by 3000.00 towards (Angle from (Position of Caster[(Integer A)]) to (Target point of ability being cast)) degrees)

Do you realize that that line leaks 3 points alone? If I spotted this on such a quick scan-through, something is terribly wrong.
I also have a horrible feeling that the JASS version may have fewer lines. Scary thought.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top