gc8 981 Posted February 2, 2019 Hi i don't know if it's because I am tired or something but I can't get this simple remoteExecCall to work on dedicated server. Here's my code (in init.sqf): if(isServer) then { _target = west; "TEEEST! 123" remoteExecCall ["hint", _target]; "JIP TEST! 123" remoteExecCall ["hint", _target, true]; }; i create the server and join it but no hint message is displayed once I'm joined. What's wrong? thx! Share this post Link to post Share on other sites
pierremgi 4910 Posted February 2, 2019 There is no reason to fail. Your first hint is just useless. It's crushed by the second one. The second one is OK. You just have some loading scenario delay or something like that. Check the delay between player reaches the game (or lobby) and when he's in game. A heavy scenario can take some time to load. Avoid, as far as possible, any remote execution for such things. Such hint is better from initPlayerLocal.sqf In you have some reason to "string" on server, perhaps you could publicVariable your string from initServer.sqf, then hint directly in initPlayerLocal.sqf Share this post Link to post Share on other sites
gc8 981 Posted February 3, 2019 11 hours ago, pierremgi said: Your first hint is just useless. It's crushed by the second one. Yes I thought so but the first hint is there in case the JIP one didn't work for some reason. 11 hours ago, pierremgi said: Avoid, as far as possible, any remote execution for such things. Such hint is better from initPlayerLocal.sqf Yeah this was just a test to figure how the system works. Well haven't got it working yet Share this post Link to post Share on other sites
gc8 981 Posted February 3, 2019 Another test testRE = { diag_log ">>> testRE CALLED! <<<"; // Never reaches in client }; if(isServer) then { _target = west; diag_log ">>> SERVER CALLING remoteExecCall test <<<"; // Is printed on dedicated server remoteExecCall ["testRE", _target]; remoteExecCall ["testRE", _target, true]; }; But that too doesn't work Share this post Link to post Share on other sites
gc8 981 Posted February 3, 2019 Ok I found a solution, I had to put sleep 20 after the isServer and then it works. I guess the client isn't ready to receive the remoteExecCall. Not sure how to properly fix that though, suggestions are welcome. Share this post Link to post Share on other sites
Grumpy Old Man 3549 Posted February 3, 2019 13 minutes ago, gc8 said: Ok I found a solution, I had to put sleep 20 after the isServer and then it works. I guess the client isn't ready to receive the remoteExecCall. Not sure how to properly fix that though, suggestions are welcome. Depends on what you want to achieve, you seem confused considering your usage of remoteExecs with isServer checks from inside init.sqf. Cheers 1 Share this post Link to post Share on other sites
gc8 981 Posted February 3, 2019 2 minutes ago, Grumpy Old Man said: Depends on what you want to achieve, you seem confused considering your usage of remoteExecs with isServer checks from inside init.sqf. Not confused anymore. The stuff in init.sqf was just a test trying to solve a problem I had elsewhere in my project. I'm probably going to put the functions I need to be ready at startup to preinit Share this post Link to post Share on other sites
pierremgi 4910 Posted February 3, 2019 7 hours ago, gc8 said: Another test But that too doesn't work Wrong! I got it in the rpt file. Check for your parameters at launch. Difficult to understand what you're trying to do, just relying on wrong interpretations. How preinit could help? The problem here, is more a wrong title for the topic than the impossibility to help for something you keep secret. Share this post Link to post Share on other sites
gc8 981 Posted February 3, 2019 @pierremgi I already got this solved like I said in my post. The problem seems to be if you remoteExec hint too early in mission when the client is not yet ready the hint will not show. Also if you remoteExec a client function too early when the function does not yet exist it will also fail. So I moved the creation of the function to preinit and now everything works because the client function is created before the remoteExec, in the preinit Share this post Link to post Share on other sites
pierremgi 4910 Posted February 3, 2019 1. I succeeded in your tests, simply following your code in init.sqf. My rpt files are filled as intended. 2. You can just trust in initialization order, preInit is not mandatory. Share this post Link to post Share on other sites
gc8 981 Posted February 3, 2019 3 minutes ago, pierremgi said: I succeeded in your tests, simply following your code in init.sqf. My rpt files are filled as intended. Perhaps lag in the client loading caused the situation. Can't think of any other reason. For my project preinit was the solution Share this post Link to post Share on other sites
pierremgi 4910 Posted February 3, 2019 Just now, gc8 said: Perhaps lag in the client loading caused the situation. Can't think of any other reason. For my project preinit was needed Lagging or not, initPlayerLocal will run before init.sqf in MP, or I missed something. 1 Share this post Link to post Share on other sites
gc8 981 Posted February 3, 2019 6 minutes ago, pierremgi said: Lagging or not, initPlayerLocal will run before init.sqf in MP, or I missed something. Guess I could have tried that too thx! Share this post Link to post Share on other sites