Jump to content
MarkCode82

is isServer , isDedicated or hasInterface still revelvent

Recommended Posts

As of remoteExec and remoteExecCalls introduction? Are they still of use?

Share this post


Link to post
Share on other sites

They are if you want to make absolute sure of the locality of something, especially when debugging, but overall, with those new commands they aren't as necessary when trying to actually execute code within a specific locality scope.

Share this post


Link to post
Share on other sites

They most certainly are

Share this post


Link to post
Share on other sites

Don't forget backwards compatibility. Removing these commands now would probably cause mayhem in tons of mods and missions.

Share this post


Link to post
Share on other sites

isServer , isDedicated or hasInterface are all three used by me on daily bases. 

 

RemoteExec has nothing to do with that! You have got files like the init.sqf where you want the server to exit somewhere. You have got the init.sqf again, where you want to exit with a function for a headless client (!hasInterface).

 

Andyou have got function that you execute on all clients, but a HC or the server should not perform all the code from it.

 

Maybe you had no use for that function, but I can clearly tell you, that those a pretty important, and a removal of something is nonsense too. (Like removing the good old 2D editor #R.I.P)

 

 

Regards Arkensor

  • Like 1

Share this post


Link to post
Share on other sites

you can get away with only one use of each of those commands during initialization, but cant avoid them entirely if you have a need to check those things.

 

one example is in preinit=1 functions

Share this post


Link to post
Share on other sites

but isn't it better to partition the data into.
initServer.sqf
initPlayerServer.sqf

initPlayerLocal.sqf
?
Rather than use init.sqf ?

 

Because I've successfully kept most code executed locally on the server via initServer.sqf for weather values and then push the updates to the clients server-side via initServer.sqf and [time,value] remoteExec ["setRain",player,false];

Share this post


Link to post
Share on other sites

Sure, but it does essentially the same thing as handling it in the normal init.sqf, I prefer the event scripts that you've mentioned, but some people haven't moved over to those yet, it's a matter of personal preference (I'm not sure if there is any optimizations to using the event scripts over separate handles within the init.sqf or not).

  • Like 1

Share this post


Link to post
Share on other sites

but isn't it better to partition the data into.

initServer.sqf

initPlayerServer.sqf

initPlayerLocal.sqf

?

Rather than use init.sqf ?

 

Because I've successfully kept most code executed locally on the server via initServer.sqf for weather values and then push the updates to the clients server-side via initServer.sqf and [time,value] remoteExec ["setRain",player,false];

 

Even then you have situations in which you need these commands. Headless clients for example run the iniPlayerLocal just as any real player. Also things like mission flow (FSM), trigger fields, etc. - everything that is run on both server and clients requires these commands.

Share this post


Link to post
Share on other sites

While event scripts mentioned above are great, if you have a script that runs on all machines but does slightly different things on server, HC and player you'd use these commands and that stops you having to write essentially the same code in three places. Less repetition = better scripting and debugging.

  • Like 1

Share this post


Link to post
Share on other sites

Not to mention, what if someone runs say, a loop thats meant only for the server, globally. Without a locality check it could cause fuckery

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×