OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Yabsa on 07 Jan 2004, 00:21:30

Title: Server VS. Client, what goes where?
Post by: Yabsa on 07 Jan 2004, 00:21:30
I know the title of this thread is a little on the confusing side (and could possibly be in conflict with the rules of the forum, but I can't think of an adequate title for my question (sorry)).  Anyways, I'm working on a co-op mission, and, as the title may imply, I am confused as to what to execute on only the server, and what to execute on the clients.  When you use CreateVehicle, will running it on the server create the appropriate effect for all the computers (ie. will everyone see the same thing?), and if so, how would I go about running the command on the server?  (The comrefs I've perused seem to indicate this, but I would be happy if one of you confirmed it.)  Also, I want a considerabe, nay, absurd, amount of text radio (I love the Sidechat command), and the Comrefs tell me to "execute it on all computers", how would this be accomplished?  If there is a tutorial that explains this in a comprehensive fashion, point me to it.  Also, please inform me if I have violated any rules or conventions with this first post of mine, thanks.
Title: Re:Server VS. Client, what goes where?
Post by: deaddog on 07 Jan 2004, 01:34:31
To run code on the server only do this:

Create a gamelogic and call it "server".  It can be named anything but "server" just makes more sense.

Any code  you want to run on the server only do this:

?local server:whatever......

You can even put that as a condition for a trigger:
local server

or you can use
!local server

to make sure a remote machine runs it only.


Game Logics only appear local on the server, that is why this works.

Go here:
http://www.ofpec.com/editors/browse.php?category=1_4
Title: Re:Server VS. Client, what goes where?
Post by: Yabsa on 07 Jan 2004, 01:54:17
Thank you very much for the reply, I'll see what I can do with this information.