Creating a new gamemode

Have a question you need to ask? Need help? Ask here!

Moderator: Core Staff

Post Reply
Royal_Flush
CJ Wannabe
CJ Wannabe
Posts: 4
Joined: October 5th, 2012, 10:13 pm

Creating a new gamemode

Post by Royal_Flush » October 5th, 2012, 10:44 pm

Hi,

maybe this is the wrong forum for this kind of request but you seem to be the last active forum that has something to do with CoD4 modding, so I decided to try it here. I hope you can help :)

I recently had an idea for a new gamemode. The problem is: I don't get the basic systems behind gamemode mods. Actually, I'm playing the gungame mod for quite a while and was also fooling around with the files and modified the mod (modception :lol: ) to know count the points in another way. But not more. Basically all I've done is searching for the corresponding lines in the corresponding files and changing them. But I have no clue how to actually make more advanced changes - such as an completely own gamemode.

As hobby-programer I'm quite sure I'll manage the scripting itself as it seems to be some kind of c. My problem much more is that I don't understand how the concept behind these mods in general work. When I look into my gungame folder I see lots of different files seeming to be not connected at all. I have no clue what file does what, why it does what it does and how the game knows what files to call.

In the CoD scripting handbook there is an tutorial to implement an anti-camping-function into deathmatch. Although I can follow his instructions, I still have no clue how to actually create a new gamemode. Do I have to edit files? Create new ones and catch certain events that happen (such as the player being shot)?

Can someone please explain how all these files work, when they are called and so on? Or at least give a starting spoint or a good tutorial from where to work forward?

If this is of relevance: My gameidea is to create something like crashday's "pass the bomb" gamemode: http://www.youtube.com/watch?v=buT7UglMKiM

I hope you can help me :)

Greets
Royal_Flush

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Creating a new gamemode

Post by Drofder2004 » October 6th, 2012, 12:03 am

Learn how the game calls functions and then trace them around.

It is worth reading everything and making a diagram of linking files with functions. Write pseudocode for every function, saying exactly what the function is used for and the process.

With CoD4, the gametype files control very basic core gametpy eesentials (dm.gsc, tdm.gsc, etc) and the globallogic file hold the key gaming elements along with all the other files.

Creating a new gametype can be done by modifying an existing gametype or from scratch...
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Royal_Flush
CJ Wannabe
CJ Wannabe
Posts: 4
Joined: October 5th, 2012, 10:13 pm

Re: Creating a new gamemode

Post by Royal_Flush » October 9th, 2012, 9:29 pm

Ok thanks. It's still quite confusing, but it gets a bit clearer from time to time. I'll simply ask as soon as I have a concrete question.

Royal_Flush
CJ Wannabe
CJ Wannabe
Posts: 4
Joined: October 5th, 2012, 10:13 pm

Re: Creating a new gamemode

Post by Royal_Flush » October 12th, 2012, 12:08 am

every term being in quotation marks (e.g. "mp_dm_spawn") are aliases, aren't they? Where can I find the *.csv where these are listed? I found tons of sound lists but these are of no use for me at the moment.

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Creating a new gamemode

Post by Rezil » October 12th, 2012, 4:09 pm

every term being in quotation marks (e.g. "mp_dm_spawn") are aliases, aren't they? Where can I find the *.csv where these are listed? I found tons of sound lists but these are of no use for me at the moment.
There is no such .csv file. And they're not exactly aliases, they're key/value pairs; I'm assuming you're refering to getent("mp_dm_spawn","classname"); or something similar.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

Royal_Flush
CJ Wannabe
CJ Wannabe
Posts: 4
Joined: October 5th, 2012, 10:13 pm

Re: Creating a new gamemode

Post by Royal_Flush » October 12th, 2012, 7:42 pm

Rezil wrote:
every term being in quotation marks (e.g. "mp_dm_spawn") are aliases, aren't they? Where can I find the *.csv where these are listed? I found tons of sound lists but these are of no use for me at the moment.
There is no such .csv file. And they're not exactly aliases, they're key/value pairs; I'm assuming you're refering to getent("mp_dm_spawn","classname"); or something similar.
Is there a database that contains all the valid keys?

I have got another question. While it is clear when functions like "onSpawnPlayer" are called, I have no clue, when e.g. _globallogic's "Callback_PlayerKilled" is called. Furthermore, I assume that it isn't a good idea to change this function to make something happen if a special player gets killed. I should do this in my gametype file. But how do I tell the game to call my function?

An example: In the sab.cfg file there is a function named "onDrop". Its name suggests it is the function being calles when the game sends some kind of "bomb dropped event". Again, I would need a reference for these events.

F |Madness| U
CJ G0D!
CJ G0D!
Posts: 1575
Joined: June 3rd, 2009, 9:02 pm
Location: Cardiff University, UK

Re: Creating a new gamemode

Post by F |Madness| U » October 13th, 2012, 1:14 pm

Royal_Flush wrote:
Rezil wrote:
every term being in quotation marks (e.g. "mp_dm_spawn") are aliases, aren't they? Where can I find the *.csv where these are listed? I found tons of sound lists but these are of no use for me at the moment.
There is no such .csv file. And they're not exactly aliases, they're key/value pairs; I'm assuming you're refering to getent("mp_dm_spawn","classname"); or something similar.
Is there a database that contains all the valid keys?

I have got another question. While it is clear when functions like "onSpawnPlayer" are called, I have no clue, when e.g. _globallogic's "Callback_PlayerKilled" is called. Furthermore, I assume that it isn't a good idea to change this function to make something happen if a special player gets killed. I should do this in my gametype file. But how do I tell the game to call my function?

An example: In the sab.cfg file there is a function named "onDrop". Its name suggests it is the function being calles when the game sends some kind of "bomb dropped event". Again, I would need a reference for these events.
Most of the time in functions such as these, somewhere inside the function, normally near the very start, there should be a line something like

Code: Select all

self/player waittill("bomb_dropped");
<-- thats a guess at what will be inside the onDrop() function, something similar to that, where the function waits for the event "bomb_dropped", and I assume you're asking if there is a file which contains every single event? I don't know if there is, but I would indeed like to see/know if there is a list of events.

If that was a bad example I know for certain that in onPlayerSpawned() there is a line

Code: Select all

player waittill("spawned_player");
which just runs that function when the `event occurs`, in this case a player spawning. Hope any of that helps.
-

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests