Jump to content
Sign in to follow this  
SpaydCBR

How do you make an SP mission MP compatible?

Recommended Posts

So I've made a few SP missions and have gotten the hang of the editor, but I notice that they don't really work the way they should for MP (basically all I do is make all members of the squad "playable" for coop). This makes me think that there are specific ways to make MP missions and was wondering if you guys know any tutorials or general tips on making my SP missions MP compatible.

Share this post


Link to post
Share on other sites

You need to separate the "server" scripts from the "client" scripts. No real method for that other than going over the scripts and seeing what needs to run where and separate/rewrite the code.

Share this post


Link to post
Share on other sites

I see thanks for the info. Is it possible you could tell me how to do that? Like what do I change to make a server script. I don't really know how to script.

Share this post


Link to post
Share on other sites

Most basic 'editing' done through the map editor will work in both single and multiplayer. The issue is when you run external .SQF scripts through your mission folder (using a text editor from your desktop). These scripts are often used to spawn items, create advanced patrols or create complex gametypes such as capture the flag. The trick is understanding the difference between clientside/serverside functionality.... no easy task ;)

I would suggest:

* Reading through one of the many scripting guides available on this forum.

* Watching some youtube tutorials.

* Downloading some simple multiplayer missions from armaholic and reverse engineering them.

Share this post


Link to post
Share on other sites
basically all I do is make all members of the squad "playable" for coop

Thats the general idea, but then too depends on what scripts you are using, so the question is what scripts are you using that are not working for mp?

Share this post


Link to post
Share on other sites

Well i found out a bunch of stuff don't work in MP and I was just wondering if there were some general tips on making MP missions. Like objectives don't complete for anybody but the host for example.

Share this post


Link to post
Share on other sites
Well i found out a bunch of stuff don't work in MP and I was just wondering if there were some general tips on making MP missions. Like objectives don't complete for anybody but the host for example.

you would need to sync all execution of your completion code. You could use the BIS mp function to do this for you. (have a look at a few of the other recent threads in the scripting forum, you should find it. Or have a look on the biki:

http://community.bistudio.com/wiki/BIS_fnc_MP

You could put your completion code into a script, and then have it execute and sync using this:

[[[],"playerConnected.sqf"],"BIS_fnc_execVM",true,true] spawn BIS_fnc_MP;

Obivously change the script name to yours, this should execute your completion script to all players, and even the Join in progress ones (another area you have to be careful of)

Share this post


Link to post
Share on other sites
Well i found out a bunch of stuff don't work in MP

You need to be specific and give me examples, what scripts you used, or what you did.

Tasks are an example but theres a few way to do tasks, again lets see what you have.

A tip would be to make a simple coop and then add one script and then test.

Considering with a coop your basic script required is the Description.ext, if you just setup a simple base respawn and it works, then determine what other

features you want the mission to have.

When you decide on another feature then locate a script, test it in a simple mission in sp, and mp and see what it does, see what the scripts look like, open them up,

and look at the coding, determine if a particular script will share an init script or not thats if they use one, all depends.

I have in my day since 2007 ran a gameserver with a close friend to do coops, had built many coop missions, and have used numerous scripts,

and never really had any issues with things not working, maybe a couple of times but I usually figured it out, or threw out the idea, then theres some things I never used.

Again I ask you, if you give me a mission that you built, and list what scripts you have used, and then what is not working, give examples use a mission you are having issues with and let us see what you got, from there we can see what troubles you are having, to me thats how you learn, finding out what you did wrong. trial and error in this game will teach you many things.

Share this post


Link to post
Share on other sites

You don't have to be good at scripting to make great multiplayer missions. But, you should understand how multiplayer scripting works, locality, and what local/global commands do. Multiplayer_scripting and Locality_in_Multiplayer and Multiplayer_framework

Also, when starting it's hard to understand that triggers are local (unless you add "isServer && this") to condition, and what that means. This thread might be helpful, try reading it.

Share this post


Link to post
Share on other sites

Alright thanks for the replies. Guess I'll need to try some of the stuff you guys suggested. I'll work on a SP mission and when it's ready to be converted to coop I'll try to ask more specific questions if I need to, and I know I will.

Share this post


Link to post
Share on other sites

Basically, if objectives only complete for the host, it means the scripts for completing objectives don't run for the client, and you'll have to take a look at those scripts and modify them to run correctly. Usually you would want only the server to decide whether the objective was complete or not, and then use publicVariable to let all clients know that it is completed so they can all run the "objective completed" script.

As said, start small. Make a mission with just the editor and no scripts. Then start adding scripts/features 1 by 1 Dnd don't add another script/feature until the first one is fully tested to be working properly in MP. That way you'll have the easiest time figuring out what needs to be done to make scripts mp-compatible. If you start with a huge amount of scripts/features right away, you'll get lost pretty quickly.

The most simple example is a trigger that spawns enemies. A trigger normally runs for all players as well as the server, and thus while in SP it will only spawn 1 group of enemies, in MP it will spawn a group for each player connected, and to prevent it you'll have to make sure the trigger's code is only executed on the server, using if (isServer) then {...}; If you use something like UPSMON then again it will normally only work properly when you execute it on the server.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×