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

Members Online

»
0 Active | 8 Guests
Online:

LATEST FORUM THREADS

»
Rainbow HELP....
CoD4 MP Mapping
water
CoD4 MP Mapping
help pls
CoD2 Scripting

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, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: Kill many enemies as an objective
galentv
General Member
Since: Oct 25, 2008
Posts: 59
Last: Aug 1, 2011
[view latest posts]
Level 3
Category: CoD2 SP Mapping
Posted: Thursday, Jan. 29, 2009 01:52 am
I want to make an objective for my map that says "clear out this floor" but i've checked many tutorials and dont know how to do. What shall i do?

Also, whn i lose the game, the game crashes. I've checked tutorials for that and i have maps_load::main in my gsc (its something like that)

So what to do? Also how do i make an objective where it says for example "Take out the incomming armor [3 remaining]

?
Share |
tomalla
General Member
Since: Jan 16, 2007
Posts: 393
Last: Jun 10, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 SP Mapping
Posted: Thursday, Jan. 29, 2009 01:14 pm
1. The easiest way is putting there SPAWNER actors and spawn them in certain moment, or make them NONSPAWERS, if that building will not be visited anytime before that objective.

Version with SPAWNERS: make as many germans as you want, and give them, to every of them, following key/value: "script_noteworthy" "floor_german_spawn" ; and tick the "SPAWNER" checkbox. Connect them ( by "target">"targetname" ) to the nodes you want them to move after they'll spawn. Don't forget about pathnodes! Now, code:

Code:

main()
{
	\\ ...
	obj1();
}

obj1()
{
	objective_add(1,"active","Clear first floor!", < ORIGIN OF OBJECTIVE > );
	floor_spawners = getentarray("floor_german_spawn","script_noteworthy");
	floor_spawned = [];
	for(i=0;i < floor_spawners.size;i++)
		floor_spawned[floor_spawned.size] = floor_spawners[i] dospawn();
	for(i=0;i < floor_spawned.size;i++)
		while(IsAlive(floor_spawned[i]))
			wait(0.1);
	objective_state(1,"done");
}


If you want make actors NONSPAWNERS, tick OFF SPAWNER checkbox. Then, your script would change following:

Code:

main()
{
	\\ ...
	obj1();
}

obj1()
{
	objective_add(1,"current","Clear first floor!",(100,100,100));
	floor_germans = getentarray("floor_german_spawn","script_noteworthy");
	
	for(i=0;i < floor_germans.size;i++)
		while(IsAlive(floor_spawned[i]))
			wait(0.1);
	objective_state(1,"done");
}


==========================================

2. First of all, what do you mean by "crash"? Try to run your map in "developer" mode and post here your error log here ( from console ). Also, you may post here your *.gsc script as well.

==========================================

3. You have to create ( if you didn't already ) a new localizedstrings folder ( in your CoD2/main directory ) and create there "yourmapname.str" file. Put there following text:

Code:

REFERENCE           TAKEOUT_ARMOR
LANG_ENGLISH        "Take out incoming armor! [&&1 remaining]"

ENDMARKER


Now - script part. Here is simple example of creating those objectives:

Code:

objective_add(1,"active");
objective_string(1,&"YOURMAPNAME_TAKEOUT_ARMOR", < NUMBER >);


... and thats all. Replace < NUMBER > with value you want have in your objective. When you will want to change it, just rewrite objective_string line, but with different < NUMBER > value. [thumbs_up]

I hope it will help ya. If not - go ahead and all questions - ask here [wave]

Regards, Tomalla
Share |
galentv
General Member
Since: Oct 25, 2008
Posts: 59
Last: Aug 1, 2011
[view latest posts]
Level 3
Category: CoD2 SP Mapping
Posted: Thursday, Feb. 12, 2009 03:19 pm
Code:

thread obj2();
}

obj2()
{
	objective_add(2,"active","KORSHAMNEN_OBJ_2", < 10 >);


	floor_spawners = getentarray("floor_german_spawn","script_noteworthy");
	floor_spawned = [];
	for(i=0;i < floor_spawners.size;i++)
		floor_spawned[floor_spawned.size] = floor_spawners[i] dospawn();
	for(i=0;i < floor_spawned.size;i++)
		while(IsAlive(floor_spawned[i]))
			wait(0.1);
	objective_state(2,"done");
}


There IS soemthing wrong with this code because i get the bad syntax error, but what?
Share |
tomalla
General Member
Since: Jan 16, 2007
Posts: 393
Last: Jun 10, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 SP Mapping
Posted: Friday, Feb. 13, 2009 04:33 am
[duh] Lol.

I see ... change "< 10 >" to "10" ( without quotes of course ) ... These "<" were only to show you up, what I was talking about [lol]
Share |
galentv
General Member
Since: Oct 25, 2008
Posts: 59
Last: Aug 1, 2011
[view latest posts]
Level 3
Category: CoD2 SP Mapping
Posted: Friday, Feb. 13, 2009 08:12 am
Thank you very much, I've been searching as hell for this.

BUT, The string doesn't show up, and here is my script:

Code:
obj2()
{
	objective_add(2,"active", KORSHAMNEN_OBJ_2", 18 );
	floor_spawners = getentarray("floor_german_spawn","script_noteworthy");
	floor_spawned = [];
	for(i=0;i < floor_spawners.size;i++)
		floor_spawned[floor_spawned.size] = floor_spawners[i] dospawn();
	for(i=0;i < floor_spawned.size;i++)
		while(IsAlive(floor_spawned[i]))
			wait(0.1);
	objective_state(2,"done");
}


If you want to help me again, I wold be very happy...
Share |
tomalla
General Member
Since: Jan 16, 2007
Posts: 393
Last: Jun 10, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 SP Mapping
Posted: Friday, Feb. 13, 2009 08:19 am
What do you mean by "doesn't show up"? There is completely no objective? Or there is objective, but with no text? Or ... there IS objective with text "KORSHAMNEN_OBJ_2" instead of this in your localizedstrings?

Describe your problem. Then I'll try to help ya. Oh, and you can post your localizedstrings file as well.

edited on Feb. 13, 2009 10:20 am by tomalla
Share |
galentv
General Member
Since: Oct 25, 2008
Posts: 59
Last: Aug 1, 2011
[view latest posts]
Level 3
Category: CoD2 SP Mapping
Posted: Friday, Feb. 13, 2009 09:05 am
Ah i don need any help i gotit working 15 minutes later, Sorry
Share |
tomalla
General Member
Since: Jan 16, 2007
Posts: 393
Last: Jun 10, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 SP Mapping
Posted: Friday, Feb. 13, 2009 09:38 am
Great to hear this [thumbs_up] Glad I helped you.
Share |
XtremeXcata
General Member
Since: Feb 12, 2012
Posts: 9
Last: Feb 26, 2012
[view latest posts]
Level 0
Category: CoD2 SP Mapping
Posted: Sunday, Feb. 26, 2012 03:34 am
Man i need help! I dont understand somethink: WHAT DO YOU MEAN < ORIGIN OF OBJECTIVE > ??

edited on Feb. 26, 2012 11:01 am by XtremeXcata
Share |
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 SP Mapping

Latest Syndicated News

»
Why console gaming is dying
Quote:Consider this: Dedicated gaming sales — including living-room consoles...
Devs: Games are being dumb...
Click 'read more' to view the contents of this post.
Loadout
Gun Crafting to the Max. edited on Sep. 25, 2012 06:57 pm by Morp...
Introducing the Source Fil...
Surprised this wasn't made a long time ago. Sounds like a nice little feature.
Introducing the Source Fil...
The Source Filmmaker (SFM) is the movie-making tool built and used by us he...

Partners & Friends

»