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

Members Online

»
0 Active | 64 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
Previous Page Next Page
subscribe
Author Topic: floodspawning in cod2
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 01:37 pm
ì get a bad syntax error on line 82:

this is my line 82
Code:
{


the part after: if(isDefined(spawners)
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 02:34 pm
Okay um..try this first, and then if it doesn't work, we will figure it out:

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++ )
{
spawners stalingradspawn();
}
}

so maybe if we totally forgot about the if(isDefined(spawners), we can make it work..

To Grassy, since my deafault script works and doesn't have any of those if(isDefined(spawners) or if(isAlive(spawners) lines, I'm simply guessing those are unecessary to spawn the ai...As for the array value, it sounds right, but writing it this way works fine:

flak_rushers()
{

spawners = getentarray("flak_rushers", "targetname");
level thread maps\_spawner::spawnerflood_spawn (spawners);
for (i=0; i < spawners.size; i++ )
{
spawners stalingradspawn();
}
}

This is getting complicated since sometimes i don't understand the code [crazy]
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 04:55 pm
Babycop - as Grassy said you've missed the index count on the number of spawners. That's the letter i in brackets.
Code:

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[i].size; i++ )
{
if(isDefined(spawners[i])
{
spawners[i] stalingradspawn();
}
}

}


To Snake-NL, you said:

Quote:
when i shot the german no new spawn will come back.


if you're using only one axis AI to respawn, then you don't need a getentarray, just a getent.

Code:

wave_1()
{

trig = getent("trwave_1 ","targetname");
trig waittill("trigger");

spawner = getent("wave_1", "targetname");
level thread maps\_spawner::spawnerflood_spawn (spawner);
spawner stalingradspawn();

}


Hope this helps, but I haven't tested it.

AND of course remember to give your AI a "count" or you'll only get one spawn!

edited on May. 22, 2007 12:56 pm by Yorkshire-Rifles
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 05:15 pm
Oops...that's what grassy meant...thanks...I didn't notice the typo

edited on May. 22, 2007 01:15 pm by babycop
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 05:17 pm
i have 8 germans that spawn behind a wall and need to run to the cover nodes when the player hits the trigger.

After 1 german (or more) get killed the need to spawn again and run to the nodes again.

I have given them the count of 3.

and what exactly means: getentarray? or what does it do?
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 05:37 pm
getent is for a single actor. It means get the entity that has ("wave_1", "targetname"); for example.

If there is more than one ai (or entity), then you have to use the script command getentarray. It tells the script to get an array of entities with the targetname of wave_1.

In that case, you have to use this command since there is more than one entity.

for (i=0; i < spawners[ i ].size; i++ )

and not forget to put that [ i ] after spawners cuz there's more than one of them.

spawners[ i ] stalingradspawn();


Is the script working by the way?

**Note that there shouldn't be spaces in the brackets containing the ''i''. I had to put them or it didn't show up in this thread since it only put my writing in italic (thus the reason i had a typo before)
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 05:45 pm
still a bad syntax error [banghead] line 87

Code:

******* script compile error *******
bad syntax : (file 'maps/testsp.gsc' , line 87)
{
*
*****************************
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 06:16 pm
post your script so we can help
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 06:18 pm
Code:

#include maps\_utility;

#include maps\_anim;

#using_animtree("generic_human");

main()
{
    precacheModel("xmodel/vehicle_stuka_flying");
	
	maps\_stuka::main("xmodel/vehicle_stuka_flying");
	maps\_flak88::main("xmodel/german_artillery_flak88_nm");
	maps\_load::main();

    thread setup_player();
	thread plane();
    thread squad_setup();
	thread wave_1();
}

setup_player()
{
    level.player takeallweapons();
    level.player giveWeapon("m1garand");
    level.player giveWeapon("colt");
    level.player giveWeapon("fraggrenade");
    level.player switchToWeapon("m1garand");
}

plane()
{
	plane = getent ( "stuka","targetname");
	path = getVehicleNode (plane.target,"targetname");
	plane attachpath(path);
	plane startPath();
	plane playsound ("stuka");
}


// SQUAD SETUP
squad_setup()
{
    trigger = getent( "squadtrigger", "targetname" );
    trigger waittill( "trigger" );
    squad_goal( "squad1", "squad1_node" );
	squad_goal( "squad2", "squad2_node" ); //nieuw
}

squad_goal( squad_name, node_name )
{
    squad = getentarray( squad_name, "targetname" );
    node = getnode( node_name, "targetname" );
    for ( i=0; i<squad.size; i++ )
    {
        squad[i] notify("stop updating goalpos");
        squad[i] setgoalnode( node );
        squad[i].goalradius = node.radius;
    }
	
	trigger = getent("1etrigger", "targetname");
	trigger waittill ("trigger");
	
	squad thread tweederun( "2estop" );
	squad thread tweederun( "2estop_sq2" ); // nieuw, noem de node zo voor sq. 2
}

tweederun( node_name )
{
	node = getnode( node_name, "targetname" );
	for ( i=0; i<self.size; i++ )
	{
		self[i] notify("stop updating goalpos");
		self[i] setgoalnode( node );	
		self[i].goalradius = node.radius;	
	}
}

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[i].size; i++ )
{
if(isDefined(spawners[i])
{
spawners[i] stalingradspawn();
}
}

}
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 06:31 pm
I don't see anything wrong, but try tihs, I took away the if(isDefined(spawners) :

Snake-nl writes...
Quote:
Code:


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[i].size; i++ )
{
spawners[i] stalingradspawn();
}
}
Share |
Restricted Access Topic is Locked
Page
Previous 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

»