I have little experience of MP but what about trying a script:
~ (30 + random 5)*60
or some such?
means
~ means "wait" or "pause this script from continuing for
(30 + random 5) creates a value somewhere between 30 and 35
*60 multiplies that value by 60
so what it basically states is
wait (1800 to 2100 seconds)
wait (30 to 35 minutes) before continuing on with the script
any value used with the wait function is seen in seconds
If you are new to mp scripting and mission making, there are some important facts that you need to know.
Please excuse me if some of the following is obvious to you
1) an MP sessions is made up of
..... a) A server
..... b) A number of clients (Players machines)
Objects such as units, vehicles are often local to only 1 machine at a time.
By local, i mean controlled by that one machine.
Example
AI groups with units that are only AI are controlled by the server
Some commands only work locally, eg, for them to work they must be run on the machine that is local to that object/vehicle/unit
Example of local command "setdir"
Some commands are global, meaning no matter what machine that code is run on, the command will work on it
Example of global command "setpos"
and if every machine runs that code, the unit would receive multiple setpos commands (not good)
To decide what script is run where, we have the "local" command available to us
?(Local server):
?!(Local server):
?(Local Player):
?!(Local Player):
?(local objectname):
"Local server" is often used by most scripters, there is no such thing as a "server" and is no command to call it, however what it actually refers to is an "object", namely a "Gamelogic" which the mission maker has named "Server"
and the reason for this, is that a gamelogic, is always ONLY LOCAL TO THE SERVER
and therefore
?(local gamelogicname): will only be run on a server
Now getting down to your bridge damage control system
INIT.sqs is run on all machines at the start
To repair the bridge, we will need to use the "setdammage" command
Setdammage is a global command and therefore can be run from any machine to repair anything anywhere, (within reason)
We dont particularly want the setdammage command to be run on all machines, as this would cause unescessary network traffic, so what we do, is run a script, from the server only to repair the bridge sections.
We do this by launching the script from the INIT.sqs
But first we need to create a gamelogic in the mission editor and name it "server"
INIT.sqs?(local server): [] exec "Bridgerepair.sqs"
BridgeRepair.sqs_rnd = 1800 + (random 600)
~ _rnd
{_x setdammage 0}foreach [object 167669,object 167792,object 167793,object 167794,object 167795,object 167797]
the script will basically start up when the mission starts
wait between 30 and 35 minutes
then repair each of the bridge sections on the Nogova bridge
If you wanted to maintain the bridge throughout the mission, then you would simply loop the script, say every 3 seconds or slower
BridgeRepair.sqs#START
_rnd = 1800 + (random 600)
~ _rnd
#LOOP
{_x setdammage 0}foreach [object 167669,object 167792,object 167793,object 167794,object 167795,object 167797]
~3
goto "LOOP"
PS.... I may be wrong about setdammage being global (AFAIK it is), if it is local, eg the server repairs the bridge but you dont see a repaired bridge, then run the script on all machines.
Static objects such as buildings, ammo crates etc, i believe are local everywhere, similar but not quite the same as global.
Again, if i am wrong it wont take long before someone posts to correct me
OOPS! someone posted about the wait command while i was typing this essay