• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Help~Spawning trigger in Footmen

Status
Not open for further replies.
Level 1
Joined
Jul 19, 2012
Messages
2
Hello. I am making footmen games. I had try to solved sold spawning system becacuse of the delay.

BUT I couldnt solved it.

So, I want updated spawning system for footmen.

Please help me.
 
This goes over unit groups and enumeration and uses the topic of unit spawning to teach those concepts (exactly what you are looking for). It also introduces defeat conditions (what you'll need later on).

http://www.youtube.com/watch?v=je8_AyV3VWs&feature=player_embedded

See my sig for more video tutorials if you are unfamiliar with vjass = ). They can get you up and running in vjass in a couple of hours.

I'm linking you a tutorial rather than providing code because the code is extremely easy.
 
Level 1
Joined
Jul 19, 2012
Messages
2
I used system is this.
------------------------------------------------------------------------------------

function Trig_Spawn_Footmen_Func001Func002001 takes nothing returns boolean
return ( RectContainsUnit(RectFromCenterSizeBJ(GetPlayerStartLocationLoc(GetEnumPlayer()), 384.00, 384.00), GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(GetEnumPlayer(), 'hbar'))) == true )
endfunction

function Trig_Spawn_Footmen_Func001A takes nothing returns nothing
// Barracks -> Footman
if ( Trig_Spawn_Footmen_Func001Func002001() ) then
call CreateNUnitsAtLoc( 1, 'hfoo', GetEnumPlayer(), GetPlayerStartLocationLoc(GetEnumPlayer()), bj_UNIT_FACING )
else
call DoNothing( )
endif
endfunction

function Trig_Spawn_Footmen_Actions takes nothing returns nothing
call ForForce( GetPlayersAll(), function Trig_Spawn_Footmen_Func001A )
endfunction

//===========================================================================
function InitTrig_Spawn_Footmen takes nothing returns nothing
set gg_trg_Spawn_Footmen = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Spawn_Footmen, 8.00 )
call TriggerAddAction( gg_trg_Spawn_Footmen, function Trig_Spawn_Footmen_Actions )
endfunction

--------------------------------------------------------------------------------
is this system have the memory leakage?
 
Status
Not open for further replies.
Top