Текущее время: 27 апр 2024 21:33

Часовой пояс: UTC + 3 часа


Правила форума


Внимание! Все права на материалы опубликованные в этом форуме принадлежат их авторам! Перепечатка туториалов и статей разрешена только со ссылкой на этот сайт! В противном случае факт перепечатки считается нарушением авторских прав!



Новая тема Ответить
Страница 1 из 1
[ 1 сообщение ]
Автор
Сообщение
Заголовок сообщения: Basic Tutorial for Converting SP maps to COOP
СообщениеДобавлено: 07 апр 2013 23:30
http://www.rtcwcoop.com/forum/viewtopic.php?id=77

Hey!

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. Also do note, that the mod is still in process. So if any changes are applied to the COOP maps, you must make the edits for your custom maps. So if you think about quickly making something, and never show up again, don't bother. If you need to ask something, ask it here... Ok gl and hf!

1. Here are the links for some info and CMDS. These might not be up-to-date, so CHECK how it is made in the last mod version!

http://code.google.com/p/bzzwolfsp/wiki/Mapping
http://code.google.com/p/bzzwolfsp/wiki/HowTo

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

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

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

5. 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, AND it will create you a file called mapname.ents (this is found in "user/myfiles/main/maps/" and in that file goes every entity you want to ADD into the game, like new coop AI's, spawnpoints, flags and such). You must add 8 spawnpoints per place. So now you should have 8 coop spawns in the map starting place.

6. 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 spawns operating with it. Command /dumpflagpole will add a flag. Now you add 8 new spawnspoints around the flagpole. If you need more flags, just redo these steps.

7. Add a couple axis spawnpoints. Same method, but check the existing ents map for info!

8. 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!

9. Go to the ents file. You can see that new AI appeared. Give him a skin (look at existing maps) for body and head. Then give it a spawnflag to define the activity: 1 is active at map start, and 0 is not. Mostly you make them 0.

10. If you made the AI not active at start, you must alert it from a trigger of your choosing. 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

11. 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
}
}

12. Now we must add a script_multiplayer entity. It will be used in coop.script file (more later). Put this on to the top of the .ents file:

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

****NOTE FOLLOWING THINGS CHANGE OFTEN, CHECK WHAT IS CURRENT WAY TO MAKE IT, AND KEEP IT UPTODATE!!!****

13. 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
}
}

14. 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. This again MIGHT CHANGE, check the existing maps! Do everything exactly like we have. Keep careful eye for new commands and where everything is located.
14.1. spawn event should provide the player with AMMO, items, and start the music. Nothing else.
14.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
{
}

14.3. New feature. 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

cvar g_episode 4

objectivesneeded 2
numsecrets 1

globalaccum 0 bitreset 0 //Destroy secret door once

trigger counter2 cleanup

#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
}

14.4. Player scriptblock accums does not work right for many players. This why we added a new feature for the next release (0.9.5.). If you do this for 0.9.4. You will crash. For every accum command inside player scriptblock you must add word "global" in front. Otherwise it will work only in local play. See example in 14.3.
14.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.
14.6 To be extra safe, go through game_manager before ending the game, to check if the objectives are done.

15. Place the 3 new files back into the custom map's pk3 file (maps folder).

16. 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.

17. If anything goes wrong for COOP, fix it. This is just the most basic stuff that should get it to work right. You might need to change things if they did not work. It's possible I forgot something now. And things certainly change, keep your map up to date with the mod!



Камрады, кто на ТЫ с английским, асильте плиз качественный транслэйт ;) :2beer:
Показать сообщения за:  Поле сортировки  
Страница 1 из 1
[ 1 сообщение ]

Часовой пояс: UTC + 3 часа


Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 13


Кто сегодня был на конференции за последние 24 часа

Пользователи смотревшие этот форум за последние 24 часа: нет зарегистрированных пользователей и 138 гостей


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения
Перейти:  

Работает на phpBB © 2000, 2002, 2005, 2007 phpBB Group
Русская поддержка phpBB