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

Members Online

»
0 Active | 5 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 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Multiplayer objectives
KillerKlown75
General Member
Since: Sep 27, 2006
Posts: 39
Last: Jan 31, 2008
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Wednesday, Nov. 8, 2006 10:48 am
I am trying to create a multiplayer map with a number of sub-objectives in it and was wondering if there is a way in multiplayer to manipulate the score of every member after a trigger is fired (such as exploding a fuel depot - so the Axis score would get decremented and Allied incremented)

I know that there is a way to do it in UO, but so far I haven't been able to figure it out for COD2. Do any of you guys have any advice? Is this even possible in COD2 multiplayer?
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 Scripting
Posted: Wednesday, Nov. 8, 2006 09:49 pm
Yes.. you can do it in the same way as it's done in UO.

It most likely means rewriting the gametype script, that's where the score is kept...
Or writing your own gametype.
Share |
KillerKlown75
General Member
Since: Sep 27, 2006
Posts: 39
Last: Jan 31, 2008
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Wednesday, Nov. 8, 2006 11:26 pm
Ah, I was hoping it would be easier, so I could do it from the script of the trigger.

In UO I think it's

self.score = self.score + 20;

But if I have that in my explosion script, it does everything else with the exception of adding 20 points to the player.
Share |
sharkeh
General Member
Since: Sep 24, 2006
Posts: 20
Last: Dec 1, 2006
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Wednesday, Nov. 8, 2006 11:26 pm
The things you'll need to get this working are:
game["alliedscore"]
game["axisscore"]
setTeamScore("team", "teamscore")

so you could do something like...

Code:
while(1)
{	
	objtrigger waittill("trigger", other);

	if(game["matchstarted"] && other.pers["team"] == "allies")
	{
		game["alliedscore"]++;
		game["axisscore"]--;
	}
	else if(game["matchstarted"] && other.pers["team"] == "axis")
	{
		game["alliedscore"]--;
		game["axisscore"]++;
	}

	setTeamScore("allies", game["alliedscore"]);
	setTeamScore("axis", game["axisscore"]);

	wait 0.1;
}


change the objtrigger to the name of your trigger and it should work but that's just basic and you'll probably want to add a lot to it.
Share |
KillerKlown75
General Member
Since: Sep 27, 2006
Posts: 39
Last: Jan 31, 2008
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Thursday, Nov. 9, 2006 02:09 am
Hi sharkeh,

Cheers for that, but it doesn't work - Even if I only put:

game["alliedscore"]++;
game["axisscore"]--;

into the trigger code, I get a script runtime error. [confused]
Share |
sharkeh
General Member
Since: Sep 24, 2006
Posts: 20
Last: Dec 1, 2006
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Thursday, Nov. 9, 2006 04:17 am
Well that code is nowhere near complete and I'd hoped you could fill in the blanks so to speak and work the rest out. It does work, however, there are too many unknowns for me to do a complete method.
Share |
KillerKlown75
General Member
Since: Sep 27, 2006
Posts: 39
Last: Jan 31, 2008
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Thursday, Nov. 9, 2006 04:54 pm
No, I still can't get it to work. Even if I just put these lines into the trigger code:

game["alliedscore"]--;
game["axisscore"]++;

setTeamScore("allies", game["alliedscore"]);
setTeamScore("axis", game["axisscore"]);


I get a script compile error.
Share |
Chalkie
General Member
Since: Mar 27, 2004
Posts: 312
Last: Mar 9, 2008
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Wednesday, Nov. 22, 2006 02:13 pm
Eyup KK, did the code i sent you work?
Share |
KillerKlown75
General Member
Since: Sep 27, 2006
Posts: 39
Last: Jan 31, 2008
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Wednesday, Nov. 22, 2006 02:22 pm
Hi Chalkie,

Nah, even the player.name code you had in your map didn't work. I just realised about two seconds ago that its maybe because I'm launching the map from the compiler and not setting up the server and loading the map...

edited on Nov. 22, 2006 09:23 am by KillerKlown75
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

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

»