Create a gamelogic, name it "Server"
The name you gave "Server", has nothing to do with Servers, you could have simply named it "Hotchocolate" and it would do the same job
EG.
?(local server):
?(local Hotchocolate):
The above two line checks whether the machine that the script is run on is the server
What the lines actually says is
Is "Server" or "Hotchocolate" local (true) on this machine?"
If it is, then it must be the server, because gamelogics are only present on server machines
_____________________________________________________________
You can then add further commands to the line
eg
?(local server): exit
The script will not run on the server machine
______________________________________________________________
?(local server): goto "Start1"
#Start1
The above line if run on the server will have the script jump to the "#Start1" line, missing any lines out inbetween
_____________________________________________________________
? !(local server): exit
The above line will cause the script to exit, if the script IS NOT being run on a server
Other lines of interest
?(Local Player):
Used to check if the machine that the script is running on is NOT a dedicated server
or if you want it run only on a dedicated server
? !(Local Player):
?(Local server): will run on a player/server machine as well as a dedicated server
Scripts or lines of scripts that are normally run on a server only are things like
Adding scoring
Vehicle respawn
______________________________________________________________
The rest is purely theory. I may be completely wrong here and i am sure if i am someone will blow this opinion away
My opinion is that
Triggers loop extremely quickly checking to see if its condition is true, probably the same speed as the @ command rechecks to see if the condition that follows it, is met
Whereas Scripts loop or run at whatever speed you set
Majority of scripts that i have seen loop at 1 second or 0.5 seconds. This is relatively slow for a cpu to deal with as long as there arent too many lines to run in one go
I have seen some scripts written to loop at 0.01
The above loop speed i wouldnt particularly want to use, as i would expect this would stress the CPU too much
So in my opinion, if using a script can remove triggers, use a script
The only advantage i see with triggers, is that they apparently help to synchronise with each other on the various clients and server
I stongly believe that scripts, correctly written and optimised cause far less cpu stress than triggers
Additionally, a lot of scripts i have seen, including some i have written are not optimised anything like as well as they could be
For instance, i have seen scripts written that have lines running on both the client and the server, when really there was only need to have them running on one or the other, but not both
So if you want to optimise your mission to the optimum, you have to look at each individual line and ask, where does this line need to be run, and then put the Server checkline infront of that line, to deal with it as you want
If you have a script that runs 20 lines all in one go, seperate them with a wait command, even a ~0.01 is a long enough wait to relieve stress on the cpu
(A question arises here (How quickly does a ~ command loop to see when time is up)
If a script doesnt need to loop every second, then slow it down so it doesnt
Another tip, and this i have no idea how it would affect efficiency
If you have global variables that are no longer used in thje rest of the mission, then at the point where they become redundant delete them by using the Variablename = nil. This gets rid of them from memory
Keep variable names as short as possible
Dont have ;;Commented lines in loops
other tips
Restrict the viewing distance
setviewdistance 1000
Dont use a lot of high firerate vehicles, eg shilka, vulcan
Dont have too high a density rain
Dont use fog
Have AI spawn when you get within a certain distance, dont spawn them before
Limit the number of fires you have on a night mission
Dont add too many objects, especially houses, bushes etc
The less textures that have to be drawn the better the framerate
Desert, no buildings = Great
Lipany with additional bushes, buildings etc, a killer
Run as much clientside as possible, reduce the net traffic between server and client as much as possible
Get rid of coloured smoke, just use white