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

Units are not spawning in a line [deceptive title, ahue]

Status
Not open for further replies.
Level 12
Joined
Oct 10, 2009
Messages
438
Deceptive it may be, but the Title is quite literally what is happening.

Basically, this kahmehahehaheauhea spell I have creates a literal line of dummies to simulate the 'beam' effect, but this line has massive and random holes within it, and by random I mean random. Some times there are holes in the beam and sometimes there is none. Also, the beam isn't flying its full length randomly aswell.

I have tried so many different methods to fix this, Heck. I've even tried using the script method of moving the unit to the set point.

Anywho, here's the offending trigger: (NOTE, I HAVE NO IDEA if it is this trigger or another that is in my map thats screwing everything over, Also, I know this spell is not mui. It does not need to be for this purpose)

Edit: Here's the lingo:
  • Dummy effect 3: Is the leading 'Head' of the beam, basically a larger ball.
  • Dummy effect 1: Is a smaller version of the 'Head' beam.
  • Khamehame_Number: Is an IDX of the type of Khame, basically 0 or 1 which changes the beams color.


  • G Khameloop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in UG_KHAMA and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to (==) Dummy (Effect 3)
            • Then - Actions
              • Unit - Pause Kamehameha_Caster
              • Set BooleanTemp = False
              • Set Point[0] = (Position of (Picked unit))
              • Set Point[1] = (Point[0] offset by 27.00 towards (Facing of (Picked unit)) degrees)
              • Set KhameIDX = (KhameIDX + 1)
              • Set Unit = (Picked unit)
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • KhameIDX Greater than or equal to (>=) 2
                  • Then - Actions
                    • Set KhameIDX = 0
                    • Create ubersplat at Point[0] of type Thunder Clap with color (255.00%, 255.00%, 255.00%) and 0.00% transparency (Disable paused state, Disable skipping birth time)
                    • Ubersplat - Change (Last created ubersplat): Enable render always state
                    • Ubersplat - Finish (Last created ubersplat)
                    • Ubersplat - Show (Last created ubersplat)
                    • Unit - Create 1 Dummy (Effect 1) for (Owner of Kamehameha_Caster) at Point[0] facing (Angle from Point[0] to Point[1]) degrees
                    • Set Unit = (Last created unit)
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Kamehameha_Number Equal to (==) 1
                        • Then - Actions
                          • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 80.00%, 0.00%) with 0.00% transparency
                        • Else - Actions
                    • Unit - Turn collision for (Last created unit) Off
                    • Custom script: call SetUnitX(udg_Unit, GetLocationX(udg_Point[0]))
                    • Custom script: call SetUnitY(udg_Unit, GetLocationY(udg_Point[0]))
                    • Animation - Change (Last created unit)'s animation speed to 0.00% of its original speed
                    • Unit Group - Add (Last created unit) to KhameGroup
                  • Else - Actions
              • Set Unit = (Picked unit)
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Terrain pathing at Point[1] of type Flyability is off) Equal to (==) False
                  • Then - Actions
                    • Unit - Move (Picked unit) instantly to Point[1]
                  • Else - Actions
              • Set Group = (Units within 300.00 of Point[1] matching ((((Matching unit) belongs to an enemy of (Owner of Kamehameha_Caster)) Equal to (==) True) and ((((Matching unit) is dead) Equal to (==) False) and ((Level of Invulnerable (Neutral) for (Matching unit)) Equal to (==)
              • Unit Group - Pick every unit in Group and do (Actions)
                • Loop - Actions
                  • Set Points[1] = (Position of (Picked unit))
                  • Set Points[2] = (Points[1] offset by (15.00 + (Real(Kamehameha_Ability_Level))) towards (Facing of Unit) degrees)
                  • Set Units[1] = (Picked unit)
                    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • ((Picked unit) is in UG_KHAMEDAMAGE) Equal to (==) False
                      • Then - Actions
                        • Unit - Cause Kamehameha_Caster to damage (Picked unit), dealing Kamehameha_Damage_Total damage of attack type Spells and damage type Magic
                        • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                        • Set BooleanTemp = True
                        • Unit Group - Add (Picked unit) to UG_KHAMEDAMAGE
                      • Else - Actions
                    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Terrain pathing at Point[2] of type Walkability is off) Equal to (==) False
                      • Then - Actions
                        • Custom script: call SetUnitX(udg_Units[1], GetLocationX(udg_Points[2]))
                        • Custom script: call SetUnitY(udg_Units[1], GetLocationY(udg_Points[2]))
                      • Else - Actions
                  • Custom script: call RemoveLocation(udg_Points[1])
                  • Custom script: call RemoveLocation(udg_Points[2])
              • Custom script: call DestroyGroup(udg_Group)
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • ((Picked unit) is alive) Equal to (==) False
                  • Then - Actions
                    • Unit Group - Remove (Picked unit) from UG_KHAMA
                    • Set Group = (Units within 600.00 of Point[1] matching ((((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to (==) True) and ((((Matching unit) is dead) Equal to (==) False) and ((Level of Invulnerable (Neutral) for (Matching unit)) Equal to (==) 0))
                    • Create ubersplat at Point[0] of type Death Human Large Building with color (255.00%, 255.00%, 255.00%) and 0.00% transparency (Disable paused state, Disable skipping birth time)
                    • Ubersplat - Change (Last created ubersplat): Enable render always state
                    • Ubersplat - Finish (Last created ubersplat)
                    • Ubersplat - Show (Last created ubersplat)
                    • Environment - Create a 3.00 second Normal ripple deformation at Point[1] with starting radius 1024.00, ending radius 1024.00, and depth 32.00, using 1.00 second ripples spaced 512.00 apart
                    • Unit - Remove (Last created unit) from the game
                    • Unit - Create 1 Dummy (Effect 4) for (Owner of Kamehameha_Caster) at Point[0] facing (Angle from Point[0] to Point[1]) degrees
                    • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
                    • Unit - Unpause Kamehameha_Caster
                    • Animation - Change Kamehameha_Caster's animation speed to 100.00% of its original speed
                    • Special Effect - Create a special effect at Point[1] using Abilities\Spells\Orc\EarthQuake\EarthQuakeTarget.mdl
                    • Special Effect - Destroy (Last created special effect)
                    • Player Group - Pick every player in (All players) and do (Actions)
                      • Loop - Actions
                        • Camera - Stop swaying/shaking the camera for (Picked player)
                    • Unit Group - Pick every unit in Group and do (Actions)
                      • Loop - Actions
                        • Unit - Cause Kamehameha_Caster to damage (Picked unit), dealing Kamehameha_Damage_Total damage of attack type Spells and damage type Magic
                    • Unit Group - Pick every unit in KhameGroup and do (Actions)
                      • Loop - Actions
                        • Unit Group - Remove (Picked unit) from KhameGroup
                        • Unit - Remove (Picked unit) from the game
                    • Unit Group - Pick every unit in UG_KHAMEDAMAGE and do (Actions)
                      • Loop - Actions
                        • Unit Group - Remove (Picked unit) from UG_KHAMEDAMAGE
                    • Unit - Remove (Picked unit) from the game
                    • Custom script: call DestroyGroup(udg_Group)
                    • Trigger - Turn off (This trigger)
                  • Else - Actions
              • Custom script: call RemoveLocation(udg_Point[0])
              • Custom script: call RemoveLocation(udg_Point[1])
            • Else - Actions


Also, if anyone could fix the 'lag' present in my map, I'll give them my first born child.

Map is attached for reference, requires newgen.
View attachment 120961

Oh, almost forgot. Yes, I know there terrain is almost a copa pasta of FOC's terrain, but thats all I want (For now)
 
Last edited by a moderator:
Don''t double post, you could get temporarily banned for that. Use the edit button.

Yes, I agree loop time shouldn't affect spawn because it's instant. The lag may be caused by leaks, because you don't remove some of the groups and the loop runs too fast.
DestroyGroup(udg_UG_KHAMEDAMAGE)
DestroyGroup(udg_KhameGroup)

There's an empty loop after you set the "Group" variable, why pick them for nothing?
You just destroy it right after picking them..

That's all I noticed..
 
Level 12
Joined
Oct 10, 2009
Messages
438
Don''t double post, you could get temporarily banned for that. Use the edit button.

Yes, I agree loop time shouldn't affect spawn because it's instant. The lag may be caused by leaks, because you don't remove some of the groups and the loop runs too fast.
DestroyGroup(udg_UG_KHAMEDAMAGE)
DestroyGroup(udg_KhameGroup)

There's an empty loop after you set the "Group" variable, why pick them for nothing?
You just destroy it right after picking them..

That's all I noticed..

It's probably left over from me editing the spell, good find!
 
Level 35
Joined
Oct 9, 2006
Messages
6,392
Any specfic reason you want to create your own version of the kamehame spell? I have a working jass version laying around if I recall correct.. I can find it should you want it, if anything should provide some ideas for how to do this.

Personally I find that using multitudes of dummy units created almost simultaneously is not what I would do.
 
Level 35
Joined
Oct 9, 2006
Messages
6,392
Mhhrmm, Baron how do you do it? I've ended up remaking the spell and have gotten it working, but I'm curious at your methods

Well, I would be lazy and use only one custom made sfx for the visual effect (given that I am mostly an artist rather than coder) :wgrin:, then just use the triggers to apply the effects of the spell, similar to what you do (meaning damage, terrain destruction, deformation so forth). So basically I would try to skip most special effects and dummy units - however as I have only the jass version currently, and have made no real test with a GUI one, I figure I might have to add more than I currently consider.

(Btw: how did you get yours to work?)
 
Level 12
Joined
Oct 10, 2009
Messages
438
Spamming dummy units, here's the updated trigger:

  • G Khameloop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set G_KhameIDX[0] = (G_KhameIDX[0] + 1)
      • Set G_KhameIDX[1] = (G_KhameIDX[1] + 1)
      • Set G_KLastPoint = (Position of G_KhameHead[0])
      • Unit - Pause Kamehameha_Caster
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • G_KhameIDX[3] Equal to (==) 1
          • Then - Actions
            • Set Point[0] = (G_KLastPoint offset by 13.00 towards G_KhameReal[0] degrees)
          • Else - Actions
            • Set Point[0] = (G_KLastPoint offset by 27.00 towards G_KhameReal[0] degrees)
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Terrain pathing at Point[0] of type Flyability is off) Equal to (==) True
          • Then - Actions
            • Set Point[1] = G_KLastPoint
          • Else - Actions
            • Set Point[1] = Point[0]
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • G_KhameIDX[3] Equal to (==) 1
          • Then - Actions
            • Camera - Pan camera for Player 1 (Red) to Point[1] over 0.00 seconds
          • Else - Actions
        • Do Multiple ActionsFor each (Integer A) from 0 to 4, do (Actions)
          • Loop - Actions
            • Unit - Move G_KhameHead[(Integer A)] instantly to Point[1]
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • G_KhameIDX[1] Equal to (==) 3
          • Then - Actions
            • Set G_KhameIDX[1] = 0
            • Create ubersplat at Point[1] of type Thunder Clap with color (255.00%, 255.00%, 255.00%) and 0.00% transparency (Disable paused state, Disable skipping birth time)
            • Ubersplat - Change (Last created ubersplat): Enable render always state
            • Ubersplat - Finish (Last created ubersplat)
            • Ubersplat - Show (Last created ubersplat)
            • Unit - Create 1 Dummy (Effect 1) for (Owner of Kamehameha_Caster) at Point[1] facing G_KhameReal[0] degrees
            • Unit - Turn collision for (Last created unit) Off
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Kamehameha_Number Equal to (==) 1
                • Then - Actions
                  • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 80.00%, 0.00%) with 0.00% transparency
                • Else - Actions
            • Unit Group - Add (Last created unit) to KhameGroup
          • Else - Actions
      • Set Group = (Units within 300.00 of Point[1] matching ((((Matching unit) belongs to an enemy of (Owner of Kamehameha_Caster)) Equal to (==) True) and ((((Matching unit) is dead) Equal to (==) False) and ((Level of Invulnerable (Neutral) for (Matching unit)) Equal to (==)
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • Set Points[1] = (Position of (Picked unit))
          • Set Points[2] = (Points[1] offset by (15.00 + (Real(Kamehameha_Ability_Level))) towards (Facing of Unit) degrees)
          • Set Units[1] = (Picked unit)
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Picked unit) is in UG_KHAMEDAMAGE) Equal to (==) False
              • Then - Actions
                • Unit - Cause Kamehameha_Caster to damage (Picked unit), dealing Kamehameha_Damage_Total damage of attack type Spells and damage type Magic
                • Unit Group - Add (Picked unit) to UG_KHAMEDAMAGE
              • Else - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Terrain pathing at Point[2] of type Walkability is off) Equal to (==) False
              • Then - Actions
                • Custom script: call SetUnitX(udg_Units[1], GetLocationX(udg_Points[2]))
                • Custom script: call SetUnitY(udg_Units[1], GetLocationY(udg_Points[2]))
              • Else - Actions
          • Custom script: call RemoveLocation(udg_Points[1])
          • Custom script: call RemoveLocation(udg_Points[2])
      • Custom script: call DestroyGroup(udg_Group)
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • G_KhameIDX[0] Greater than or equal to (>=) 130
          • Then - Actions
            • Do Multiple ActionsFor each (Integer A) from 0 to 4, do (Actions)
              • Loop - Actions
                • Unit - Remove G_KhameHead[(Integer A)] from the game
            • Create ubersplat at Point[1] of type Death Human Large Building with color (255.00%, 255.00%, 255.00%) and 0.00% transparency (Disable paused state, Disable skipping birth time)
            • Ubersplat - Change (Last created ubersplat): Enable render always state
            • Ubersplat - Finish (Last created ubersplat)
            • Ubersplat - Show (Last created ubersplat)
            • Environment - Create a 3.00 second Normal ripple deformation at Point[1] with starting radius 1024.00, ending radius 1024.00, and depth 32.00, using 1.00 second ripples spaced 512.00 apart
            • Unit - Remove (Last created unit) from the game
            • Unit - Create 1 Dummy (Effect 4) for (Owner of Kamehameha_Caster) at Point[1] facing G_KhameReal[0] degrees
            • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
            • Unit - Unpause Kamehameha_Caster
            • Animation - Change Kamehameha_Caster's animation speed to 100.00% of its original speed
            • Special Effect - Create a special effect at Point[1] using Abilities\Spells\Orc\EarthQuake\EarthQuakeTarget.mdl
            • Special Effect - Destroy (Last created special effect)
            • Player Group - Pick every player in (All players) and do (Actions)
              • Loop - Actions
                • Camera - Stop swaying/shaking the camera for (Picked player)
            • Set Group = (Units within 500.00 of Point[1] matching ((((Matching unit) belongs to an enemy of (Owner of Kamehameha_Caster)) Equal to (==) True) and ((((Matching unit) is dead) Equal to (==) False) and ((Level of Invulnerable (Neutral) for (Matching unit)) Equal to (==)
            • Unit Group - Pick every unit in Group and do (Actions)
              • Loop - Actions
                • Set Points[1] = (Position of (Picked unit))
                • Set Points[2] = (Points[1] offset by (15.00 + (Real(Kamehameha_Ability_Level))) towards (Facing of Unit) degrees)
                • Set Units[1] = (Picked unit)
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is in UG_KHAMEDAMAGE) Equal to (==) False
                    • Then - Actions
                      • Unit - Cause Kamehameha_Caster to damage (Picked unit), dealing Kamehameha_Damage_Total damage of attack type Spells and damage type Magic
                      • Unit Group - Add (Picked unit) to UG_KHAMEDAMAGE
                    • Else - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain pathing at Point[2] of type Walkability is off) Equal to (==) False
                    • Then - Actions
                      • Custom script: call SetUnitX(udg_Units[1], GetLocationX(udg_Points[2]))
                      • Custom script: call SetUnitY(udg_Units[1], GetLocationY(udg_Points[2]))
                    • Else - Actions
                • Custom script: call RemoveLocation(udg_Points[1])
                • Custom script: call RemoveLocation(udg_Points[2])
            • Custom script: call DestroyGroup(udg_Group)
            • Unit Group - Pick every unit in KhameGroup and do (Actions)
              • Loop - Actions
                • Unit Group - Remove (Picked unit) from KhameGroup
                • Unit - Remove (Picked unit) from the game
            • Unit Group - Pick every unit in UG_KHAMEDAMAGE and do (Actions)
              • Loop - Actions
                • Unit Group - Remove (Picked unit) from UG_KHAMEDAMAGE
            • Trigger - Turn off (This trigger)
          • Else - Actions
      • Custom script: call RemoveLocation(udg_Point[0])
      • Custom script: call RemoveLocation(udg_Point[1])
      • Custom script: call RemoveLocation(udg_G_KLastPoint)
As you can see though, it isn't mui. I have another trigger running previously to simulate the charging effect, although... I probably should merge both triggers
 
Status
Not open for further replies.
Top