RW script structure cleanup.
by Phil Carlisle · in General Discussion · 11/19/2002 (10:45 am) · 5 replies
Ok, I'm looking at clearing out the scripts for realmwars and trying to make them a little more "structured". Presently files are exec'ing other files left and right for things which are not related in the least.
Has anyone any suggestions or preferences before I start?
One thing that's concerning me is ease of mapping. Currently we have a variable set in the map saying what type of game it is *ctf, deathmatch etc*, James wants this to be more based on what the map is loading (i.e. if it sees a flag, it loads the CTF rules?).
What would be the easiest way for mappers to setup game play stuff?
It'd be nice to be able to exec different sets of rules and have them all interact nicely (like, I want a map that supports CTF AND Deathmatch AND GameTypeX, all I do is have a line:
SpawnRules CTF
SpawnRules DeathMatch
SpawnRules CaptureNHold
Thing is, different rules often have different terminal conditions etc.
How about spawning and such? some gametypes allow spawn anytime, others allow spawn only when gamestarted etc.
I really need to make this clear and flexible, so any suggestions would be cool.
Phil
Has anyone any suggestions or preferences before I start?
One thing that's concerning me is ease of mapping. Currently we have a variable set in the map saying what type of game it is *ctf, deathmatch etc*, James wants this to be more based on what the map is loading (i.e. if it sees a flag, it loads the CTF rules?).
What would be the easiest way for mappers to setup game play stuff?
It'd be nice to be able to exec different sets of rules and have them all interact nicely (like, I want a map that supports CTF AND Deathmatch AND GameTypeX, all I do is have a line:
SpawnRules CTF
SpawnRules DeathMatch
SpawnRules CaptureNHold
Thing is, different rules often have different terminal conditions etc.
How about spawning and such? some gametypes allow spawn anytime, others allow spawn only when gamestarted etc.
I really need to make this clear and flexible, so any suggestions would be cool.
Phil
About the author
Recent Threads
#2
1: First, load all the things that are common to RW in general. (Scritps that handle weapons, characters, etc)
2: Next, load the rules for that type of game. (CTF, DM, whatever)
3: Finally, load the individual .mis file and a corresponding .cs file that has special stuff just for that mission.
So the person making a new map and/or mission only needs to be concerned with step 3, creating the .mis and maybe a .cs file. If their map is set to ctf they can rest easy knowing that the rules, characters, etc will all be loaded for them.
Certain types of games might require some things, like ctf games might require flag positions that are marked properly or something like that. But individual mission should not include the CTF rules.
If we want people to have ultimate flexibility we can always make a category of game called "custom" that allows them to do all the loading of .cs files themselves, but I assume that will be a rarity. Most of the time the things like rules and loading to need to handled in one place over their heads.
11/19/2002 (12:04 pm)
Oop Phil, let me clarify a bit. Here is how I think it should work:1: First, load all the things that are common to RW in general. (Scritps that handle weapons, characters, etc)
2: Next, load the rules for that type of game. (CTF, DM, whatever)
3: Finally, load the individual .mis file and a corresponding .cs file that has special stuff just for that mission.
So the person making a new map and/or mission only needs to be concerned with step 3, creating the .mis and maybe a .cs file. If their map is set to ctf they can rest easy knowing that the rules, characters, etc will all be loaded for them.
Certain types of games might require some things, like ctf games might require flag positions that are marked properly or something like that. But individual mission should not include the CTF rules.
If we want people to have ultimate flexibility we can always make a category of game called "custom" that allows them to do all the loading of .cs files themselves, but I assume that will be a rarity. Most of the time the things like rules and loading to need to handled in one place over their heads.
#3
Just wondered if any real experienced mappers could give us some input.
Phil.
11/19/2002 (3:00 pm)
The issue there james, is how do we know the map can support the gamerules if you apply those rules first? do we interrogate the map to see if it has the required objects??Just wondered if any real experienced mappers could give us some input.
Phil.
#4
There's not much of a problem there, as I see it.
11/19/2002 (3:51 pm)
You can overwrite rules that you execute. If I run execCTFlib(); at the beginning of my .cs file, it will start the neccessary functions for scoring concerning CTF games. If I want to use CTF as a base only, I can rewrite the portions of the CTF script into the .cs file that need to be changed. So, instead of grabbing the flag when you touch it, you may have to shoot it or something. I can just write that in, and it overwrites that section of the original CTF script only.There's not much of a problem there, as I see it.
#5
So your server browser might have different tabs for different game types, or might sort them by gametype.
This is pretty in line with how most games work I think. Choose the type of game you want, then choose from the available maps.
You could make maps that work for multiple game types of course, but not all maps will work with all game types in general.
11/20/2002 (2:05 pm)
I would think you choose a gametype, like CTF or DM, and then can only choose maps that fit that gametype.So your server browser might have different tabs for different game types, or might sort them by gametype.
This is pretty in line with how most games work I think. Choose the type of game you want, then choose from the available maps.
You could make maps that work for multiple game types of course, but not all maps will work with all game types in general.
Eli McClanahan
Right now, I think the biggest problem is the way everything is set up in the folders. There must be at least 3 of many files littering different folders and calling different things - very messy. It'd be nice if everything was packaged in neat folders and files. And what happened to .cs files for the maps, BTW? It's something I've yet to encounter (working gametypes and scripts within a folder clustered with objects from the map.)