Page 1 of 2

Different scriping needed for FFA, DM & TDM?

Posted: Mon Aug 04, 2003 11:20 pm
by Bjarne BZR
Ive seen a lot of if ( gametype ) statements in basic dm levels scripts, are there any reasons to execute different scripts for different types of DM matches ( Free for all, Death match and Team deathmatch )?

Posted: Tue Aug 05, 2003 3:07 am
by Alcoholic
you probably dont want a dm map that can end if a bomb blows up. :roll:

Posted: Tue Aug 05, 2003 6:34 am
by jv_map
Well, what's below the if (gametype) in those basic scripts? :wink:

I know only one reason and that is for roundbased, most dm scripts have a thread that disables respawning for roundbased matches. But, who plays roundbased games anyway :?

Spearhead

Posted: Tue Aug 05, 2003 6:12 pm
by tltrude
He is talking about Spearhead scripts. They use the gametype number to make scripts that work in more than one type game--like TOW and DM.

Posted: Wed Aug 06, 2003 1:21 am
by Bjarne BZR
Hey tltrude! U accusing me of beeing a spearhead mapper? Thats soooo low man! :wink:

No, I'm just talking regular FFA, DM, TDM matches in MOH:AA.

I'm not really a DM (any type) player, but I realize the simpicity in releasing DM versions of my OBJ maps.

So: if I set a DM map to be not respawning, should I change that for FFA and DM games?

FFA

Posted: Wed Aug 06, 2003 2:25 am
by tltrude
Free for all requires a diffierent kind of player spawn point. Team Deathmatch, Round based, and Objective use the same ones. The host of the game sets the gameplay options. You only need two versions (dm and obj) of the script.

Posted: Wed Aug 06, 2003 3:19 am
by Bjarne BZR
Yes tltrude, I am aware of the things you point out. I only want to know if there are any parameters / settings /commands that should differ in the scripting between FFA, DM and TDM matches ( is there a need for if statements checking the game type in a DM map )?

Posted: Wed Aug 06, 2003 7:11 am
by jv_map

Code: Select all

// THE BRIDGE
// ARCHITECTURE: POWZER
// SCRIPTING: POWZER

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "The Crossroads"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "mohdm4"

	// call additional stuff for playing this map round based is needed
	if(level.roundbased)
		thread roundbasedthread

	level waittill prespawn

	//*** Precache Dm Stuff
	exec global/DMprecache.scr

	exec global/door_locked.scr::lock
	level.script = maps/dm/mohdm4.scr
	exec global/ambient.scr mohdm4
	
	thread global/minefield.scr::minefield_setup

	level waittill spawn
end

//-----------------------------------------------------------------------------

roundbasedthread:

	// Can specify different scoreboard messages for round based games here.

	level waitTill prespawn

	level waittill spawn

	// set the parameters for this round based match
	level.dmrespawning = 0 // 1 or 0
	level.dmroundlimit = 5 // round time limit in minutes
	level.clockside = kills // set to axis, allies, kills, or draw

	level waittill roundstart

end
According to this script (from the crossroads) you only require a special section for roundbased games....

Posted: Wed Aug 06, 2003 11:34 am
by Bjarne BZR
Yes, this is the thing I was fishing for...
Ahh, they dont set the level.dmrespawning at all unless its a roundbased game... makes sense.

Thanx

Posted: Wed Aug 06, 2003 6:04 pm
by Bjarne BZR
Does rund based games have a roundstart event? I thought only objective games had that...

Posted: Mon May 17, 2004 9:42 pm
by Krane
I'll revive this old topic....but I refuse to believe it can't be done.

Ok, if you want something to run specific in round based games, you use if(level.roundbased)...But what should I use for DM? if(level.dmbased)?
And for TDM? if(level.teambased)?

if(level.????????)

roundbased = Round Based Match
??????????? = Team Death Match
??????????? = Death Match

:?: :?: :?: :?:

Posted: Mon May 17, 2004 9:47 pm
by lizardkid
Bjarne BZR wrote:Hey tltrude! U accusing me of beeing a spearhead mapper? Thats soooo low man! :wink:
hey!!!!

Posted: Tue May 18, 2004 12:10 am
by wacko
I found player.dmteam in the Game Module Classes. It returns 'allies', 'axis', 'spectator', or 'freeforall'.
So, if any player was used to check the game mode and he returned 'freeforall', wouldn't it be clear then, that this is not teamdeathmatch?

Hope that helps (oh how much I hope :wink: )

edit :cry:
no, can't work. the turret told me so, because it's working in dm also were this player.dmteam is used.
So next question: When DOES it return freeforall? I only can see spectator/allied/axis...

never

Posted: Tue May 18, 2004 3:53 am
by tltrude
It never returns ffa. That is old Quake stuff. Mohaa does not have a FFA team selection as it would require a "neutral" skin.

BUT.............

You can use the name of the gametype you are running with "(getcvar g_gametypestring)". Or, the gametype number with "(getcvar g_gametype)". In an FFA game, those will give the values "Free-For-All" and "1".

BTW Bjarne BZR, there is no game named "Death Match" in mohaa. Look at the mutiplayer game selection screen and you'll see the word "Death" is not there.

Re: never

Posted: Tue May 18, 2004 6:36 am
by Krane
tltrude wrote: BUT.............

You can use the name of the gametype you are running with "(getcvar g_gametypestring)". Or, the gametype number with "(getcvar g_gametype)". In an FFA game, those will give the values "Free-For-All" and "1".
Hmm, so if I want to run a thread ONLY if the game is free-for-all, I should use:

if((getcvar g_gametype) == 1)
{
my stuff here
}
end

...this thread will run only if the game in FFA?