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 subscribe
Author Topic: Kill many enemies as an objective
galentv
General Member
Since: Oct 25, 2008
Posts: 65
Last: Aug 10, 2014
[view latest posts]
Level 3
Category: CoD2 SP Mapping
Posted: Thursday, Jan. 29, 2009 08: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 08: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: 65
Last: Aug 10, 2014
[view latest posts]
Level 3
Category: CoD2 SP Mapping
Posted: Thursday, Feb. 12, 2009 10: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 11: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: 65
Last: Aug 10, 2014
[view latest posts]
Level 3
Category: CoD2 SP Mapping
Posted: Friday, Feb. 13, 2009 03:12 pm
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 03:19 pm
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: 65
Last: Aug 10, 2014
[view latest posts]
Level 3
Category: CoD2 SP Mapping
Posted: Friday, Feb. 13, 2009 04:05 pm
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 04:38 pm
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 10: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 Topic is Locked 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

»