- Joined
- Sep 9, 2007
- Messages
- 6,759
Whisp Wheels - GUI Tutorial
Introduction
Hey all, I've decided to post an Tutorial about Whisp Wheels.
Basics
What you need:
(Mark on monitor if you have it)
Brain and a sense of humor ( )
World Editor open ( )
Music on ( )
Alot of boredom or freetime (Alternatively wanna make an Escape) ( )
What you get:
A full Functional Whispwheel with even more coolness.
Whats a whisp wheel?:
A whisp wheel has atleast 2 Parts:
The basic unit (1) which is placed to the middle so other wheels can spin around.
The wheel part (2) is the spinning part around the wheel basic unit (1).
You can also do a wheel part spinning around the wheel part around the wheel unit, but thats something I will describe later.
Starting:
Well basicly open World Editor, create a new map, delete all triggers and add a new category. Call it Whisp Wheels.
Then do a Initial Trigger which call Whisp Wheels to start on Mapstart.
Please notice that placing too much wheels may delay the start and cause errors, so you can also add waits between intialising wheels so you don't have that problem.
Now think again... A whisp wheel is atleast 2 unit on your map, but we have 0! (Or atleast 0 we need).
So lets place 2 units on map! One main unit (You can use a Scout Tower if you want ) and a part (Use a whisp maybe).
So we use this action:
Have you heared about Points and Leaks? I think you did! Now its time
to use leak removing!
So lets do this again! Add a new variable, call it Tmp_Loc.
(Why udg_Tmp_Loc? It is Tmp_Loc I think?
Yes, but everything you do in GUI has been added a udg when you change it
into jass code (JASS is the code language, GUI is just an interface for that))
And ofcourse we do 2 part units aswell!
But how do we get them to spin?
Well we use firstly a trigger for every wheel, called WheelChanger.
Also do so! Just add a new trigger and call it WheelChanger.
This trigger will be your trigger which forces the Wheel Parts to spin around.
But how will we get them move around, not in a line?
And how can we handle unlimited parts with just using one system?
Well I did another picture for my idea, look at it carefully and think twice before you continue reading.
So my idea: I group the parts (because they can be endless, but
we have everytime just 1 unit to spin around.
Because we want to make this MUI GUI we need to array it. But thats not the problem.
So do 2 new variables:
Wheel_Parts ( Unitgroup, Arrayed )
Wheel_Mains ( Unit, Arrayed )
Well and maybe because we want to keep cache clear, we need following
variables (I will tell u soon why):
Tmp_Group (Unitgroup)
Tmp_Loc2 (Location)
Tmp_Real (Real)
Tmp_Real2 (Real)
Tmp_Unit
And now finally, we start working on the trigger!
WheelChanger
At next we need to set the new variables. So lets modify the start trigger.
We also add a Trigger - Turn WheelChanger on at last because we want to enable whisp wheel after starting him.
Back to WheelChanger, we have got 50% so far!
WheelChanger
WheelChanger
Now we talked to every unit iwth the pick each unit command, lets think about that the picked units are parts of the wheel.
WheelChanger
Now because we want it to move we add additionally a few lines of code to move those picked units forwards.
WheelChanger
Note: I am NOT at home this was just written with head, DO NOT try to copy&paste this stuff!
Introduction
Hey all, I've decided to post an Tutorial about Whisp Wheels.
Basics
What you need:
(Mark on monitor if you have it)
Brain and a sense of humor ( )
World Editor open ( )
Music on ( )
Alot of boredom or freetime (Alternatively wanna make an Escape) ( )
What you get:
A full Functional Whispwheel with even more coolness.
Whats a whisp wheel?:
A whisp wheel has atleast 2 Parts:
The basic unit (1) which is placed to the middle so other wheels can spin around.
The wheel part (2) is the spinning part around the wheel basic unit (1).
You can also do a wheel part spinning around the wheel part around the wheel unit, but thats something I will describe later.

Starting:
Well basicly open World Editor, create a new map, delete all triggers and add a new category. Call it Whisp Wheels.
Then do a Initial Trigger which call Whisp Wheels to start on Mapstart.
-
Event: Elapsed game time equal to 0.00
-
Condition:
-
Action:
Please notice that placing too much wheels may delay the start and cause errors, so you can also add waits between intialising wheels so you don't have that problem.
What do we need now?
Hmm I think we are ready... Oh wait this just began!Now think again... A whisp wheel is atleast 2 unit on your map, but we have 0! (Or atleast 0 we need).
So lets place 2 units on map! One main unit (You can use a Scout Tower if you want ) and a part (Use a whisp maybe).
So we use this action:
-
Unit - Create 1 Scout Tower For Player1(Red) at (Center of(Rect))
Have you heared about Points and Leaks? I think you did! Now its time
to use leak removing!
So lets do this again! Add a new variable, call it Tmp_Loc.
-
General - Set Tmp_Loc = Center of(Rect)
-
Unit - Create 1 Scout Tower For Player1(Red) at Tmp_Loc
-
Custom Script - call RemoveLocation(udg_Tmp_Loc)
(Why udg_Tmp_Loc? It is Tmp_Loc I think?
Yes, but everything you do in GUI has been added a udg when you change it
into jass code (JASS is the code language, GUI is just an interface for that))
And ofcourse we do 2 part units aswell!
-
General - Set Tmp_Loc = Center of(Rect)
-
Unit - Create 1 Scout Tower For Player1(Red) at Tmp_Loc
-
Custom Script - call RemoveLocation(udg_Tmp_Loc)
-
General - Set Tmp_Loc = Center of(Rect2)
-
Unit - Create 1 Whisp For Player1(Red) at Tmp_Loc
-
Custom Script - call RemoveLocation(udg_Tmp_Loc)
-
General - Set Tmp_Loc = Center of(Rect3)
-
Unit - Create 1 Whisp For Player1(Red) at Tmp_Loc
-
Custom Script - call RemoveLocation(udg_Tmp_Loc)
-
General - Set Tmp_Loc = Center of(Rect4)
-
Unit - Create 1 Whisp For Player1(Red) at Tmp_Loc
-
Custom Script - call RemoveLocation(udg_Tmp_Loc)
But how do we get them to spin?
Well we use firstly a trigger for every wheel, called WheelChanger.
Also do so! Just add a new trigger and call it WheelChanger.
This trigger will be your trigger which forces the Wheel Parts to spin around.
But how will we get them move around, not in a line?
And how can we handle unlimited parts with just using one system?
Well I did another picture for my idea, look at it carefully and think twice before you continue reading.

So my idea: I group the parts (because they can be endless, but
we have everytime just 1 unit to spin around.
Because we want to make this MUI GUI we need to array it. But thats not the problem.
So do 2 new variables:
Wheel_Parts ( Unitgroup, Arrayed )
Wheel_Mains ( Unit, Arrayed )
Well and maybe because we want to keep cache clear, we need following
variables (I will tell u soon why):
Tmp_Group (Unitgroup)
Tmp_Loc2 (Location)
Tmp_Real (Real)
Tmp_Real2 (Real)
Tmp_Unit
And now finally, we start working on the trigger!
WheelChanger
-
Event: Every 0.01 seconds of the game
-
Condition:
-
Actions:
At next we need to set the new variables. So lets modify the start trigger.
-
General - Set Tmp_Loc = Center of(Rect)
-
Unit - Create 1 Scout Tower For Player1(Red) at Tmp_Loc
-
Custom Script - call RemoveLocation(udg_Tmp_Loc)
-
Set Wheel_Mains[1] = LastCreatedUnit
-
General - Set Tmp_Loc = Center of(Rect2)
-
Unit - Create 1 Whisp For Player1(Red) at Tmp_Loc
-
Custom Script - call RemoveLocation(udg_Tmp_Loc)
-
Unitgroup - Add (Last Created Unit) to Wheel_Parts[1]
-
General - Set Tmp_Loc = Center of(Rect3)
-
Unit - Create 1 Whisp For Player1(Red) at Tmp_Loc
-
Custom Script - call RemoveLocation(udg_Tmp_Loc)
-
Unitgroup - Add (Last Created Unit) to Wheel_Parts[1]
-
General - Set Tmp_Loc = Center of(Rect4)
-
Unit - Create 1 Whisp For Player1(Red) at Tmp_Loc
-
Custom Script - call RemoveLocation(udg_Tmp_Loc)
-
Unitgroup - Add (Last Created Unit) to Wheel_Parts[1]
-
Trigger - Turn WheelChanger on
We also add a Trigger - Turn WheelChanger on at last because we want to enable whisp wheel after starting him.
Back to WheelChanger, we have got 50% so far!
WheelChanger
-
Event: Every 0.01 seconds of the game
-
Condition:
-
Actions:
-
For Loop IndexA from 1 to *YourWheelCountHere* do (mulitply actions)
WheelChanger
-
Event: Every 0.01 seconds of the game
-
Condition:
-
Actions:
-
For Loop IndexA from 1 to *YourWheelCountHere* do (mulitply actions)
-
Cutsom Script - set udg_Tmp_Group = CreateGroup()
-
General - Set Tmp_Group = Wheel_Parts[IntegerA]
-
Unitgroup - Pick every unit in Tmp_Group and do (mutiply actions)
-
Custom Script - call DestroyGroup(udg_Tmp_Group)
Now we talked to every unit iwth the pick each unit command, lets think about that the picked units are parts of the wheel.
WheelChanger
-
Event: Every 0.01 seconds of the game
-
Condition:
-
Actions:
-
For Loop IndexA from 1 to *YourWheelCountHere* do (mulitply actions)
-
General - Set Tmp_Unit = Wheel_Mains[IntegerA]
-
Cutsom Script - set udg_Tmp_Group = CreateGroup()
-
General - Set Tmp_Group = Wheel_Parts[IntegerA]
-
Unitgroup - Pick every unit in Tmp_Group and do (mutiply actions)
-
General - Set Tmp_Unit2 = PickedUnit
-
General - Set Tmp_Loc = Position of (Tmp_Unit2)
-
General - Set Tmp_Real = Angle between Tmp_Loc and Tmp_Loc2
-
General - Set Tmp_Real2 = Distance between Tmp_Loc and Tmp_Loc2
-
Custom Script - call RemoveLocation(udg_Tmp_Loc)
-
Custom Script - call RemoveLocation(udg_Tmp_Loc2)
-
Custom Script - call DestroyGroup(udg_Tmp_Group)
Now because we want it to move we add additionally a few lines of code to move those picked units forwards.
WheelChanger
-
Event: Every 0.01 seconds of the game
-
Condition:
-
Actions:
-
For Loop IndexA from 1 to *YourWheelCountHere* do (mulitply actions)
-
General - Set Tmp_Unit = Wheel_Mains[IntegerA]
-
Cutsom Script - set udg_Tmp_Group = CreateGroup()
-
General - Set Tmp_Group = Wheel_Parts[IntegerA]
-
Unitgroup - Pick every unit in Tmp_Group and do (mutiply actions)
-
General - Set Tmp_Unit2 = PickedUnit
-
General - Set Tmp_Loc = Position of (Tmp_Unit2)
-
General - Set Tmp_Real = Angle between Tmp_Loc and Tmp_Loc2
-
General - Set Tmp_Real2 = Distance between Tmp_Loc and Tmp_Loc2
-
Custom Script - call RemoveLocation(udg_Tmp_Loc)
-
Custom Script - call RemoveLocation(udg_Tmp_Loc2)
-
General - Set Tmp_Real = Tmp_Real + *WHEELSPEED* (something low)
-
General - Set Tmp_Loc = Position of (Tmp_Unit2)
-
General - Set Tmp_Loc2 = Tmp_Loc offset Tmp_Real2 facing Tmp_Real
-
Unit - Move Tmp_unit2 into Tmp_Loc2
-
Custom Script - call RemoveLocation(udg_Tmp_Loc)
-
Custom Script - call RemoveLocation(udg_Tmp_Loc2)
-
Custom Script - call DestroyGroup(udg_Tmp_Group)
Note: I am NOT at home this was just written with head, DO NOT try to copy&paste this stuff!
Last edited: