Gametype

Post your scripting questions / solutions here

Moderator: Moderators

chrisjbooth2001
Colour Sergeant
Posts: 77
Joined: Thu Dec 18, 2003 12:57 am

Gametype

Post by chrisjbooth2001 »

When you type g_gametype 1 for Free for all... Where is the file that tells the game 1 is Free For All 2 is TDM ect.
dcoshea
Colour Sergeant
Posts: 94
Joined: Thu Mar 04, 2004 3:00 am
Location: Sydney, Australia
Contact:

Re: Gametype

Post by dcoshea »

chrisjbooth2001 wrote:When you type g_gametype 1 for Free for all... Where is the file that tells the game 1 is Free For All 2 is TDM ect.
Well for one thing, in Spearhead and Breakthrough you can get that information from the callvote.cfg since it changes the gametype based on what was selected.

Regards,
David
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Re: Gametype

Post by jv_map »

chrisjbooth2001 wrote:When you type g_gametype 1 for Free for all... Where is the file that tells the game 1 is Free For All 2 is TDM ect.
It's gamex86.dll in your /main folder :wink:
Image
dcoshea
Colour Sergeant
Posts: 94
Joined: Thu Mar 04, 2004 3:00 am
Location: Sydney, Australia
Contact:

Re: Gametype

Post by dcoshea »

jv_map wrote:
chrisjbooth2001 wrote:When you type g_gametype 1 for Free for all... Where is the file that tells the game 1 is Free For All 2 is TDM ect.
It's gamex86.dll in your /main folder :wink:
Oh yes, that answer is better :) I read the question as "Where is the file that tells you 1 is Free For All" etc. :)

May I ask why you're asking, chrisjbooth? Do you want to add a new gametype?

Regards,
David
chrisjbooth2001
Colour Sergeant
Posts: 77
Joined: Thu Dec 18, 2003 12:57 am

Post by chrisjbooth2001 »

Im thinking of summit
dcoshea
Colour Sergeant
Posts: 94
Joined: Thu Mar 04, 2004 3:00 am
Location: Sydney, Australia
Contact:

Post by dcoshea »

chrisjbooth2001 wrote:Im thinking of summit
That's some sort of mode where you have to capture locations on the map which are possibly hills, right?

Are you running Spearhead or Breakthrough there? I once thought of a way to add extra gametypes which could be voted through the menu - when someone votes for a particular map with your new gametype, the vote option should not only set g_gametype to some value, it could set a new variable of your choosing to some other value, e.g. if I was adding a summit mode to The Hunt (probably not a good map for it) I would have a menu option like this:

Code: Select all

"Summit Map" "g_gametype" list
{
	"The Hunt - obj/obj_team1" "4;set g_gametype_ex 1;map obj/obj_team1"
The game would of course internally treat it like objective, so it would have an objective-type scoreboard when you hit TAB, and I don't think there's any way to change that. However, your maps/obj/obj_team1.scr map script could detect that g_gametype_ex is set to 1 and do the script-related stuff required to make the map a "summit" map instead of an objective one.

I don't guarantee that it will actually work since I haven't tested it, but I figure you should be able to set two variables in the one vote option, and other than that it's pretty straightforward stuff.

I hope this helps if you can't find a better solution!

Regards,
David
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

along these lines. in AA how do u make a custom gametype. like ctf. im not asking for a ctf tutorial, just how u make it say capture the flag instead of tdm.
Image
dcoshea
Colour Sergeant
Posts: 94
Joined: Thu Mar 04, 2004 3:00 am
Location: Sydney, Australia
Contact:

Post by dcoshea »

omniscient wrote:along these lines. in AA how do u make a custom gametype. like ctf. im not asking for a ctf tutorial, just how u make it say capture the flag instead of tdm.
Sorry, this is a bit of a dumb question :) But where do you want it to say "Capture The Flag"?

Regards,
David
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

hehe, u know when u open up say gamespy, and it says what game type ur joining (Objective etc) how do u get it to say Capture the flag?
Image
dcoshea
Colour Sergeant
Posts: 94
Joined: Thu Mar 04, 2004 3:00 am
Location: Sydney, Australia
Contact:

Post by dcoshea »

omniscient wrote:hehe, u know when u open up say gamespy, and it says what game type ur joining (Objective etc) how do u get it to say Capture the flag?
Oh yes, of course! Well unfortunately I highly doubt that stuff is scriptable. FYI, the server returns GameSpy (or whatever other program is querying the server) two fields, "gametype" which is the textual version of the game type, and "gametype_i" which is the number we're familiar with seeing the "gametype" set to in map scripts. I guess, assuming there isn't a way of changing things via script that I don't know about (which is possible since I doubt it's possible so much that I haven't even looked :) ), there are two ways that you might be able to change the "gametype" field. This of course would be useless if the program was ignoring "gametype" and instead looking up the "gametype_i" field in its own table of the game type strings, but it might be a bit silly for the program to do that because it would mean it wouldn't support new game types in new versions of MOH without an upgrade to the application of some sort.

Anyway, here are the two possibilities I can think of:

1. hex edit the game binaries to provide different strings; or
2. write a program which intercepts queries to the server and changes the data returned to the client.

I figure you'd much prefer to look into #1 than #2, and I can tell you #2 would probably be difficult and require you to have some specific NAT configuration on your router so that when the server tells the GameSpy master server that it is accepting queries on port X, requests to that port that are coming into the server are redirected to port Y where your program is running and can create queries to the server on port Y, then modify them before returning the responses to the original client.

It looks like the strings you'd need to edit for #1 are in gamex86.dll.

Regards,
David
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

i was wondering because when capture the flag came out they did that, i was just wondering how it was done.
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Cant you set the "g_gametype" setting? I think thats waht A.S.E. uses ( and the "g_gametype" is 4 )...
Admin .MAP Forums
Image
Head above heels.
dcoshea
Colour Sergeant
Posts: 94
Joined: Thu Mar 04, 2004 3:00 am
Location: Sydney, Australia
Contact:

Post by dcoshea »

Bjarne BZR wrote:Cant you set the "g_gametype" setting? I think thats waht A.S.E. uses ( and the "g_gametype" is 4 )...
4 = Objective Match. What would you set it to to indicate "Capture The Flag"? I doubt there is a pre-defined setting which means "Capture The Flag" is there?

Regards,
David
dcoshea
Colour Sergeant
Posts: 94
Joined: Thu Mar 04, 2004 3:00 am
Location: Sydney, Australia
Contact:

Post by dcoshea »

I just took a look at my disassembly and it looks like the text "Objective-Match", etc., is put into a cvar called "g_gametypestring". I guess it is probably done before the map script runs, allowing you to update that cvar in your map script to whatever you want the text to say. Presumably that variable is the one returned at the "gametype" to remote queries.

Regards,
David
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

so in the script would it say set g_gametypestring "Capture the Flag"
Image
Post Reply