Home   Help Search Login Register  

Author Topic: Global Variables In MP  (Read 1144 times)

0 Members and 2 Guests are viewing this topic.

Chris330

  • Guest
Global Variables In MP
« on: 30 Mar 2005, 14:19:47 »
Hi :)

Just a quick question. If I define a global variable in a script is this variable able to be 'seen' by the clients aswell as the server in an MP game?

Thanks

 ;)

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Global Variables In MP
« Reply #1 on: 30 Mar 2005, 15:33:18 »
For quick question a quick answer:

If this script is running under same circumstances on clients and
on server, and variables being changed upon global events, it
will be.

Now the not so quick answer:

This really depends on how you setup your script/execution.
If you declare a global variable on a script, which is only locally
executing - no other network-participiant will ever even know
about existance of this variable.

You should predefine such variables in some init script (init.sqs),
and when changing it's state/value - use publicVariable command.

Oh and there's much more to tell about this, but it's already all been written here on these boards, and i'm too lazy now to get into
detail another one more time.

Best is you take some time and read through some threads in
multiplayer editing/scripting - that way you do not even only read
about how things has to be done - the more you'll read also about
problems and their solutions  ;)

~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