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

Neeeddd heeelllpppp

Status
Not open for further replies.
Level 6
Joined
Jun 14, 2009
Messages
124
Well I making a spell for The Hive. I almost finish, but there some bug.

When I try to remove some leaks all the spell bug.

In the map I put, all the (mad) leaks disable.

Test the map whit the disable leaks and try the map whit enable leaks.

you will see a probleme (I think)

plz help mee!
 

Attachments

  • Need Help!.w3x
    31.1 KB · Views: 38
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Just put the "Custom scrip: Remove Location ....." ( all four disabled) at the end if your trigger but before this part:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • LD_Index[1] Equal to 0
    • Then - Actions
      • Set LD_Index[2] = 0
      • Trigger - Turn off (This trigger)
    • Else - Actions
So it will look like this:
  • Lightning Destruction Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set LD_Index[1] = 0
      • For each (Integer LD_Index[3]) from 1 to LD_Index[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LD_Bounce[LD_Index[3]] Greater than 0
            • Then - Actions
              • Set LD_Index[1] = (LD_Index[1] + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LD_Booleen[LD_Index[3]] Equal to False
                • Then - Actions
                  • Set LD_CasterLoc[LD_Index[3]] = (Position of LD_Caster[LD_Index[3]])
                  • Set LD_Distance[LD_Index[3]] = (Distance between LD_CasterLoc[LD_Index[3]] and LD_TargetLoc[LD_Index[3]])
                  • Set LD_Angle[LD_Index[3]] = (Angle from LD_CasterLoc[LD_Index[3]] to LD_TargetLoc[LD_Index[3]])
                  • Set LD_CurrentDistance[LD_Index[3]] = ((Distance between LD_CasterLoc[LD_Index[3]] and LD_LightningLoc[LD_Index[3]]) + LD_Speed[LD_Index[3]])
                  • Set LD_MoveLoc[LD_Index[3]] = (LD_CasterLoc[LD_Index[3]] offset by LD_CurrentDistance[LD_Index[3]] towards LD_Angle[LD_Index[3]] degrees)
                  • Custom script: call RemoveLocation( udg_LD_LightningLoc[ udg_LD_Index[ 3 ] ] )
                  • Set LD_LightningLoc[LD_Index[3]] = LD_MoveLoc[LD_Index[3]]
                  • Set Z[1] = 0.00
                  • Set Z[2] = (((LD_MaxHeight[LD_Index[3]] / LD_Distance[LD_Index[3]]) x (LD_Distance[LD_Index[3]] - LD_CurrentDistance[LD_Index[3]])) x (LD_CurrentDistance[LD_Index[3]] / LD_Distance[LD_Index[3]]))
                  • Set X[1] = (X of LD_CasterLoc[LD_Index[3]])
                  • Set X[2] = (X of LD_MoveLoc[LD_Index[3]])
                  • Set Y[1] = (Y of LD_CasterLoc[LD_Index[3]])
                  • Set Y[2] = (Y of LD_MoveLoc[LD_Index[3]])
                  • Custom script: call MoveLightningEx(udg_LD_Lightning[ udg_LD_Index[ 3 ] ], false, udg_X[1], udg_Y[1], udg_Z[1], udg_X[2], udg_Y[2], udg_Z[2])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • LD_CurrentDistance[LD_Index[3]] Greater than or equal to LD_Distance[LD_Index[3]]
                    • Then - Actions
                      • Special Effect - Create a special effect at LD_TargetLoc[LD_Index[3]] using LD_Effect[1]
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at LD_CasterLoc[LD_Index[3]] using LD_Effect[1]
                      • Special Effect - Destroy (Last created special effect)
                      • Set LD_Booleen[LD_Index[3]] = True
                      • Set LD_CurrentDistance[LD_Index[3]] = 0.00
                      • Set LD_Loc1[LD_Index[3]] = LD_CasterLoc[LD_Index[3]]
                      • Set LD_Loc2[LD_Index[3]] = (LD_TargetLoc[LD_Index[3]] offset by (Random real number between LD_MinAoE[LD_Index[3]] and LD_MaxAoE[LD_Index[3]]) towards (Random angle) degrees)
                      • Set LD_Distance[LD_Index[3]] = (Distance between LD_Loc1[LD_Index[3]] and LD_Loc2[LD_Index[3]])
                      • Set LD_Angle[LD_Index[3]] = (Angle from LD_Loc1[LD_Index[3]] to LD_Loc2[LD_Index[3]])
                      • Custom script: call RemoveLocation( udg_LD_LightningLoc[ udg_LD_Index[ 3 ] ] )
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • LD_CurrentDistance[LD_Index[3]] Less than LD_Distance[LD_Index[3]]
                    • Then - Actions
                      • Set LD_Speed[LD_Index[3]] = (LD_Distance[LD_Index[3]] / (50.00 / 3.00))
                      • Set LD_CurrentDistance[LD_Index[3]] = (LD_CurrentDistance[LD_Index[3]] + LD_Speed[LD_Index[3]])
                      • Set LD_MoveLoc[LD_Index[3]] = (LD_Loc1[LD_Index[3]] offset by LD_CurrentDistance[LD_Index[3]] towards LD_Angle[LD_Index[3]] degrees)
                      • Set Z[2] = 0.00
                      • Set Z[1] = (((LD_MaxHeight[LD_Index[3]] / LD_Distance[LD_Index[3]]) x (LD_Distance[LD_Index[3]] - LD_CurrentDistance[LD_Index[3]])) x (LD_CurrentDistance[LD_Index[3]] / LD_Distance[LD_Index[3]]))
                      • Set X[2] = (X of LD_TargetLoc[LD_Index[3]])
                      • Set X[1] = (X of LD_MoveLoc[LD_Index[3]])
                      • Set Y[2] = (Y of LD_TargetLoc[LD_Index[3]])
                      • Set Y[1] = (Y of LD_MoveLoc[LD_Index[3]])
                      • Custom script: call MoveLightningEx(udg_LD_Lightning[ udg_LD_Index[ 3 ] ], false, udg_X[1], udg_Y[1], udg_Z[1], udg_X[2], udg_Y[2], udg_Z[2])
                    • Else - Actions
                      • Special Effect - Create a special effect at LD_TargetLoc[LD_Index[3]] using LD_Effect[1]
                      • Special Effect - Destroy (Last created special effect)
                      • Special Effect - Create a special effect at LD_Loc2[LD_Index[3]] using LD_Effect[1]
                      • Special Effect - Destroy (Last created special effect)
                      • Set LD_Bounce[LD_Index[3]] = (LD_Bounce[LD_Index[3]] - 1)
                      • Set LD_CurrentDistance[LD_Index[3]] = 0.00
                      • Set LD_Loc1[LD_Index[3]] = LD_Loc2[LD_Index[3]]
                      • Set LD_Loc2[LD_Index[3]] = (LD_TargetLoc[LD_Index[3]] offset by (Random real number between LD_MinAoE[LD_Index[3]] and LD_MaxAoE[LD_Index[3]]) towards (Random angle) degrees)
                      • Set LD_Distance[LD_Index[3]] = (Distance between LD_Loc1[LD_Index[3]] and LD_Loc2[LD_Index[3]])
                      • Set LD_Angle[LD_Index[3]] = (Angle from LD_Loc1[LD_Index[3]] to LD_Loc2[LD_Index[3]])
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LD_Bounce[LD_Index[3]] Equal to 0
                • Then - Actions
                  • Set LD_Bounce[LD_Index[3]] = (LD_Bounce[LD_Index[3]] - 1)
                  • Lightning - Destroy LD_Lightning[LD_Index[3]]
                  • Custom script: call RemoveLocation( udg_LD_TargetLoc[ udg_LD_Index[ 3 ] ] )
                  • Custom script: call RemoveLocation( udg_LD_Loc1[ udg_LD_Index[ 3 ] ] )
                  • Custom script: call RemoveLocation( udg_LD_Loc2[ udg_LD_Index[ 3 ] ] )
                • Else - Actions
      • Custom script: call RemoveLocation( udg_LD_MoveLoc[ udg_LD_Index[ 3 ] ] )
      • Custom script: call RemoveLocation( udg_LD_CasterLoc[ udg_LD_Index[ 3 ] ] )
      • Custom script: call RemoveLocation( udg_LD_Loc1[ udg_LD_Index[ 3 ] ] )
      • Custom script: call RemoveLocation( udg_LD_Loc2[ udg_LD_Index[ 3 ] ] )
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LD_Index[1] Equal to 0
        • Then - Actions
          • Set LD_Index[2] = 0
          • Trigger - Turn off (This trigger)
        • Else - Actions
Now the spell does the same if you would disable this 4 actions ...

Edit: What the hell is "coördinates" =D

Greetings
~ The Bomb King > Dr. Boom
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
@ Dr.Boom you're not removing all leaks there.
The locations are set up in the loop, so you're only removing the leaks for 1 loop.
Let's say there are 100 instances running, then you still have 396 leaks :p (99 * 4).

That's exactly what causes it I think: the other locations are based off the first ones.
If you remove the first ones, it will start flashing (the thing you see).



Coordinates are coordinates.
X and Y-values.

Like (0, 0) the center of the map.
Locations are a set of coordinates, but locations are handles and coördinates are reals.

Thus: coordinates are faster, as a location traces it's coordinates when you use it, while a coördinate is already a coordinate so it doesn't have to trace anything AND coordinates don't leak because they're reals and reals don't leak :D

From wikipedia:

250px-Cartesian-coordinate-system.png

You probably know this.
An X and an Y axis with a few points.

Put this in warcraft: the X- and Y-value of the points are coordinates.
The points themselves are locations.

Edit: downside of coordinates: you'll have to use custom scripts (or just completely JASS) to use them, as converting coords to a location still leaks a location (and you can't just use coords, unless you convert them to a location in GUI).
 
Status
Not open for further replies.
Top