f3cuk / WICKED-AI

Wicked AI missions for your server
30 stars 59 forks source link

[Recommendation] Move wai_radio_announce to remote/remote.sqf #118

Closed TeaObvious closed 7 years ago

TeaObvious commented 9 years ago

I would recommend to move the variable wai_radio_announce from config.sqf to remote/remote.sqf.

This makes sure that wai_radio_announce is only enabled if the remote/remote.sqf is included in the mission/init.sqf and then auto enables it. This is possible because wai_radio_announce is a global variable and the game does not care where it got defined.

new remote/remote.sqf: if (isServer) then { wai_radio_announce = true; }; if (!isDedicated) then { current content of remote/remote.sqf };

TeaObvious commented 9 years ago

of course you would need this code in the wai/init.sqf: if (isNil "wai_radio_announce") then { wai_radio_announce = false; };

and the remote/remote.sqf should be executed via "call compile preprocessFileLineNumbers" before the _serverMonitor got executed to reduce possible side effects.

f3cuk commented 9 years ago

Even though i get why this would be less prone to failure, i feel like it is a bad thing to seperate config into multiple files.

What we could do to check for compatibility is adding a var like radio_proof = true; to the remote.sqf and then extending the check in mission_winorfail.sqf. That way i guess you get the best of both worlds.

TeaObvious commented 9 years ago

Well yeah but this is not a config parameter then. The logic is, why would one run the remote.sqf if this person does not want to use it. And the other way arround, if one would use this new feature he has to run the remote.sqf. So the presence of this file determines if it is used or not.

Because of this logic i think its a good idea to check if this script is included in the mission file and if this is done, why shouldn't this auto activate the feature?

Its up to you but the Mission System has at least to know if the remote.sqf gets loaded on the clients.

f3cuk commented 9 years ago

Will look at this as soon as i get some spare time