Home   Help Search Login Register  

Author Topic: What type of variables can publicVariable send?  (Read 1361 times)

0 Members and 1 Guest are viewing this topic.

GeneralCoder

  • Guest
What type of variables can publicVariable send?
« on: 16 Aug 2003, 09:14:05 »
Hi I wanted to use public variable to share array wich holds all the players in multiplayer like this in init.sqs:
comment" players is inited as players = [] in else where before this part gets executed"
players = players + [player]
PublicVariable"players"

Put that doesn't seem to work, so can't arrays be public?
Acording to command reference only types Number, Boolen, Object and Group are suported!

What type is player anyway? should be unit wich is object..?

ADD:

Just rememberd that I also need to update marker colors in client computers, but how?
« Last Edit: 16 Aug 2003, 09:21:56 by GeneralCoder »

Tactician

  • Guest
Re:What type of variables can publicVariable send?
« Reply #1 on: 16 Aug 2003, 09:43:13 »
players = players + [player]
PublicVariable"players"

Put that doesn't seem to work, so can't arrays be public?
Acording to command reference only types Number, Boolen, Object and Group are suported!

An array is not a number, boolean, object, or group.  An array is a separate data type.  You can't publicVariable arrays.

To change a marker's color you could do something like this..

markerColors = ["","ColorRED","ColorBLUE","ColorBlack"]
marker1Color = 0

Code: [Select]
;; script that waits for marker 1's color to change
#start
@marker1color > 0
"markername" setMarkerColor (markerColor select marker1color)
marker1color = 0
goto "start"

And to change the color for everyone, just have 1 client execute:

Code: [Select]
marker1color = x; publicVariable "marker1color"

GeneralCoder

  • Guest
Re:What type of variables can publicVariable send?
« Reply #2 on: 16 Aug 2003, 16:19:12 »
An array is not a number, boolean, object, or group.  An array is a separate data type.  You can't publicVariable arrays.

To change a marker's color you could do something like this..

markerColors = ["","ColorRED","ColorBLUE","ColorBlack"]
marker1Color = 0

Code: [Select]
;; script that waits for marker 1's color to change
#start
@marker1color > 0
"markername" setMarkerColor (markerColor select marker1color)
marker1color = 0
goto "start"

And to change the color for everyone, just have 1 client execute:

Code: [Select]
marker1color = x; publicVariable "marker1color"

Ok so no change sending arrays... thanks for that marker exampe though!

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:What type of variables can publicVariable send?
« Reply #3 on: 17 Aug 2003, 02:24:39 »
Quote
Ok so no change sending arrays... thanks for that marker exampe though!

There is a chance for transfering arrays

Check out CoC Network services and you'll see  ;)

http://www.website.thechainofcommand.net/

~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