It is currently Mon Apr 29, 2024 11:16 am

RUNNING WITH RIFLES Multiplayer

test

Game servers 39 List provided by EpocDotFr | Players online 71


All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Custom campaigns
PostPosted: Thu Jun 05, 2014 6:59 pm 
Offline
Site Admin

Joined: Mon Jun 27, 2011 11:59 am
Posts: 2856
0.96 comes with support to start custom campaigns in the new campaign menu.

A custom campaign can be configured by creating an overlay mod, with overlay_config.xml and an entry point script to takeover the gamemode control. Here's an example: http://modulaatio.com/runningwithrifles ... xample.zip. Unzip it in media\overlays so that there's a folder media\overlays\custom_campaign_example under which the files and subfolders are in. If media\overlays is missing, just create one.

The menu allows you to pick one custom campaign, so it works a bit differently from the overlay mod chooser in quick matches. If you have made your "mod suite" as several small overlay mods, you could organize it to work in campaign by creating yet another overlay, which only contains the starting script, nothing more. Several content overlay mods to be loaded in the campaign can be defined inside the script.

Here's some blabber about scripting in RWR:
Spoiler:
If you're looking into doing more extensive scripts than just overriding vanilla values or logic here and there, you'd probably enjoy a better development process than
1) start game
2) start campaign
3) wait 15 seconds to load
4) notice the script has ceased to run
5) go check metagame.log
6) resolve errors
7) go to step 1.

As most of the scripted gameplay elements in RWR are implemented as isolated "trackers", i.e. monitoring specific events received from the game/server, I regularly do tracker development directly in lobby map, in windowed mode. If it's e.g. something vehicle specific I'm doing, I set up lobby so that the vehicle is there (takes under a minute with inkscape), add my new tracker class in gamemode_tester.php, launch the game and say /_test_sp in chat in lobby map, which will run gamemode_tester.php.

If the tester script fails, it regularly does as programming errors just happen, I go check metagame.log what's the issue, correct it, and without leaving the game, again say /_test_sp in chat which will just restart the script. Works of course with other maps than lobby as well.

While that's fine for tracker components, dealing with the broader stuff can be tedious because of the 7 step cycle. There's another special command /_ssc, which can be useful if you want the script to restart as if it would've just loaded the match and would then begin doing stuff, without doing a map change. This removes steps 1-3 from the cycle when working inside a campaign. You'll probably need custom commands to help with development, and that's fine, you can do that, check the vanilla scripts, there are some examples there.

Another thing that can save you from plenty of back and forth is to use some real tools made for PHP programming, a syntax highlighter / validator is something you can't live without. I'm just barely coping with it by having Visual C++ do PHP highlighting and pre-running the scripts through some simple validation, while I know there would be better ways to save health and time. Anyway, it's great that in the end all you really need is Notepad to hack around with the scripts.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 39 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group