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

Members Online

»
0 Active | 10 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

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 SP Mapping
Call of Duty 2 single player mapping, scripting and everything single player.
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: [TUT] Friendly Waves
Yorkshire-Rifles
General Member
Since: Mar 16, 2005
Posts: 272
Last: Apr 19, 2008
[view latest posts]
Level 5
Category: CoD2 SP Mapping
Posted: Monday, Apr. 16, 2007 02:11 am
Friendly waves - respawning your friendly chain guys.

So, you've made an SP map, got your friendly AI on the friendly chain for movement, but they dwindle in number cos they keep getting killed as you play through your level.

Here's how to respawn them so you always have friendly AI helping.

If you haven't read the tutorials on friendly_chains and general AI usage - do that first.
-----------------

Make a trigger multiple give it a "TARGETNAME" of "friendly_wave".

Place a few friendly actors where you would like them to respawn. Check their SPAWNERS box in entity info.

Select the "friendly_wave" trigger and connect it to your spawners. (not the other way round). Select the spawners and connect them to the player_info_start, like you would with normal actors on a friendly chain.

And that's about it.

The default number of respawners for a friendly_wave is 7. So if you want another number, you'll have to script it.

Code:
#include maps\_utility;

#include maps\_anim;


main()
{
maps\_load::main();

level.maxfriendlies = 6;
}


That easy. When you hit the trigger, the new AI will spawn and join your friendly chain - so make sure you have enough nodes for all of them.

You can also change the number of AI that respawn with a trigger and script. So if you call a trigger_multiple "maxmen", then use this bit of code to change the number of respawners to 3.

Code:
max2()
{
maxmentrig=getent("maxmen", "targetname");
maxmentrig waittill("trigger");

	level.maxfriendlies = 3;

}


It's important to note that just because you have less respawning friendly AI on your friendly chain, doesn't mean that you get rid of the original 6. They'll still be there, but won't respawn until the number of AI drop under 3.

Once you have a working friendly_wave trigger, make others and put them throughout your map, that way your AI won't have so far to run when they respawn. The last friendly_wave trigger the player touches is the one in use.

It's also important to remember that the respawners on your friendly chain are spawners. If you want them to do funky things in script it's best to give them a script_noteworthy value as targetname won't always work (as it doesn't with standard spawners).

For instance, if you want to kill them all with script. Give your friendly AI a script_noteworthy with a value of 1 (or anything you like). Make a trigger_multiple and call it doom1.

Code:
doom1()
{
doom1trig=getent("death1", "targetname");
doom1trig waittill("trigger");

	dead1 = getentarray("1","script_noteworthy");
	for(i=0;i<dead1.size;i++)
	{
		dead1[i] dodamage(dead1[i].health + 1, (0,0,0));
	}
}


When the player hits the trigger the AI die, and then you can watch them respawn from the last friendly_wave trigger you walked through. They'll run up and rejoin your friendly_chain.

Never again will you run out of friends in battle!

[thumbs_up]
Share |
SparkyMcSparks
General Member
Since: Feb 28, 2004
Posts: 1713
Last: Dec 29, 2016
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD2 SP Mapping
Posted: Monday, Apr. 16, 2007 03:48 am
Good tut, could have been written in a paragraph but meh. [crazy]

If you don't want a friendly to be part of the friendly_wave system, set script_nofriendlywave to 1 on the ai and/or spawner in radiant.
Share |
Yorkshire-Rifles
General Member
Since: Mar 16, 2005
Posts: 272
Last: Apr 19, 2008
[view latest posts]
Level 5
Category: CoD2 SP Mapping
Posted: Monday, Apr. 16, 2007 12:18 pm
Idiot Proof Tutorials don't condense into one paragraph [casanova]

Good reminder about the script_nofriendlywave.
Share |
All-Killer
General Member
Since: May 26, 2006
Posts: 140
Last: Nov 23, 2008
[view latest posts]
Level 4
Category: CoD2 SP Mapping
Posted: Monday, Apr. 16, 2007 01:31 pm
Nice tutorial, defently going to use it in the future.
Share |
SparkyMcSparks
General Member
Since: Feb 28, 2004
Posts: 1713
Last: Dec 29, 2016
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD2 SP Mapping
Posted: Monday, Apr. 16, 2007 04:10 pm
The tutorial has a bad part to it. [duh]
-- You don't need to connect the spawners to the info_player start, the _spawners utility file does that for you. Heh, someone didn't read how the code works. [lol]
Share |
Yorkshire-Rifles
General Member
Since: Mar 16, 2005
Posts: 272
Last: Apr 19, 2008
[view latest posts]
Level 5
Category: CoD2 SP Mapping
Posted: Monday, Apr. 16, 2007 06:48 pm
Yep, you don't need to connect the spawners to the player. I didn't even do that in my practise map.

The old grey matter is deteriorating with age! [crazy]
Share |
All-Killer
General Member
Since: May 26, 2006
Posts: 140
Last: Nov 23, 2008
[view latest posts]
Level 4
Category: CoD2 SP Mapping
Posted: Tuesday, Apr. 17, 2007 11:31 am
Hehehe, sparks is to smart. But it would work also on this way so. Maby add it to it as a side note.
Share |
babycop
General Member
Since: Feb 18, 2006
Posts: 488
Last: Feb 27, 2010
[view latest posts]
Level 5
Category: CoD2 SP Mapping
Posted: Tuesday, Apr. 17, 2007 12:57 pm
i've always wondered how i could put spawners to be part of a friendly chain...thanks yorkshire![biggrin]
Share |
Ace008
General Member
Since: Jul 22, 2005
Posts: 738
Last: Jan 3, 2009
[view latest posts]
Level 6
Category: CoD2 SP Mapping
Posted: Sunday, Apr. 22, 2007 10:04 pm
Nice job York, I will have to use this with my next SP map. By the way I am glad to still see you around here[wave]!
Share |
Yorkshire-Rifles
General Member
Since: Mar 16, 2005
Posts: 272
Last: Apr 19, 2008
[view latest posts]
Level 5
Category: CoD2 SP Mapping
Posted: Monday, Apr. 23, 2007 12:36 am
Ace, after saying that I wasn't doing any more SP mapping for COD ---- well, I am doing one more for COD2! [lol]
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 SP 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

»