jig7c
Stop reading me...-statement
- Reaction score
- 123
I need help..
I have created this script.. which is suppose to create a total of 22 wisp...
and move then around in a circle...
not an O circle... but more like a blade ... kinda like
-, /, -, \, -, /, -, \ like two blades of a fan opposite each other..... also like two spokes of a wheel... but of equal length and equal speed
anyways...
here is the script, i'm sure it has tons of errors in it.. can someone help me fix it
what i have done is combine two things into one script, (probably not so smart of me) but local trigger t stuff creates the wisp, and local trigger a makes the wisps move in circle every .03 seconds..
I have created this script.. which is suppose to create a total of 22 wisp...
and move then around in a circle...
not an O circle... but more like a blade ... kinda like
-, /, -, \, -, /, -, \ like two blades of a fan opposite each other..... also like two spokes of a wheel... but of equal length and equal speed
anyways...
here is the script, i'm sure it has tons of errors in it.. can someone help me fix it
what i have done is combine two things into one script, (probably not so smart of me) but local trigger t stuff creates the wisp, and local trigger a makes the wisps move in circle every .03 seconds..
JASS:
scope StartCircle initializer Init
globals
constant integer dummy = 039;e002039; //wisp unit-id
unit array wisp //the actual wisp to be created
constant location l = GetRectCenter(gg_rct_Rect_096) //center of wisp circle
endglobals
private function Cond1 takes nothing returns boolean
return ((GetUnitTypeId(GetTriggerUnit()) == 039;H007039;) or (GetUnitTypeId(GetTriggerUnit()) == 039;H009039;) or (GetUnitTypeId(GetTriggerUnit()) == 039;H008039;) or (GetUnitTypeId(GetTriggerUnit()) == 039;H00A039;) == true)
endfunction
private function levelcheck takes nothing returns boolean
return (udg_Level_Start == true )
endfunction
private function CreateActions takes nothing returns nothing
local integer i = 1 //for the loop
local location l //wisp's starting location
if ( levelcheck ) then
call DisableTrigger( gg_trg_Spin_Wisps )
loop
exitwhen i > 22
if ( i > 11 ) then
set l = PolarProjectionBJ(l, ( 75.00 * (i - 11.00 )), 0)
set wisp<i> = CreateUnitAtLoc(Player(11), dummy, l, 90)
call RemoveLocation(l)
else
set l = PolarProjectionBJ(l, ( 75.00 * i), 0)
set wisp<i> = CreateUnitAtLoc(Player(11), dummy, l, 90)
call RemoveLocation(l)
endif
set i = i + 1
endloop
call EnableTrigger( a ) //error
endif
endfunction
//moving wisp in circle...
private function Actions takes nothing returns nothing
local real angle = 1
local integer wloop = 1
local location wisppoint
set angle = angle + 1.50
loop
exitwhen wloop == 22
if (wloop > 22) then
set wisppoint = PolarProjectionBJ(l, ( 75.00 * ( wloop - 11.00 ) ), angle)
call SetUnitPositionLoc( wisp[wloop], wisppoint )
call RemoveLocation(wisppoint)
else
set wisppoint = PolarProjectionBJ(l, ( 75.00 * wloop ), angle)
call SetUnitPositionLoc( wisp[wloop], wisppoint )
call RemoveLocation(wisppoint)
endif
set wloop = wloop + 1
endloop
call RemoveLocation(l)
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger t = CreateTrigger ()
local trigger a = CreateTrigger ()
call TriggerRegisterEnterRectSimple( t, gg_rct_Block_1_Start_Copy_Copy )
call TriggerAddCondition( t, Condition( function Cond1) )
call TriggerAddAction( t, function CreateActions )
call DisableTrigger( gg_trg_Spin_Wisps_Ice_Copy )
call TriggerRegisterTimerEventPeriodic(a, 0.03 )
call TriggerAddAction(a, function Actions )
endfunction
endscope
</i></i>