Multiple Spinning Units

Tyman2007

Ya Rly >.
Reaction score
74
I am currently designing a spell which creates a circle of yellow wisps, then makes them circle around for a bit, then each of them move and form a cross around the user. Then they float up and form the same cross but verticle above the caster. Then calls down some neat special effects and converts units to aid the caster for 2 minutes and then die.

What i am trying to figure out is how to make the units circle around the caster.

Since i am still learning JASS i am not yet at the stage to read Spell scripts. So please post the solution using GUI if you will.

-Tyman2007.
New Forum User

Edit: I almost forgot, here is the trigger which initializes this whole process. At the bottom there i tried to make it work but it didnt..

Code:
Holy Cross Part 1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Holy Cross
    Actions
        Set CastUnit = (Triggering unit)
        Set Degrees = 0.00
        Set integer = 0
        Set Offset = 100.00
        Set CastPos = (Position of (Triggering unit))
        Set SpinDeg = 0.00
        For each (Integer A) from 1 to 15, do (Actions)
            Loop - Actions
                Unit - Create 1 Peasant for (Owner of (Triggering unit)) at (CastPos offset by 500.00 towards Degrees degrees) facing Default building facing degrees
                Set HolyBall[(Integer A)] = (Last created unit)
                Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
                Set Degrees = (Degrees + 24.00)
                Special Effect - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Other\Awaken\Awaken.mdl
                Special Effect - Destroy (Last created special effect)
        Set Degrees = 12.00
        For each (Integer A) from 16 to 30, do (Actions)
            Loop - Actions
                Unit - Create 1 Peasant for (Owner of (Triggering unit)) at (CastPos offset by 500.00 towards Degrees degrees) facing Default building facing degrees
                Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
                Set HolyBall[(Integer A)] = (Last created unit)
                Set Degrees = (Degrees + 24.00)
                Special Effect - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Other\Awaken\Awaken.mdl
                Special Effect - Destroy (Last created special effect)
        Custom script:   call RemoveLocation(udg_CastPos)
        For each (Integer A) from 1 to 30, do (Actions)
            Loop - Actions
                Set SpinReal[(Integer A)] = SpinDeg
                Set SpinDeg = (SpinDeg + 12.00)
 

Somatic

You can change this now in User CP.
Reaction score
84
Here
Here
Here

Being a new user means reading part of the rule, try using "Search" function next time on the forum. What your asking for is close to a Wisp Wheel.

Enjoy and welcome.
~Somatic
 

Azylaminaz

Vox Populi
Reaction score
91
If you want a "spin" and want a single trigger, you would need to use waits in a loop, should be pretty easy. I've been told waits work in Integer loops.

If you want it to spin like... 360 degrees in three seconds, just do integer loop 1-120 changing the degree from center by doing set degrees + Integer * 3.
 

vypur85

Hibernate
Reaction score
803
You still need periodic trigger to achieve what you want. Using waits won't be appropriate even though they work in loops. Waits are not accurate when it comes to low values. That is why people don't use integer loops to create sliding movement. Use the links that Somatic provided. They should help.
 

vypur85

Hibernate
Reaction score
803
Any waits at all :p. Unfortunately. To create a smooth sliding movement, the periodic timer usually used is less than 0.1 second (I'd personally use at most 0.03 second).
 

Tyman2007

Ya Rly >.
Reaction score
74
Thanks for all your guy's help. And i have tried those 3 tutorials. They just arent working out for me. The 2nd one was probably the most useful but it didn't work. When i follow a tutorial i do it exactly how the person did it.

Basically the 2nd tutorial didnt work. The units stayed in one spot not moving.. even modifying the degrees they would spin around didnt work.

Trigger 1:
Code:
Holy Cross Part 1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Holy Cross
    Actions
        Set CastUnit = (Triggering unit)
        Set Degrees = 0.00
        Set integer = 0
        Set Offset = 100.00
        Set CastPos = (Position of (Triggering unit))
        Set SpinDeg = 0.00
        Set NumberOfUnits = 30
        Set Points[NumberOfUnits] = (Center of No region)
        Set StartingAngle = (360.00 / (Real(NumberOfUnits)))
        Set Distance = 400.00
        For each (Integer A) from 1 to 15, do (Actions)
            Loop - Actions
                Unit - Create 1 Peasant for (Owner of (Triggering unit)) at (CastPos offset by 500.00 towards Degrees degrees) facing Default building facing degrees
                Set HolyBall[(Integer A)] = (Last created unit)
                Set Points[(Integer A)] = (Position of HolyBall[(Integer A)])
                Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
                Set Degrees = (Degrees + 24.00)
                Special Effect - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Other\Awaken\Awaken.mdl
                Special Effect - Destroy (Last created special effect)
        Set Degrees = 12.00
        For each (Integer A) from 16 to 30, do (Actions)
            Loop - Actions
                Unit - Create 1 Peasant for (Owner of (Triggering unit)) at (CastPos offset by 500.00 towards Degrees degrees) facing Default building facing degrees
                Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
                Set HolyBall[(Integer A)] = (Last created unit)
                Set Points[(Integer A)] = (Position of HolyBall[(Integer A)])
                Set Degrees = (Degrees + 24.00)
                Special Effect - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Other\Awaken\Awaken.mdl
                Special Effect - Destroy (Last created special effect)
        Custom script:   call RemoveLocation(udg_CastPos)
        Set Offset = 500.00
        Set Degrees = 0.00
        Trigger - Turn on Holy Cross Part 2 <gen>
        Wait 10.00 seconds
        Set NumberOfUnits = 15
        Wait 5.00 seconds
        Trigger - Turn off Holy Cross Part 2 <gen>

Trigger 2: (Initially Off)
Code:
Holy Cross Part 2
    Events
        Time - Every 0.03 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to NumberOfUnits, do (Actions)
            Loop - Actions
                Set Points[(Integer A)] = (Position of HolyBall[(Integer A)])
                Set ChangingDistance = (Distance between CastPos and (Position of HolyBall[(Integer A)]))
                Set Angle = (Angle from CastPos to (Position of HolyBall[(Integer A)]))
                Set Angle = (Angle + 3.00)
                Set ChangingDistance = (ChangingDistance + 3.00)
                Set Destination[(Integer A)] = (CastPos offset by ChangingDistance towards Angle degrees)
                Set Points[(Integer A)] = Destination[(Integer A)]
                Custom script:   call RemoveLocation(udg_Destination[bj_forLoopAIndex])
                Unit - Move HolyBall[(Integer A)] instantly to Points[(Integer A)]
                Custom script:   call RemoveLocation(udg_Points[GetForLoopIndexA()])

Basically i just want a quick solution to this.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top