Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 38 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 MP Mapping
CoD 2 mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: floodspawning in cod2
babycop
General Member
Since: Feb 18, 2006
Posts: 488
Last: Feb 27, 2010
[view latest posts]
Level 5
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
Share |
babycop
General Member
Since: Feb 18, 2006
Posts: 488
Last: Feb 27, 2010
[view latest posts]
Level 5
Category: CoD2 MP Mapping
Posted: Wednesday, Jan. 31, 2007 09:59 pm
now my script is like this:

flak_rushers()
{

spawners = getentarray("flak_rushers", "targetname");
level thread maps\_loopspawn::loop_spawner (spawners);
for (i=0; i < spawners.size; i++ )
{
// if(isalive(spawners))
{
spawners stalingradspawn();
}
}
}

and i get this error message:

******* script runtime error *******
potential infinite loop in script: (file 'maps/_loopspawn.gsc', line 221)
for (i = 0; i < aeSpawners.size; i++)
*
called from:
(file 'maps/_loopspawn.gsc', line 109)
aeSpawners = loop_spawner_sort (aeSpawners);
*
called from:
(file 'maps/leningrad.gsc', line 366)
level thread maps\_loopspawn::loop_spawner (spawners);
*
called from:
(file 'maps/leningrad.gsc', line 544)
thread flak_rushers();
*
started from:
(file 'maps/leningrad.gsc', line 543)
wait(2);
*
************************************

any idea anyone on how to write it down correctly....
Share |
babycop
General Member
Since: Feb 18, 2006
Posts: 488
Last: Feb 27, 2010
[view latest posts]
Level 5
Category: CoD2 MP Mapping
Posted: Wednesday, Jan. 31, 2007 10:33 pm
i did it!

heres the script now

flak_rushers()
{

spawners = getentarray("flak_rushers", "targetname");
level thread maps\_spawner::spawnerflood_spawn (spawners);
for (i=0; i < spawners.size; i++ )
{
// if(isalive(spawners))
{
spawners stalingradspawn();
}
}
}
Share |
Snake-nl
General Member
Since: May 30, 2004
Posts: 394
Last: Jan 23, 2011
[view latest posts]
Level 5
Category: CoD2 MP Mapping
Posted: Monday, May. 21, 2007 07:18 pm
could you explain how you did the radiant part of this to get it working?

I also need germans that keeps spawning when the first wave died.
Share |
babycop
General Member
Since: Feb 18, 2006
Posts: 488
Last: Feb 27, 2010
[view latest posts]
Level 5
Category: CoD2 MP Mapping
Posted: Monday, May. 21, 2007 10:21 pm
all u gotta do is put german spawners in your map that all have the same targetname (in this case, flak_rushers). Make sure you check the box that says spawner. Target each german to a node. For each german, put in:

key: count
value: the total number of germans that will spawn from this actor every time it dies.

this line in the script: level thread maps\_spawner::spawnerflood_spawn (spawners); makes your germans floodspawn.

That's all.
Share |
Yorkshire-Rifles
General Member
Since: Mar 16, 2005
Posts: 272
Last: Apr 19, 2008
[view latest posts]
Level 5
Category: CoD2 MP Mapping
Posted: Tuesday, May. 22, 2007 03:08 am
Babycop, try swapping the bit which isn't getting read by the script,

// if(isalive(spawners))

for

if(isdefined(spawners))

which I think is the proper way of doing it. So if you don't have to check that the entitiy/entities are alive (like when they haven't spawned yet), then it still checks that they exist at all.

Just to mention, but you've probably already noticed, script_stalingradspawn as a key on a actor/spawner has been changed to script_forcespawn, but stalingradspawn is still fine for scripting. Guess they just wanted to change the key's name!

Anyhow, hope your new map is coming on good.
Share |
babycop
General Member
Since: Feb 18, 2006
Posts: 488
Last: Feb 27, 2010
[view latest posts]
Level 5
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 [lol]

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.....[cool]
Share |
Snake-nl
General Member
Since: May 30, 2004
Posts: 394
Last: Jan 23, 2011
[view latest posts]
Level 5
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?
Share |
babycop
General Member
Since: Feb 18, 2006
Posts: 488
Last: Feb 27, 2010
[view latest posts]
Level 5
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
Share |
WHC_Grassy
General Member
Since: Apr 20, 2005
Posts: 1426
Last: Aug 25, 2007
[view latest posts]
Level 8
Category: CoD2 MP Mapping
Posted: Tuesday, May. 22, 2007 01:24 pm
Because you are using an array shouldn't you need to add the array value to the spawner in the for loop?


Code:
wave_1()
{
trig = getent("trwave_1 ","targetname");
trig waittill("trigger");
spawners = getentarray("wave_1", "targetname");
 if(isDefined(spawners)
 {
  level thread maps\_spawner::spawnerflood_spawn (spawners);
    for (i=0; i < spawners.size; i++ )
    {
       spawners[i] stalingradspawn();
    }
 }
}
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 MP Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»