| 03-05-2003, 12:30 PM | #1 |
ok i need to know to do a trggier like i cube defnese, which you creat 1 unit at a time to move to the location, not like creat 10 units at a time but 1, that means, creat 1 unit for 10 times to move to a single locaotoin, any help?? thx |
| 03-05-2003, 01:44 PM | #2 |
do u mean create 1 unit 10 times per round emote_confused because thats ones ez. all u gotta do is set a variable that knows when its the round and store all of the units and rounds in an array. I dont have my editor here with me so ill help ya later. and explain some more ://// |
| 03-05-2003, 03:48 PM | #3 |
Are you tring to create 1 unit, up to X units, every Y seconds at the beginig of a round? Just to warn you, that will require custom text. Varraibles: unit-type array Types[] //stores units to be created. (set up on init) integer MaxIndex //stores max index used (set up on init) integer array MaxCreate[] //stores max number of units to create (set up on init) integer Level //current level (index to be used) (change every level) integer CreateCount //used by trigger (set to 0) timer WaitInterval //used by trigger when you need to start creating units just call this trigger via the Trigger-RunTrigger(...) (ignoring conditions) action Code:
function Trig_BeginSpawn_Actions takes nothing returns nothing
// this is assuming you want to create 10 of the same unit
// replace <spawn region> with the region you want to have them spawn at
// replace <spawn player> with the player that is to own the units
// replace <move region> with the region that you want them to move to
call CreateNUnitsAtLoc( 1, udg_Types[udg_Level], <spawn player>, GetRectCenter(<spawn region>), 0 )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", GetRectCenter(<move region>) )
set udg_CreateCount = udg_CreateCount + 1
if(udg_CreateCount == udg_MaxCreate) then
set udg_CreateCount = 0
return
endif
// change this to speed up or slow down how fast they are created
call StartTimerBJ( udg_WaitInterval, false, 1 )
endfunction
//===========================================================================
function InitTrig_BeginSpawn takes nothing returns nothing
set gg_trg_BeginSpawn = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_BeginSpawn, udg_WaitInterval )
call TriggerAddAction( gg_trg_BeginSpawn, function Trig_BeginSpawn_Actions )
endfunction
|
| 03-06-2003, 01:47 AM | #4 |
This would be a very long trigg for me to wright out ://// so i would suggest just going with mar sara cause i been working like 30 min on this "idea" but i can and i got some home work to do... And im lazy ://// :D |
| 03-06-2003, 02:14 AM | #5 |
y dont u just look at the cube defence triggers? unleas it is protected. |
