• 🏆 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 Question [GUI]

Status
Not open for further replies.
Level 7
Joined
Jun 20, 2007
Messages
255
1. How do i make a unit rotate around another unit and explode when it contacts something?

Like an asteroid around a planet, which is why im wondering.

Its going to be an orbit.

The reason im asking this is because im thinking of testing to make an solar system in wc3. Which also brings me to my other point. I also need to know how i make an unit rotate farther out (a longer course around the object which in this case will be the sun). +Rep for whoever helps me with this as a reward. Thanks in advance. :grin:
 
Last edited:
Level 7
Joined
Jun 20, 2007
Messages
255
Can you like say that again, but in trigger?

And sorry but i really hate jass because i just dont understand it and i have tried countless times.
 
Yes, Cokemonkey11, stop suggesting everyone to learn Jass. They obviously won't be motivated by you, but by some problems they will come along with, once they find no solution in GUI. I don't try to offend you by the way.

So, here are the triggers and a test map to check them (the reason why I did this, is to learn by looking at them and manually checking the actions used):
  • Zero
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hashtable = (Last created hashtable)
  • One
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
      • ((Triggering unit) is in Group) Equal to False
    • Actions
      • Set Points[1] = (Position of (Triggering unit))
      • Set Points[2] = (Points[1] offset by 300.00 towards 0.00 degrees)
      • Unit - Create 1 Peasant for (Owner of (Triggering unit)) at Points[2] facing Default building facing degrees
      • Hashtable - Save 0.00 as (Key angle) of (Key (Triggering unit)) in Hashtable
      • Hashtable - Save Handle Of(Last created unit) as (Key dummy) of (Key (Triggering unit)) in Hashtable
      • Unit Group - Add (Triggering unit) to Group
      • Custom script: call RemoveLocation (udg_Points[1])
      • Custom script: call RemoveLocation (udg_Points[2])
      • Trigger - Turn on Two <gen>
  • Two
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Group is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in Group and do (Actions)
            • Loop - Actions
              • Set Angle = (Load (Key angle) of (Key (Picked unit)) from Hashtable)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Angle Equal to 360.00
                • Then - Actions
                  • Hashtable - Save 0.00 as (Key angle) of (Key (Picked unit)) in Hashtable
                • Else - Actions
              • Hashtable - Save (Angle + 10.00) as (Key angle) of (Key (Picked unit)) in Hashtable
              • Set Dummy = (Load (Key dummy) of (Key (Picked unit)) in Hashtable)
              • Set Points[3] = (Position of (Picked unit))
              • Set Points[4] = (Points[3] offset by 300.00 towards Angle degrees)
              • Unit - Move Dummy instantly to Points[4]
              • Custom script: call RemoveLocation (udg_Points[3])
              • Custom script: call RemoveLocation (udg_Points[4])
It is just an example.

Map: View attachment Rotation.w3x
 
Level 7
Joined
Jun 20, 2007
Messages
255
Ah thanks you Pharao_, but how do i make the unit rotate slower? Without altering the Every 0.03 seconds, because if i do it wont look as it rotates more as it blinks around.
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
Ah thanks you Pharao_, but how do i make the unit rotate slower? Without altering the Every 0.03 seconds, because if i do it wont look as it rotates more as it blinks around.

alter the angle
  • Hashtable - Save (Angle + 10.00) as (Key angle) of (Key (Picked unit)) in Hashtable
change 10 to a lower value if you want to make it slower and to a higher value if you want to make it faster

and if you want to change the distance change the offset (300.00)

and if you want to change the distance/angle over time create a variable of type real and increase/decrease it like this:
  • set angle = angle + 0.01
 
Level 7
Joined
Jun 20, 2007
Messages
255
Thanks Pharao_ and D4RK_G4ND4LF, it really helped me, now i got a functioning solar sytem. Both of you have been +reped for this.

Btw with those triggers Pharao showed me can i make several units rotate around a single object? Thanks Again!
 
Status
Not open for further replies.
Top