Topic: Basic Tutorial for Converting SP maps to COOP

Support: Coop version 1.0.0.

I was requested to do an article about converting RTCW SP maps to COOP mod. This is a really basic tutorial, I will only give you some pointers, and you'll have to figure out most yourself. You should know the basics of SP scripting before you can efficiently convert maps, this tutorial does not cover that part. If you need to ask something, ask it here... Ok gl and hf!

1. Here are the links for some info and CMDS.  Also there is a full extended version of this tutorial that has anything you need to know!

https://github.com/fretn/rtcwcoop/wiki/Mapping
https://github.com/fretn/rtcwcoop/wiki/HowTo

2. Copy the custom maps pk3 into your game coopmain folder.

!!!TEST!!! THE MAP MUST RUN! IF NOT FIX IT OR DITCH IT! Nothing in this tutorial will make it run if it does not run now.

You can test your map by typing /coopdevmap mapname into the console. Using shortcut to do this can fail in 0.9.5.

3. Copy and remove the files named mapname.script and mapname.ai into "user/documents/rtcwCOOP/coopmain/maps/" (not game folder, this is the folder game edits!). Eg. If you take a screenshot it should appear in "user/documents/rtcwCOOP/coopmain/screenshots/" etc.

4. Rename these two files into mapname.coop.ai and mapname.coop.script

5. Let's create an ents file in the same folder with previous files. Copy paste existing .ents file from sp_pak_coop1.pk3. Or create one in notepad. Rename it to mymapname.ents. In this file goes every entity you want to ADD into the game, like new coop AI's, spawnpoints, flags and such.

6. Now we must add a script_multiplayer entity. Or the scripts won't work. Put this on to the top of the .ENTS file:

{
"classname" "script_multiplayer"
"scriptname" "game_manager"
}

7. Load your map in COOP. It will show you don't have any COOP spawns. Start out by using command /dumpcoopspawnpoint in your console. This will make your first intial coop spawnpoint. You must add 8 of these before moving on!

If your map fails to load with a script error. Check that any AI that spawns at map_start that if they have special actions, it starts after a wait. This is normal action for a mapper to do to be safe in any Q3 engine game, but apparently not all mappers know this. Eg.

nazi1
{

spawn
{
//Hey I spawn at mapstart
wait 50 //Add me or you will crash the coop map muaha
trigger nazi1 go //I wanna go when I born
}
....
}

8. (optional) Now let's create the second spawn place that has a flag. You MUST FIRST add a flagpole, so the game will link the flagpole to the spawnpoint operating with it. Command /dumpflagpole will add a flag. Add 8 spawnpoints around it straight after adding the flag pole.

If you need more flags, just redo these steps.

AXIS PLAYERS ARE CURRENTLY DISABLED!
9. Add a couple axis spawnpoints. Use command /dumpcoopspawnpoint. To turn these spawnpoints work for Axis, you must edit the spawnflags of these entities in .ents file! coop_spawnpoint has spawnflag stage in ents file that decides how to use the spawnpoint.
Currently:
(spawnflags: 0 = disabled; 1 enabled; 2 = allied and disabled; 3 = allied and enabled; 4 = axis and disabled; 5 = axis and enabled; 6 = axis and allied and disabled; 7 = axis and allied and enabled)


10. (optional)Adding a new AI (reinforcements). If you skip this, your map will still have the same AI's that you had in RTCW SP. Open the game again. Go to the location you want your first AI REINFORCMENT to spawn in. Use command /dumpcastai ai_soldier coop_ai_soldier_1. This will spawn ai_soldier named coop_ai_soldier_1 into the location you stand at. If you leave the name field empty, it should name it automatically, but the numbering can be buggy!

10.1. Go to the ents file. You can see that new AI appeared. Give him a skin (look at existing maps) for body and head.

10.2. You must alert AI's from a trigger of your choosing to make them spawn. Usually in the same place the regular AI's in that map stage is triggered. Example commands to add them with:

#if g_reinforce >= 1 alertentity coop_ai_soldier_1 #endif
#if g_reinforce == 2 alertentity coop_ai_soldier_2 #endif

10.3. Now we need to give the new soldiers some attributes and script. Here is a simple example script from an existing map. Go to mapname.coop.ai and add this into the bottom. You must add this for every new ai. Usually we add around 20-40 reinforment AI's per a map.

coop_ai_soldier_1 //NAME OF YOUR NEW AI!
{
    attributes
    {
        aim_accuracy 0.6
        starting_health 60
        camper 1
    }

    spawn
    {
        setammo ammo_grenades 0
        setammo ammo_9mm 999
        statetype alert
    }
}


11. Go to your mapname.coop.script. Add something like this to the start. Objective and endmap should be linked to go through this Entity!

game_manager
{
    spawn
    {
        accum 0 bitreset 1
        accum 0 bitreset 2

        trigger player map_start    //Prevents late players affecting the game
    }
   
    trigger checkexit
    {
        accum 0 abort_if_not_bitset 1
        accum 0 abort_if_not_bitset 2
        trigger player exitlevel
    }
   
    trigger objective1
    {
        accum 0 bitset 1
    }
   
    trigger objective2
    {
        accum 0 bitset 2
    }
}

12. PLAYER SCRIPTBLOCK. Go to mapname.coop.ai. Now we need to edit the player scriptblock. This handles most of the objective and game events. This block needs quite some changes from SP. Do everything exactly like we have. Keep careful eye for new commands and where everything is located.

12.1. spawn event should provide the player with AMMO, items, and start the music. Nothing else.

12.2. All the things from playerstart event must be moved out. This is useless for COOP. However don't remove it, code still reads it, and gives you error (I think). So it will just look like this:

    playerstart
    {
    }

12.3. Add trigger map_start. In this trigger you must place everything that loads at map start up and general objective, accums etc.. This must be triggered from game_manager spawn, code does not look for it itself (we did, see above). It will look something like this:
   
trigger map_start
    {
//If something breaks at late player joining, move it here

        objectivesneeded 2
        numsecrets 1

globalaccum 0 bitreset 0     //Make a desired action

        #if g_reinforce >= 1 alertentity coop_ai_soldier_1 #endif
        #if g_reinforce >= 1 alertentity coop_ai_soldier_14 #endif
        #if g_reinforce >= 2 alertentity coop_ai_soldier_15 #endif
    }

12.4. !!!IMPORTANT!!! Player scriptblock accums does not work right. For every accum command inside player scriptblock you must add word "global" in front. Otherwise it will work only in local play.

12.5. To be extra safe, objective accums are placed inside game_manager. However, keep the objectivemet command in the old trigger (must be first command in the trigger !!!!!), then trigger the objective accum inside the game_manager.

12.6 To be extra safe, go through game_manager before ending the game, to check if the objectives are done.

12.7 New feature random respawn. Add this into your map_start:

//----------------------------------------
//Make AI reinforcements not respawn
//----------------------------------------
        #if g_airespawn >= 1
        wait 5
        randomrespawn coop_ai_soldier_1
        randomrespawn coop_ai_soldier_2
        randomrespawn coop_ai_soldier_3
        randomrespawn coop_ai_soldier_4
        randomrespawn coop_ai_soldier_5
        randomrespawn coop_ai_soldier_6
        randomrespawn coop_ai_soldier_7
        randomrespawn coop_ai_soldier_8
        randomrespawn coop_ai_soldier_9
        randomrespawn coop_ai_soldier_10
        wait 5
        randomrespawn coop_ai_soldier_11
        #endif

Change the names and amount to your map. It's recommend to have wait 5 between every 10th command.

12.8

New feature: ability to make single ai not respawn. Useful for bosses, special ais or such ais that tend to spawn without gun (quick fix for those). Add command "norespawn" to the wanted AI's spawn. Example to make nazi1 not respawn:

nazi1
{
spawn
{
//HERE IS SOME SCRIPT
norespawn
}
//HERE IS SOME MORE SCRIPT...
}

13. Place the 3 new files back into the custom map's pk3 file (maps folder). Or better to add a second pk3 that has the coop files for example mymap_coop.pk3 if it's not your own map. Or if you want to keep it it compatible with SP, because 1.0.0 is potentially RTCW compatible. Must be alphaphetically after original pk3.

14. TEST A LOT before release. You must test the maps with many players. Many things that works when you are alone, might not work with multiple players on the server.

15. If anything goes wrong or you don't understand some stage, post it here. I'll be happy to help.

EXAMPLE MAP CONVERSION BASED ON THIS TUTORIAL.
COOP Addon file: https://bzzwolfsp.googlecode.com/svn/wi … p_sage.pk3
Original File: www.rtcwcoop.com/main/christmas_map.pk3

MAJOR UPDATE! 18.9.2013. ADDED Explanations on spawnpoint spawnflags. Added some new notes and fixed couple errors.
MAJOR UPDATE! 3.1.2014. FIXED Spawnflags of spawnpoints.
Edited 4.1.2014. Added randomrespawn and changed ai spawnflags.
Edited 5.1.2014 Added norespawn that I had forgotten to add.
Edited 14.6. Updated to 1.0.0.

Re: Basic Tutorial for Converting SP maps to COOP

Also custom map loading screens, notebooks, clipboards, arena files and other cosmetic things are supported. Check my Capuzzo map on how to add them. (Some features seems to only work in local play atm).

Re: Basic Tutorial for Converting SP maps to COOP

Great !

(Put in mantis which ones only work on local servers)

Re: Basic Tutorial for Converting SP maps to COOP

Already did smile

Re: Basic Tutorial for Converting SP maps to COOP

Sage, do you need to install a separate RTCW COOP game to run and test your maps?

Re: Basic Tutorial for Converting SP maps to COOP

{WeB}*GANG$TA* wrote:

Sage, do you need to install a separate RTCW COOP game to run and test your maps?

Nah. Generally it is good, but it is not required. Aslong as you do not alter original game files you dont have to. And you should never alter them anyway. If you use the installation to HOST a regular game, remove the files while playing. When you play you load the files server has. I dont have for coop. Other games yes.

Ps. If you want to use one pk3 file between all installations place it in ...documents/rtcwcoop/main. If you want one pk3 per one installation then mygame-installation/main.

Re: Basic Tutorial for Converting SP maps to COOP

Can you show me VIDEO TUTORIAL , PLS ?

Re: Basic Tutorial for Converting SP maps to COOP

I'll make a pic version of map Relic hunt. http://returntocastlewolfenstein.filefr … 8#Download

Re: Basic Tutorial for Converting SP maps to COOP

This is the file setup in 1-4.

http://i39.tinypic.com/o06xqx.jpg

Re: Basic Tutorial for Converting SP maps to COOP

But what if I set FLAGZONES wrong and if I want to start from the beggining .
P.S. - How to I activet cheats on server so I can noclip for faster seting FLAG and that other SHItS .

Re: Basic Tutorial for Converting SP maps to COOP

Load the map with coopdevmap mapname. This enables all the dev tools such as cheats.

All the extra spawns/flags/stuff that are added from ingame are stored in ents file. Just close your game, load the mapname.ents in eg notepad and simply remove the lines.

Each entity starts with { and ends with } mark. Classname key tells us what entity it is. Target/targetname key links the flag and spawns. Spawnflags key sets the activity. Eg. you can just remove these, load game and add again. Or additionally you can move them to a different location by changing origin key.

Flag point example from a random map:

{
"classname" "coop_spawnpoint_trigger"
"origin" "-8362 -13110 -29"
"angle" "85"
"model" "models/multiplayer/flagpole/flagpole_reinforce.md3"
"target" "city0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "-8325 -12577 31"
"angle" "-19"
"targetname" "city0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "-8336 -12678 31"
"angle" "-6"
"targetname" "city0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "-8341 -12772 31"
"angle" "6"
"targetname" "city0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "-8339 -12863 31"
"angle" "18"
"targetname" "city0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "-8330 -12964 31"
"angle" "31"
"targetname" "city0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "-8223 -13036 31"
"angle" "47"
"targetname" "city0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "-8133 -13047 31"
"angle" "58"
"targetname" "city0"
}

Re: Basic Tutorial for Converting SP maps to COOP

I added FLAGS and SPAWNPOINTS for FLAGS ONLY and not for START becouse I on one map added spawnpoints for START and for FLAGS but always respawn me on START .

And when I adedd ONLY FOR FLAGS it sas " NO COOP SPAWNPOINTS FOUND " .

How to do it right ?

Re: Basic Tutorial for Converting SP maps to COOP

I have updated the tutorial! Edited from 5. ->

I noticed that the game will crash if you let the game create ents AND do not manually add script_multiplayer.

Re: Basic Tutorial for Converting SP maps to COOP

jurajkatalinic wrote:

I added FLAGS and SPAWNPOINTS for FLAGS ONLY and not for START becouse I on one map added spawnpoints for START and for FLAGS but always respawn me on START .

And when I adedd ONLY FOR FLAGS it sas " NO COOP SPAWNPOINTS FOUND " .

How to do it right ?

1) You MUST do this: Add 8 spawnpoints at start location, do not add flag at start.

Adding flag spawn is optional. But it generally is more fun in long maps.

2) Add 1 flagpole at captureable location. Add flag before adding the spawnpoints for it.
3) Add 8 spawnpoints around the flag, immediately after adding the flag
4) Close game, reload map and test.

Remember that you only can use the flag spawns when you play with Flagspawn mode (cvar g_spawnpoints 2).

Re: Basic Tutorial for Converting SP maps to COOP

How do I launch map for INTERNET DETECTED or LAN DETECTED ?
In map SELECTION SCREEN there isn't my map there .
I can only launch it by CONSLE .

Re: Basic Tutorial for Converting SP maps to COOP

jurajkatalinic wrote:

How do I launch map for INTERNET DETECTED or LAN DETECTED ?
In map SELECTION SCREEN there isn't my map there .
I can only launch it by CONSLE .


you need to make an arena file to make it show up

Re: Basic Tutorial for Converting SP maps to COOP

How to make that ?

Re: Basic Tutorial for Converting SP maps to COOP

jurajkatalinic wrote:

How to make that ?

look at the arena file in the sp_pak_coop1.pk3 folder

Re: Basic Tutorial for Converting SP maps to COOP

Was supoes RTCW COOP map look like this ? :
https://www.youtube.com/watch?v=3zvYlEWIxl0

20 (edited by jurajkatalinic 2013-11-14 12:10:40)

Re: Basic Tutorial for Converting SP maps to COOP

I still have a problem with FLAGS .

I added 8 COOP SPAWN POINTS .

Then added FLAG and immediately added 8 COOP SPAWN POINTS .

Restarted map .

Still it spawns me at the start when FLAG is ON and when I captured it .

Is there some special command for 8 FLAG SPAWN POINTS ?
I used command /dumpcoopspawnpoint for START and FLAG .

And P.S. - After editing ARENA FILE I figure out how to put PICTURES for map .
                ui_<your code map name>.jpg
                ui_<your code map name>_s1.jpg
                ui_<your code map name>_s2.jpg

And all JPG's must be placed in "levelshots" .

Re: Basic Tutorial for Converting SP maps to COOP

yes, you need to set the target and targetnames for the flags, check the original rtcwcoop mapscripts for examples

this is needed to connect flags to spawnpoints

Re: Basic Tutorial for Converting SP maps to COOP

Just look at Capuzzo. It has anything you need to have. You need your own custom named arena file. Eg. This is inside my capuzzo.arena

{
map            "city"
longname        "^nCapuzzo 1 - The City"
type        "coop_battle coop_speedrun coop_normal"
}

{
map            "airport"
longname        "^nCapuzzo 2 - The Airport"
type        "coop_battle coop_speedrun coop_normal"
}

{
map            "road"
longname        "^nCapuzzo 3 - The Road away!"
type        "coop_battle coop_speedrun coop_normal"
}

For your Flag problem, show us your .ents file content. Check that the names match. That is where your problem is. And you do first use /dumpflagpole to add the flag and then 8 times /dumpcoopspawnpoint?

Re: Basic Tutorial for Converting SP maps to COOP

HERE .

{
"classname" "coop_spawnpoint"
"spawnflags" "1"
"origin" "50 -383 32"
"angle" "-1"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "1"
"origin" "53 -304 32"
"angle" "-1"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "1"
"origin" "49 -457 32"
"angle" "0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "1"
"origin" "49 -528 32"
"angle" "0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "1"
"origin" "147 -306 32"
"angle" "-1"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "1"
"origin" "145 -379 32"
"angle" "-1"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "1"
"origin" "144 -447 32"
"angle" "-1"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "1"
"origin" "148 -530 32"
"angle" "18"
}

{
"classname" "coop_spawnpoint_trigger"
"origin" "8243 -1031 -28"
"angle" "79"
"model" "models/multiplayer/flagpole/flagpole_reinforce.md3"
"target" "christmas_map0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "8223 -1262 32"
"angle" "87"
"targetname" "christmas_map0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "8080 -1185 32"
"angle" "87"
"targetname" "christmas_map0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "8113 -1035 32"
"angle" "87"
"targetname" "christmas_map0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "8276 -912 32"
"angle" "87"
"targetname" "christmas_map0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "8426 -935 32"
"angle" "87"
"targetname" "christmas_map0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "8386 -1083 32"
"angle" "70"
"targetname" "christmas_map0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "8286 -1165 32"
"angle" "99"
"targetname" "christmas_map0"
}

{
"classname" "coop_spawnpoint"
"spawnflags" "0"
"origin" "8409 -1301 32"
"angle" "88"
"targetname" "christmas_map0"
}

Re: Basic Tutorial for Converting SP maps to COOP

The spawns seem right. But you overlooked nr 6 on the tutorial. You must add script_multiplaye on top of all that.

Re: Basic Tutorial for Converting SP maps to COOP

But when I added script_multiplayer I get an ERROR .
Custom map dosen't have ANY SCRIPTS at all , ONLY ai .