Home   Help Search Login Register  

Author Topic: publicVariable=bad joke?  (Read 3661 times)

0 Members and 1 Guest are viewing this topic.

PheliCan

  • Guest
Re:publicVariable=bad joke?
« Reply #15 on: 24 Jun 2003, 20:12:14 »
Some sort of three-way-handshake would work, wouldn't it?

Tactician

  • Guest
Re:publicVariable=bad joke?
« Reply #16 on: 25 Jun 2003, 01:21:01 »
I've never seen a publicVariable "dropped" in any of my missions.  Ever.  If you have that problem, you're probably using too many public functions.  Or your server needs more guaranteed packet allowance.  Acknowledgements and handshakes are NOT necessary, they only multiply the problem.

And the above example was only intended to broadcast the variable.  All it takes to make the script wait for the randomTime is another wait statement:

@time == randomTime

After the @randomTime != 0.  But why would you want to broadcast the time and do it the long, discrepancy-likely way (time will vary on every client) when you can just have the server wait for the time to be reached then broadcast the event?  Two scripts execed by all:

(first, init event = false)

Code: [Select]
;; begin serverEvent.sqs
?!(local Server): exit
_randTime = random (24)
~_randTime
event = true; publicVariable "event"
exit
;; end serverEvent.sqs

Code: [Select]
;; begin clientEvent.sqs
@event
(arbitrary code here)
;; end clientEvent.sqs

I promise it will work.  publicVar on a bool should be more reliable than on a number, eh?
« Last Edit: 25 Jun 2003, 01:23:33 by Tactician »

SteroidG

  • Guest
Re:publicVariable=bad joke?
« Reply #17 on: 25 Jun 2003, 01:46:41 »
Thanks Tactician :). This would definitly solve my problem getting random time on every machine and someone didn't get it and got into an endless loop of time adjusting.