spawning woes

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

spawning woes

Post by lizardkid »

okay, so i've followed the tut about spawning to the letter, i've put in a trigger_multiple with key/values of
#set - 200
cnt - 1 (i want this two, is that okay?)
$targetname - enemyspawnertrigger

and i've put in five guys i want to spawn, all enemyspawner, all #set 200, all #group 1, i have the pathnode with the name enemyspawnerdestination
and they all have lines pointing right at it.

but it doesn't work, they just turn up like normal AI. :shock:
i've never had reason to not just use the all_ai_off and ai_on command using scripting before but this level is larger than usual and i need guys to just spawn and appear. do i need to use hide with ai_off?
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Did you put exec global/ai.scr at the top of your level.script ? Haveing too many ai's turned off and hidden will also cause you problems if you have too many you may need to spawn some of them from script like some people do with stock maps .
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

aha!

Post by lizardkid »

yes, i put the exec global/ai.scr up there, the stock map suggestion (which i might add also works in the console :twisted: ) about using the spawn command worked. thanx bdbodger!
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

I still don't know why the global/ai.scr is not working for you but there is another way too and that is to do the spawning yourself useing the global/spawner.scr . I think the global/ai.scr uses this script too . Here is an example of it

level.enemy2 = exec global/makearray.scr $enemy2

for (local.i=1;local.i <= level.enemy2.size;local.i++)
level.enemy2[local.i] = waitthread global/spawner.scr::spawner_create level.enemy2[local.i]


then later when you want them to spawn

for (local.i=1;local.i <= level.enemy2.size;local.i++)
level.enemy2[local.i] = waitthread global/spawner.scr::spawner_activate level.enemy2[local.i]

or I also do this

allies_spawn:
level.allies = 0
while(1)
{
wait 4
if(level.allies < 6)
{
local.spot = randomint($friendly_spawn.size)+1
local.allies_spawner = spawn human/allied_airborne_soldier.tik origin $friendly_spawn[local.spot].origin targetname "friend"
local.allies_spawner exec global/disable_ai.scr
local.allies_spawner runto $flak_node
level.allies++
local.allies_spawner thread healthcheck
wait 2
local.allies_spawner exec global/enable_ai.scr
}}
end

healthcheck:
while(isalive self)
waitframe
level.allies--
end
Image
Post Reply