CTF tutorial

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Cheech
Corporal
Posts: 25
Joined: Mon Jul 21, 2003 5:41 pm
Location: Germany
Contact:

CTF tutorial

Post by Cheech »

hi

who can help me to find a tutorial to make custom CTF maps ?
:oops: i haven?t played CTF, but i make a clanmap and they wish to play CTF

thx
Cheech
visit our region in moh
www.steinhuder-meer.us
Ric-hard
Sergeant Major
Posts: 102
Joined: Sun Feb 29, 2004 6:44 am
Location: sweden
Contact:

Post by Ric-hard »

Maybe u can take a look at Mefys CTF-mod, its free to use as long as u give him cred.

http://www.planetmedalofhonor.com/mefy/

Here is the READ ME for the mod.
Server-Side "Capture-The-Flag" MOD Version 1.2 For Mohaa (11-30-2003)
-Stock Map Pack Release #2-
by Mark Follett (Mefy)
mef123@geocities.com
www.geocities.com/mef123.geo/mohaa


Description
-----------
This mod allows you to host a new gametype, Capture-The-Flag, for the
stock Mohaa maps. The default rules are as follows: To score a point
your team must capture and bring the enemy team's flag to your own
team's base and hold it there for 15 seconds. The first team to score
4 points, or the team with the most points at the end of the round,
wins the round. The default round time is 12 minutes.

There are 16 options for customizing the rules of the game, including
the locations of the axis and allied bases for each map-- see below
for instructions.

This mod is a server-side mod, meaning clients do not have to
download anything to play it on your server!


Installation
------------
Included in this map pack is a separate pk3 file for each stock map:
user-mefy-ctf-mohdm1_1_2.pk3 (Southern France)
user-mefy-ctf-mohdm2_1_2.pk3 (Destroyed Village)
user-mefy-ctf-mohdm3_1_2.pk3 (Remagen)
user-mefy-ctf-mohdm4_1_2.pk3 (The Crossroads)
user-mefy-ctf-mohdm5_1_2.pk3 (Snowy Park)
user-mefy-ctf-mohdm6_1_2.pk3 (Stalingrad)
user-mefy-ctf-mohdm7_1_2.pk3 (Algiers)
user-mefy-ctf-obj_team1_1_2.pk3 (The Hunt)
user-mefy-ctf-obj_team2_1_2.pk3 (V2 Rocket Facility)
user-mefy-ctf-obj_team3_1_2.pk3 (Omaha Beach)
user-mefy-ctf-obj_team4_1_2.pk3 (The Bridge)
Place the pk3 files for the maps you'd like to host as Capture-The-Flag
into your MOHAA/main directory.


Hosting a Game
--------------
If the map is one of the stock dm maps (mohdm#), then run that map
in Round-Based-Match mode in order to enable Capture-The-Flag. If the
map is one of the stock objective maps (obj_team#), then run the
map in Objective mode.

Running a stock dm map in Free-For-All or Team-Match modes will make
the map function as normal. If you want to run a normal Round-Based-Match
game on a dm map while the mod is installed, set the cvar "g_ctf_disable"
to 1 and restart the game. Set "g_ctf_disable" to 0 to re-enable the mod.
Do the same if you want to host an objective game while the mod is installed.


Uninstall
---------
Just remove the user-mefy-ctf... pk3 files from your MOHAA/main directory.


Changes
-------
Version 1.2
-- Fixed bug where the flag would get stuck to a player for
the rest of the round if they capture the flag at the same
time as they are killed.
-- Set the game to run in gametype 4 (objective) for the
obj maps. This allows you to cycle through the obj maps
easier and should stop players from getting thrown to spec
when the round restarts in these maps.
-- Added a final sudden death round that follows the standard
sudden death round if the score is still tied. During this
round respawning is disabled. If this round ends with no
winner or players are still alive, then the game will end in
a draw. Use the "g_ctf_fsuddendeath" cvar to control the
length of the round.
-- Added a "g_ctf_version" cvar that returns the version of ctf
that is running. Intended for viewing from server browsers
like Gamespy and All-Seeing-Eye.
-- Added code to hide the center message at the end of the round
if it's still up ('Allies/Axis score!')
-- Changed Defaults:
-- Roundtime is now 12 minutes instead of 15.
-- Pointlimit is now 4 instead of 5.
-- Capturepress is now 2 seconds instead of 2.5 seconds.
-- Dropdelay is now 2 seconds instead of 3 seconds.
-- Base Locations:
-- mohdm2: moved east bldg ruins spot from the upper level
to the ground in front
moved east sector spot away from the spawn point
-- mohdm4: moved the spots to the same as obj_team4:
under the bridge and next to the 'chartreux' sign
-- obj_team1: moved the axis bases farther back near their
spawn


References
----------
http://gronnevik.se/rjukan/
http://www.alliedassault.com
http://www.alliedassault.com/community/guides/BitsnCK/
http://www.alliedassault.us
http://www.mohadmin.com
http://www.modtheater.com
http://www.planetmedalofhonor.com/map/


General Customization
---------------------
The game can be customized by adjusting the following cvars. After setting
a cvar, you must restart the game for the changes to take effect.

* "g_ctf_disable" Default: 0
Set this to 1 in order to disable Capture-The-Flag mode. If the map
running is a dm map, then it will run in Round-Based-Match mode. If
the map running is an obj map, then it will begin a standard objective
game.

* "g_ctf_pointlimit" Default: 4
This sets the number of points a team must score in order to win a
round. If time runs out before the point limit is reached, then the
team with the most points will be the winner. Setting this to 0 will
allow the round to continue until time runs out, then determine a
winner. Use the standard 'roundlimit' cvar to control the length of
the round. The default round time is 12 minutes.

* "g_ctf_suddendeath" Default: 5
If time runs out and the score is tied, a sudden death round will
begin. The next team to score will win the round. Set this option to
the number of minutes the sudden death round should last. If the sudden
death round ends with the score still tied, then a 'final' sudden death
round will occur (see below). Setting this to 0 will start a final
sudden death round immediately.

* "g_ctf_fsuddendeath" Default: 3
If time runs out in sudden death, then a final sudden death round will
begin. This is the same as sudden death except that respawning will be
disabled. The next team to score or kill all of the enemy team will win
the round. Set this option to the number of minutes the final sudden
death round should last. If the final sudden death round ends with the
score still tied and players still alive, then a draw will occur.
Setting this to 0 will force a draw immediately.

* "g_ctf_alliedbase" Default: map-specific
Set this in order to change the location of the allied base. The format
is as follows: "<x-coord> <y-coord> <z-coord> <angle>". For example, a
value of "297 -2115 -22.62 180" will place the allied base at
( 297 -2115 -22.62 ) and it will be facing at an angle of 180.
You will most likely want to set this for a specific map. See the
section on "Map-Specific Customization" for instructions on how to
do this.

* "g_ctf_axisbase" Default: map-specific
Set this in order to change the location of the axis base. The format
is the same as 'alliedbase'.

* "g_ctf_returnboth" Default: 0
Set this to 1 in order to require a team to bring both flags to their
own base in order to score a point. When set to 0, they only have to
bring the enemy team's flag to their own base to score.

* "g_ctf_countdown" Default: 15
This sets the number of seconds a team must hold the flags at their
base in order to score a point. Setting this to 0 will cause them to
instantly score when the flags are brought home.

Setting this to a large value will give the opposing team a chance to
re-capture their flag and prevent a score. The scoring team will have to
guard their base well in order to hold off the opposing team. Set this
to a small value to make scoring easy.

* "g_ctf_capturepress" Default: 20
This sets the duration of the button press for capturing a flag from
the enemy's base (in tenths of a second). Setting this to -1 means that
a button press is not required- you can walk up to the flag and capture
it immediately.

Set this to a large value to make it difficult to capture a flag from
an enemy team's base. A player will have to stand in front of the base
while pressing the button and be vulnerable to attack. This allows
snipers to guard a base. Setting to zero is not recommended-- it will
be too easy for the opposing team to re-capture their flag and prevent
a score.

* "g_ctf_returnpress" Default: 15
This sets the duration of the button press for returning a flag to home
base (in tenths of a second). Setting this to -1 means a button press
is not required- simply walk up to the spot where the flag should go
and it will attach to the base immediately.

Set this to a large value to make it difficult to return a flag to home
base, and keep the snipers happy.

* "g_ctf_drophold" Default: -1
This sets how long a player must hold the 'use' key in order to drop a
flag (in tenths of a second). Setting this to -1 will disable intentional
flag dropping.

Setting this to a value of 20 would enable flag dropping, and require a
player to hold the use key for 2 seconds in order to drop it. This would
allow players to intentionally hide a flag from the opposing team, or
allow a player to hand off their flag to a teammate.

* "g_ctf_friendlyreturn" Default: 7
This determines how much time (in seconds) after a player captures their
own team's flag that it will return automatically to their own base.
Setting this to 0 will cause the flag to immediately return home. Setting
this to -1 means that the flag will not return home.

Setting this to a large value means that a player needs to stay alive
for awhile after they pick up their team's flag in order for it to return
to home base. Disabling flag return by setting to -1 will allow a team
to hide their own flag by having a teammate carry the flag and hide
somewhere.

* "g_ctf_groundreturn" Default: 25
This determines how much time (in seconds) after a flag sits on the ground
that it will automatically return to its base. Setting this to 0 will
cause the flag to immediately return home. Setting this to -1 means that
the flag will not return home.

Setting this to a large value will give a team the chance to recapture a
flag and continue their progress if their flag carrier drops the flag by
being killed. Setting this to 0 would mean that the flag carrier must stay
alive during the entire journey back to home base. Setting to -1 is not
recommended-- the flag could potentially be lost somewhere for the
remainder of the round.

* "g_ctf_dropdelay" Default: 20
This sets the amount of time (in tenths of a second) after a flag is
dropped that it cannot be picked up by any player. The flag will be
semi-transparent while it is disabled.

Set this to a large value to lengthen the amount of time players will
fight over a flag once its dropped. Setting to 0 is not recommended
and may make certain functions not work.

* "g_ctf_announce" Default: "dropped atbase"
This setting controls the announcing of the flag positions for given
events. The format is the list of events in which to announce the flag
position. The possible events are:
"captured" -- Announce the flag position when a player picks up
a flag. When not set, the position will be a generic
'Axis/Allied Player'
"dropped" -- Announce the flag position when the flag is on the
ground. When not set, the position will be 'Ground'
"atbase" -- Announce the flag position when the flag is at a
team's base. When not set, the position will be
'Axis/Allied Base'
"abbr" -- Include this option to announce the flag positions in
abbreviated format.
"none" -- Set the cvar to "none" to disable all flag position
announcements.
Note that flag positions will only be announced for maps that have a
map description set up (currently mohdm2, mohdm4, and mohdm6). If a map
doesn't have a description available then you will only get the generic
announcements.

Setting these options will keep the game moving forward by showing
players where the flags are.

* "g_ctf_announcefreq" Default: 8
If announcing the flag position when "captured" is enabled, this
setting controls the frequency that the flag position is updated.
Set to the number of seconds between updates of the flag position.
If set to 0, then only the position at the spot of capture will be
announced.

Setting this to a small value will make it impossible for the flag
carrier to hide or stay alive. Set this to a large value to give
them a chance but not allow them to completely hide.


Map-Specific Customization
--------------------------
The game can be further customized by having map-specific rules. In order
to do this, set a cvar named "g_ctf_<mapname>_settings" to a list of
settings to be used for the map. For example, setting the cvar
"g_ctf_mohdm2_settings" to:

"returnboth: 1 alliedbase: 297 -2115 -22.62 180 axisbase: -3237 270 24.97 0 drophold: 20"

will adjust the rules for Destroyed Village to place the bases in new
locations, require players to return both flags to their base, and enable
intentional flag dropping.

If a map-specific setting is set, it will override the general setting
cvar. You can review the current settings during any game by reading
the cvar "g_ctf_currentsettings", which will give a list of all settings.


Capture-The-Flag for Custom Maps
--------------------------------
Setting up Capture-The-Flag for a custom map is easy. Most of the code
is placed in library files that you simply need to distribute with your
custom map. The library files are as follows:
/global/libmef/ctf.scr
/global/libmef/mapdesc.scr
/global/libmef/util.scr
You will then need to modify your map script to initialize a
capture-the-flag game. Use one of the stock map script files included in
this map pack as a template for your own map's script file. The map
script file for mohdm3 (Remagen) is the simplest one to use as a template--
the axis and allied bases are in the same position every round. Check out
some of the others for more complex examples that show you how to place
the bases in random locations each round.


Other useful cvars
------------------
g_ctf_version -- is set to which version of CTF you are running
g_ctf_devmode -- set this to 1 in order to start a round immediately with
only one player in the game. Useful if you want to tweak
settings or change base locations by yourself
g_ctf_currentsettings -- lists all the current settings of the ctf game
that is running
User avatar
Cheech
Corporal
Posts: 25
Joined: Mon Jul 21, 2003 5:41 pm
Location: Germany
Contact:

Post by Cheech »

:D
hi RIC-HARD
yeah great, thank you very much
visit our region in moh
www.steinhuder-meer.us
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post by omniscient »

wheres chong?
Image
User avatar
Cheech
Corporal
Posts: 25
Joined: Mon Jul 21, 2003 5:41 pm
Location: Germany
Contact:

Post by Cheech »

:lol:
i don?t know.
visit our region in moh
www.steinhuder-meer.us
mefy
Corporal
Posts: 33
Joined: Tue Oct 21, 2003 2:57 am

Post by mefy »

I've posted a tutorial on setting up a custom map for CTF and FT:

http://mefymods.clan-dwr.com/viewtopic.php?t=23

This is for the CTF that is built into the latest version of the mod, not CTF version 1.2.
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

this is in mefys tut
Before you begin you should:

1) Understand the pak file format, know how to extract files from a pk3, and how to create a new pk3.

2) Understand how to edit .scr files with a text editor.

3) Know how to enable and use the mohaa developer console.
I have enabled developer1... is there more instructions on using this feature somewhere?
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

1) post necromancy :P
2) in "Advanced" there;s a checkbox clled console. click it.
3) to get full developer access use these lines as well.

+set thereisnomonkey 1 +set developer 1 +set cheats 1

also, i'm not sure how it afffects console-usage but i always load my maps like

devmap m1l1a

for example. devmap <mapname>
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
Mj
Map Reviewer
Posts: 1394
Joined: Sun Apr 25, 2004 3:36 pm
Location: England

Post by Mj »

oooooooh double post!! *slaps lizardkids wrist*

Now, after that bit of spam... heheh
ImageImage
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

post necromancy
sorry its all pretty new to me... 8-)
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

*cries*

I hate double or triple posting. i refresh and resend the info and it *sniff* DOUBLE POSTS! *wails*
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

lizardkid wrote:*cries*

I hate double or triple posting. i refresh and resend the info and it *sniff* DOUBLE POSTS! *wails*
Hmm I think you should be able to delete your own posts :? Can you see this button @ top of posts?

Image
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

no only admins or mods can delete posts after they've been answered. I can only delete a post of mine if it hasnt been answered. i can, however, delete it as someone is posting :twisted:

It's a default PHPBB thing, it's set in the user permissions (or something like that, havent been an admin for a long time).
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Post Reply