OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: Mr.Peanut on 04 Sep 2008, 19:04:16

Title: removePublicVariableEventHandler ?
Post by: Mr.Peanut on 04 Sep 2008, 19:04:16
Does a PublicVariableEventHandler (PVEH) only fire once(first time variable is PV'd)? If not how do you delete it?

"blah" addPublicVariableEventHandler {}  ?
or
"blah" addPublicVariableEventHandler {call compile "blah" + "= nil;";}   ?
Title: Re: removePublicVariableEventHandler ?
Post by: Spooner on 04 Sep 2008, 19:28:35
It fires every time publicVariable is used. If you want it to only happen once, only use publicVariable once on that variable ;P
Title: Re: removePublicVariableEventHandler ?
Post by: Mr.Peanut on 04 Sep 2008, 19:29:52
That sucks. Destroying the variable does nothing?
Title: Re: removePublicVariableEventHandler ?
Post by: Spooner on 04 Sep 2008, 23:29:08
Well, I've never actually tried that. It really depends how they implemented it, so could go either way...

As I said, either you want to know about changes, or you don't. Not really worth only finding about changes the first time a variable is changed, is there?
Title: Re: removePublicVariableEventHandler ?
Post by: Mr.Peanut on 05 Sep 2008, 14:52:35
It depends on whether you want to dynamically create new "ports" to help handshake, or sort/queue them on one establish "port".