OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Uldics on 21 May 2004, 19:56:55
-
As I understand, all scripts are simultaneously starting on all computers - players and server and then running independent and redundant. Why is it necessary to waste such ressources and run them at all places same time? Why can't that just be that all scripts run only on the server? Then there wouldn't be any problems with createvehicle and so on, which has to be done only at one place.
-
What's your problem here?
If you know how to make mp missions it's up to you, where
you want your scripts to be running.
In some cases it's better to have them running locally for
each client and in other cases it's fine with them running server
side only?
Still: where a script is running is up to the guy who made that
mission (expecting he knows what he's doin)
~S~ CD
-
exactly, you can control where script are run, like this:
make a game logic called server
then in your script you want only run on the server put this line:
?!( local server): exit
-
Then I have to ask more precise: how do I find out, which scripts have to run on only server, only client, only all clients, all places?
-
questions you should be asking yourself are
1) Does the client need to run this script
2) Does the server need to run this script
Server doesnt require anything graphical to be run on it, eg dialogues, special effects such as heli dust etc etc
Server should control vehicle respawn, and keep a tally on the scores
weapon selection systems, player respawn etc needs to be run on clients only
Never trust a client to store important data, have the client send it to the server
AI control is serverside
hope that gives you an idea.
Every script is different, some are client only, some are server only, some are player only, some are mixed
lines you should be using are
?(Local server):
?!(local server):
?(local player):
?!(local player):
you can have scripts run on both server and clients, and have certain lines not read by cliewnts or server using the above lines
also use the above lines to execute scripts on the machine you want them, or to exit from scripts for the machines thast you dont want them to run on etc etc etc