OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: haroon1992 on 08 May 2010, 15:34:18

Title: How to do multiplayer scripting?
Post by: haroon1992 on 08 May 2010, 15:34:18
I need some advice on creating multiplayer script.

-The dos and don'ts of multiplayer scripts..

-Co-op scripting..

-Assigning a variable value to a specific player and updating that variable so that the variable is the same for all other players.I am saying about making a variable become GLOBAL.
(For example, player1 has got a Truck and the variable "truck" is now 1..... and that variable should also be 1 for all other players..... I.E if they call out the status screen (just a custom dialog),they'll see that player1 has 1 Truck)

-About the SetVariable command and GetVariable command and how to use them.(The command reference lacks sufficient information about these command)

- A simple example describing how to update a variable and how to make it global.
- Another example of a very very simple revive script.(player fall unconscious for sometime and then gets back on feet)

(I've posted similar threads on this site AND/OR other websites but it was ignored by others,I hope people pay attention this time)

Good Luck for everyone,
Sincerely,
Haroon1992



Title: Re: How to do multiplayer scripting?
Post by: h- on 08 May 2010, 15:49:33
Well, maybe the OFPEC MultiPlayer Scripting Tutorial (http://www.ofpec.com/ed_depot/index.php?action=details&id=79&game=ArmA) helps you ;)
It's done in early ArmA1 time but as far as I know most of it still holds.
Also the BIS Community Wiki most likely holds good info on these things too..

As for set/getVariable I don't think they need any special handling in MP, at least I have not had any problems with them using them like in SP (I'm far from being any good in MP scriptign though). I guess you just need to remember to set the global switch to true so that JIP players get the variables when joining :dunno:
Code: [Select]
blah setVariable ["blahvariable",234,true];
Title: Re: How to do multiplayer scripting?
Post by: kju on 08 May 2010, 18:12:36
http://community.bistudio.com/wiki/6thSense.eu:EG
http://rte.jonasscholz.de/blog/

Check the work of Sickboy, Xeno, Benny.  :)
Title: Re: How to do multiplayer scripting?
Post by: haroon1992 on 09 May 2010, 14:27:00
So you mean there is no one in this community who is proficient in multiplayer scripting....or is there any professional multi-p scriptors in this forum?

I always get confused by the references that people gave me.
I just wanted the answer right here on this thread.........

Sorry if anything becomes an offense to anyone......
With Lots of Hopes,
Haroon1992
Title: Re: How to do multiplayer scripting?
Post by: bedges on 09 May 2010, 15:19:46
Quote
I just wanted the answer right here on this thread

 :dry:

This is a voluntary Community. It's unlikely that anyone has the free time to hold your hand through something as complex as learning Multiplayer editing. The links provided above lead to resources which have been created to help you learn. A lot of time and effort went into creating those resources. Is it too much to ask that you spend some of your own time reading and learning from them?
Title: Re: How to do multiplayer scripting?
Post by: fleepee on 09 May 2010, 20:05:10
I was thinking the same things... :D
Title: Re: How to do multiplayer scripting?
Post by: Ironman on 10 May 2010, 01:30:50
The biggest thing to know for multiplayer scripting is whether or not you want a scipt to run on a Server, Client, or both. This is called the scope. As long as you get the scope right you could be using script from single player missions and they should run just fine.
Title: Re: How to do multiplayer scripting?
Post by: haroon1992 on 10 May 2010, 15:53:31
Really very very sorry guys.......
it's my fault..
Title: Re: How to do multiplayer scripting?
Post by: Inkompetent on 11 May 2010, 00:38:19
Also in the command reference (be it here on the BIS wiki) you can see if commands are local or global, and if the effect of the command is local or global, and (practically) every existing script command has that information written for it, so that one knows at which machines the command has to be run.

That, and the by kyu linked pages, are about the best information one can get aside from read other peoples' scripts.
Title: Re: How to do multiplayer scripting?
Post by: haroon1992 on 11 May 2010, 14:28:41
I found the following line on BI Page
    Note: All static objects are local everywhere.


I have a question,
if I blow up a building in MP, will it affect other players?(ie will that building fall down in other client's computer?)
Title: Re: How to do multiplayer scripting?
Post by: Loyalguard on 11 May 2010, 15:56:54
If you blow it up with a weapon, yes. If you use setDamage, probaly no unless you use setDamage on every machine (including the server and JIP players). My tests with setDamage indicate it is local only.