Author |
Topic: floodspawning in cod2 |
babycop |
|
General Member Since: Feb 18, 2006 Posts: 488 Last: Feb 27, 2010 [view latest posts] |
|
|
Category: CoD2 MP Mapping Posted: Wednesday, Jan. 31, 2007 08:46 pm |
|
hello, i use scripting to make some germans floodspawn...however, it doesn't seem to work...here is my script:
frontline()
{
spawners = getentarray("trench2", "targetname");
for (i=0; i < spawners.size; i++ )
{
// if(isalive(spawners))
{
spawners stalingradspawn();
}
}
}
in radiant, i give them a key: count with a value: 2
they spawn fine, but the second wave never comes...what am i missing...i know that in CODUO there was this extra line: level thread maps\_spawner_gmi::flood_spawn (spawners);
however, cod2 is different and doesn't have that...
help would be appreciated, and my sp map is nearing completion very quickly
thank you
edited on Jan. 31, 2007 03:48 pm by babycop |
|
|
|
babycop |
|
General Member Since: Feb 18, 2006 Posts: 488 Last: Feb 27, 2010 [view latest posts] |
|
|
|
babycop |
|
General Member Since: Feb 18, 2006 Posts: 488 Last: Feb 27, 2010 [view latest posts] |
|
|
|
Snake-nl |
|
General Member Since: May 30, 2004 Posts: 394 Last: Jan 23, 2011 [view latest posts] |
|
|
|
babycop |
|
General Member Since: Feb 18, 2006 Posts: 488 Last: Feb 27, 2010 [view latest posts] |
|
|
|
Yorkshire-Rifles |
General Member Since: Mar 16, 2005 Posts: 272 Last: Apr 19, 2008 [view latest posts] |
|
|
|
babycop |
|
General Member Since: Feb 18, 2006 Posts: 488 Last: Feb 27, 2010 [view latest posts] |
|
|
Category: CoD2 MP Mapping Posted: Tuesday, May. 22, 2007 03:25 am |
|
hmmm....you're totally right...I never thought of putting that line there...if i uncommented if(isalive(spawners)), then there would be an error since the ai hasn't spawned yet and i'm not trying to know if they are dead....so if(isdefined(spawners))
makes perfect sense! However, does that line bring anything useful to that particular script since not having anything there does not bring forth any error whatsoever?(just for personal knowledge)
As for script_forcespawn, I didn't know it had the same effect as stalingradspawn...but i'll keep using it, looks way cooler
Oh and I'm not really doing a new map, I'm doing a campaign for the rise of the resistance expansion pack to COD2..... |
|
|
|
Snake-nl |
|
General Member Since: May 30, 2004 Posts: 394 Last: Jan 23, 2011 [view latest posts] |
|
|
Category: CoD2 MP Mapping Posted: Tuesday, May. 22, 2007 10:06 am |
|
hmm it isn't working. when i shot the german no new spawn will come back.
i placed an actor. checked spawner, give it the targetname wave_1 and connected the actor to a cover node.
then i made a trigger called trwave_1 and connected it to the actor.
i used this script:
Code:
wave_1()
{
spawners = getentarray("wave_1", "targetname");
level thread maps\_spawner::spawnerflood_spawn (spawners);
for (i=0; i < spawners.size; i++ )
{
if(isdefined(spawners))
{
spawners stalingradspawn();
}
}
}
when i load the map i get this error:
array is not an entity: path to my gsc file
spawners stalingradspawn();
what am i doing wrong? |
|
|
|
babycop |
|
General Member Since: Feb 18, 2006 Posts: 488 Last: Feb 27, 2010 [view latest posts] |
|
|
Category: CoD2 MP Mapping Posted: Tuesday, May. 22, 2007 12:15 pm |
|
i think it's because you are using a trigger to spawn the actor but spawning him with the script as well. Try this:
wave_1()
{
trig = getent("trwave_1 ","targetname");
trig waittill("trigger");
spawners = getentarray("wave_1", "targetname");
level thread maps\_spawner::spawnerflood_spawn (spawners);
for (i=0; i < spawners.size; i++ )
{
if(isdefined(spawners))
{
spawners stalingradspawn();
}
}
}
DO NOT CONNECT THE TRIGGER TO THE ACTOR SINCE YOU ARE USING THE SCRIPTED METHOD OF SPAWNING AI.
Also, don't forget to put key: count and value: 3 (for example) for your actors so the script knows how many times an actor will spawn from that ai.
I don't know if you checked it out, but Yorkshire made a tutorial on spawning (for cod and uo) but works for cod2. It explains the different ways of spawning ai (mapped and scripted). In this case, you mixed both by connecting the trigger to the ai while your script was doing the same thing...
Check it out
Here |
|
|
|
WHC_Grassy |
General Member Since: Apr 20, 2005 Posts: 1426 Last: Aug 25, 2007 [view latest posts] |
|
|
|