- Joined
- Jan 29, 2010
- Messages
- 213
WorldEditor calculation error or mine...
_______________________________________________________________________________________
Hi all, so I have totally messed up here!
I tried to fix it sitting about 4hours, but I can't find any clue...
The skill has to start spining from 1 to 10 pheonix around hero, but the range is leaking... It seems like I done mistakes by calculating distance or angle.
So here's triggers (I hope you'll be able to help me :/):
Dowload: randomskills.w3x
For single player (Player1(Red)) It works properly...
Here's the triggers:
Dowload: randomskills(p1).w3x (single player)
_______________________________________________________________________________________
Hi all, so I have totally messed up here!
I tried to fix it sitting about 4hours, but I can't find any clue...
The skill has to start spining from 1 to 10 pheonix around hero, but the range is leaking... It seems like I done mistakes by calculating distance or angle.
So here's triggers (I hope you'll be able to help me :/):
-
spin1
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- ((Ability being cast) Equal to Spin[1] ) and (time[(Player number of (Owner of (Casting unit)))] Equal to 0)
-
Actions
- Set caster[(Player number of (Owner of (Casting unit)))] = (Casting unit)
- Set count[(Player number of (Owner of (Casting unit)))] = (Random integer number between 1 and 10)
- Set angle[(10 x (Player number of (Owner of (Casting unit))))] = (360 / count[(Player number of (Owner of (Casting unit)))])
- Set time[(Player number of (Owner of (Casting unit)))] = 200
-
For each (Integer A) from (10 x (Player number of (Owner of (Casting unit)))) to ((10 x (Player number of (Owner of (Casting unit)))) + count[(Player number of (Owner of (Casting unit)))]), do (Actions)
-
Loop - Actions
- Unit - Create 1 Peasant for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
- Set bird[(Integer A)] = (Last created unit)
- Set angle[(Integer A)] = (angle[(10 x (Player number of (Owner of (Casting unit))))] x angle[(10 x (Player number of (Owner of (Casting unit))))])
-
Loop - Actions
- Trigger - Turn on spin1moving <gen>
-
Events
-
spin1moving
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
- Set counitingskills[1] = 0
-
For each (Integer B) from 1 to 8, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- time[(Integer B)] Equal to 0
-
Then - Actions
- Set counitingskills[1] = (counitingskills[1] + 1)
-
Else - Actions
- Set time[(Integer B)] = (time[(Integer B)] - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- time[(Integer B)] Equal to 0
-
Then - Actions
-
For each (Integer A) from (10 x (Integer B)) to ((10 x (Integer B)) + count[(Integer B)]), do (Actions)
-
Loop - Actions
- Unit - Remove bird[(Integer A)] from the game
- Set distance[(Integer A)] = 0
- Set angle[(Integer A)] = 0
-
Loop - Actions
- Set caster[(Integer A)] = No unit
-
For each (Integer A) from (10 x (Integer B)) to ((10 x (Integer B)) + count[(Integer B)]), do (Actions)
-
Else - Actions
-
For each (Integer A) from (10 x (Integer B)) to ((10 x (Integer B)) + count[(Integer B)]), do (Actions)
-
Loop - Actions
- Set distance[(Integer A)] = (distance[(Integer A)] + 5)
- Set angle[(Integer A)] = (angle[(Integer A)] + 5)
- Unit - Move bird[(Integer A)] instantly to ((Position of caster[(Integer B)]) offset by (Real(angle[(Integer A)])) towards (Real(distance[(Integer A)])) degrees)
-
Loop - Actions
-
For each (Integer A) from (10 x (Integer B)) to ((10 x (Integer B)) + count[(Integer B)]), do (Actions)
-
If - Conditions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- counitingskills[1] Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
-
Events
||||||||||For player1||||||||||
Spin1 (trigger)
set Caster[1] = casting unit
set Count[1] = random 1-10 (let's say 10)
set Angle[10] = 360 / count[1] (360/10=36*)
for IntA = 10-20
Unit Create U 1 for [p1] at [caster]
set Bird[10-20] = [LastCUnit]
set Ang[10-20] = 10xangle[10] (10*36=360)
------------------------------
Spin1moving (trigger)
for IntB = 1
for IntA = 10 to 20
set Dis[10-20] = +5
set Ang[10-20] = +5
Unit move Bird[10-20] inst to Cater[1] off [Angle] towards [Distance]
Spin1 (trigger)
set Caster[1] = casting unit
set Count[1] = random 1-10 (let's say 10)
set Angle[10] = 360 / count[1] (360/10=36*)
for IntA = 10-20
Unit Create U 1 for [p1] at [caster]
set Bird[10-20] = [LastCUnit]
set Ang[10-20] = 10xangle[10] (10*36=360)
------------------------------
Spin1moving (trigger)
for IntB = 1
for IntA = 10 to 20
set Dis[10-20] = +5
set Ang[10-20] = +5
Unit move Bird[10-20] inst to Cater[1] off [Angle] towards [Distance]
Dowload: randomskills.w3x
For single player (Player1(Red)) It works properly...
Here's the triggers:
- spin1
-
spin1
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- ((Ability being cast) Equal to Spin[1] ) and (time Equal to 0)
-
Actions
- Set caster = (Casting unit)
- Set count = (Random integer number between 1 and 10)
- Set angle[1] = (360 / count)
- Set time = 200
-
For each (Integer A) from 1 to count, do (Actions)
-
Loop - Actions
- Unit - Create 1 Peasant for Player 1 (Red) at (Position of caster) facing Default building facing degrees
- Set bird[(Integer A)] = (Last created unit)
- Set angle[(Integer A)] = (angle[1] x (Integer A))
-
Loop - Actions
- Trigger - Turn on spin1moving <gen>
-
Events
- spin1moving
-
spin1moving
-
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
- time Equal to 0
-
Then - Actions
-
For each (Integer A) from 1 to count, do (Actions)
-
Loop - Actions
- Unit - Remove bird[(Integer A)] from the game
- Set distance[(Integer A)] = 0
- Set angle[(Integer A)] = 0
-
Loop - Actions
- Set caster = No unit
- Trigger - Turn off (This trigger)
-
For each (Integer A) from 1 to count, do (Actions)
-
Else - Actions
- Set time = (time - 1)
-
For each (Integer A) from 1 to count, do (Actions)
-
Loop - Actions
- Set distance[(Integer A)] = (distance[(Integer A)] + 5)
- Set angle[(Integer A)] = (angle[(Integer A)] + 5)
- Unit - Move bird[(Integer A)] instantly to ((Position of caster) offset by (Real(distance[(Integer A)])) towards (Real(angle[(Integer A)])) degrees)
-
Loop - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
Last edited: