Home   Help Search Login Register  

Author Topic: theoretical Q on public var  (Read 970 times)

0 Members and 1 Guest are viewing this topic.

gundernak

  • Guest
theoretical Q on public var
« 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

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:theoretical Q on public var
« Reply #1 on: 25 Nov 2003, 19:15:28 »
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
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

gundernak

  • Guest
Re:theoretical Q on public var
« Reply #2 on: 26 Nov 2003, 17:35:42 »
thanks for your answer

bye