OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: gundernak on 25 Nov 2003, 18:23:20
-
Hi,
I would like to know public var is what for?
Is it possible altough I made so many conditions and activations with variables defined in Init.sqs, these thing will not work in MP, if I did not use public variables?
I hope I am clear
thanks in advance
-
PublicVariable is used locally to transfer:
numeric variables/ booleans/object-unit-groups
to all other applicants.
This means:
whenever one of the above listed stuff is changed locally,
you can use PublicVariable to syncronise it in your network.
example:
A script, which is running server side (let's say a script to
calculate the score)
variable: score_unit_1 = 0
Now you alter this variable server side
score_unit_1 = score_unit_1 + 1
Then you would send the updated variable score_unit_1
through the network to update the value for everyone.
publicVariable "score_unit_1"
voilla.
P.S:
don't get irritated by my server side example, same can
be done from client side to everyone.
The only thing you need to find out is: what happens where?
To post this here, it might take a few pages, so i suggest
you to have a look every now and then into forum threads,
and off course do testings for yourself too.
e.g: ask other players online in your game, wether they have
seen the same stuff on their machine, as you have.
~S~ CD
-
thanks for your answer
bye