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

[Trigger] Boomerang movement problem

Status
Not open for further replies.
Level 16
Joined
Jun 24, 2009
Messages
1,409
I am making a boomerang type skill(first time) and I have a little problem with it's movement. The problem is that it moves a whole circle but I'm just done with the half of the trigger also the movement line forms a heart now....
where the problem is?
  • Shuriken
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shuriken
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SIndex Less than SMax
        • Then - Actions
          • Set SIndex = (SIndex + 1)
        • Else - Actions
          • Set SIndex = 1
      • Set SCaster[SIndex] = (Triggering unit)
      • Set STargetPoint[SIndex] = (Target point of ability being cast)
      • Set SCasterPoint[SIndex] = (Position of SCaster[SIndex])
      • Set SDistanceMax[SIndex] = 1400.00
      • Set SDistanceInner[SIndex] = (SDistanceMax[SIndex] / 10.00)
      • Set SDistanceOuter[SIndex] = (SDistanceMax[SIndex] / 2.00)
      • Set SDistance[SIndex] = SDistanceOuter[SIndex]
      • Set SMove[SIndex] = ((SDistanceOuter[SIndex] - SDistanceInner[SIndex]) x 0.03)
      • Set SBoomerangPoint[SIndex] = (SCasterPoint[SIndex] offset by (SDistanceMax[SIndex] / 2.00) towards (Angle from SCasterPoint[SIndex] to STargetPoint[SIndex]) degrees)
      • Set SAngle[SIndex] = (Angle from SBoomerangPoint[SIndex] to SCasterPoint[SIndex])
      • Set SDamage[SIndex] = (100.00 + (50.00 x (Real((Level of Shuriken for SCaster[SIndex])))))
      • Set SChange[SIndex] = False
      • Set SBack[SIndex] = False
      • Unit - Create 1 Shuriken for (Owner of SCaster[SIndex]) at SCasterPoint[SIndex] facing Default building facing degrees
      • Set SDummy[SIndex] = (Last created unit)
      • Animation - Change SDummy[SIndex]'s animation speed to 150.00% of its original speed
      • Custom script: call RemoveLocation (udg_STargetPoint[udg_SIndex])
      • Set SHas[SIndex] = True
      • Set SCount = (SCount + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Shuriken Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Shuriken Loop <gen>
        • Else - Actions
  • Shuriken Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer SInteger) from 1 to SMax, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SHas[SInteger] Equal to True
            • Then - Actions
              • Set SAngle[SInteger] = (SAngle[SInteger] + 5.00)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SBack[SInteger] Equal to False
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SChange[SInteger] Equal to False
                    • Then - Actions
                      • Set SDistance[SInteger] = (SDistance[SInteger] - SMove[SInteger])
                    • Else - Actions
                      • Set SDistance[SInteger] = (SDistance[SInteger] + SMove[SInteger])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SDistance[SInteger] Less than or equal to SDistanceInner[SInteger]
                    • Then - Actions
                      • Set SChange[SInteger] = True
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • SChange[SInteger] Equal to True
                          • SDistance[SInteger] Greater than or equal to SDistanceOuter[SInteger]
                    • Then - Actions
                      • Set SBack[SInteger] = True
                    • Else - Actions
                • Else - Actions
              • Set STempPoint = (SBoomerangPoint[SInteger] offset by SDistance[SInteger] towards SAngle[SInteger] degrees)
              • Unit - Move SDummy[SInteger] instantly to STempPoint
              • Custom script: call RemoveLocation (udg_STempPoint)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SCount Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
The trigger is very very half done.
 
Level 11
Joined
May 31, 2008
Messages
698
Is the boomerang supposed to go in the shape of a full circle?
like this? :

...........b
.......b......b
.....b..........b <-- pretend that is an actual circle xD
.....b..........b
.......b......b
.......caster

the "b" is path of the boomerang

or should it go in a more oval shape
 
Level 5
Joined
Nov 30, 2010
Messages
184
For it to move in a:
...b.B..B.b
..b....B....b
...b.......b
....b.....b
....Caster

There must be something happening to the 3 capital Bs

Maybe something to do with distanceouter?
 
Level 16
Joined
Jun 24, 2009
Messages
1,409
I don't have the original code I posted here because I have modified it and still not working properly :S Now I recalculated the values and found a little mistake ~.~. Rewriting the trigger maybe it works this time.

still the same problem... when it reaches the inner circle it changes the boolean but it goes until it reaches the boomerang point itself and only starts to move out when it reach it....
 
Level 11
Joined
May 31, 2008
Messages
698
i can make it for you. should it go back to the caster? or back to the original point it was casted from? like if the caster moves should it follow them

edit: argh i tried making it lol its kinda hard, but if i have some extra time i will try to make it work

Edit: okay i got it to work :)
I will just attach the map
you can easily change how far it goes and how wide the path of the boomerang is
btw, you can just delete the disabled functions xD
 

Attachments

  • boooomerang.w3x
    21.3 KB · Views: 55
Last edited:
Status
Not open for further replies.
Top