mindstorm 8 Posted November 15, 2014 So, after about 1 year of not having worked with Arma3 I decided to give it annother go and make a mission for the upcomming lan event we have. My god what an annoyance. I made my mission, tested it in the editor and everything seemed to work perfect. Started it on the dedicated server and that was about when everything broke. Example 1: Players are teleported into the cargo of a chopper at mission start. This is the choppers innit. clearMagazineCargo this; clearWeaponCargo this; clearItemCargoGlobal this; this addWeaponCargo ["acc_flashlight", 2];{this removeWeapon _x} forEach weapons this; None actually gets executed on the client. How is this possible? It's in the init afterall?!?! The cargo is not cleared, new weapons are not added. Example 2: Players should be teleported into the chopper at mission start, with a fade out before and fade in after. This is in the init.sqf: if!(isDedicated) then { waitUntil {!isNull player}; waitUntil {player == player}; titleCut ["", "BLACK OUT", 0]; player moveInCargo heliExtract1; titleCut ["", "BLACK IN", 1]; }; As long as you are host this works fine. But if you're a client it doesn't work... But why? It turns out that after initalization you are not local to yourselve (!?!?) and therefore movinCargo does not work. Oh wait let's fix this with: waitUntil {local player}; And supprise supprise. This doesn't work. Putting in a sleep 5 made it work for some players, not for others. Sleep 10 seemed to fix it (so due to network latency?). Then. lets spawn some dead bodies with no gear on them, proceeds to place bodies all over the place with this in init. Example 3: this setDamage 1; removeAllItems this;removeAllWeapons this; And again, not working.... Why?!?!? It's in the init and should be executed on all clients? Wth is this!?!? Example 4: Heli crashes. Make player invurnable and spawn him somwhere safe near heli with this command. _position = [position _vehicle ,10 ,20 , 1, 0, 0, 0] call BIS_fnc_findSafePos; player setPos _position; Notice how the 10 is suppose to say minimum distance from center. Gues what happends? Yes, I spawned right on top of the crashed heli. These are just the annoyances I've come accross after trying to host my mission on a dedicated server. I thought I knew a fair amount of ARMA and scripting on but half of this stuff is just unacceptable if you ask me. For example the movincargo, I spend about 1 hour looking for a solution for it before I finally saw someone on the forum mention it. Besides the dedicated server issues (probably meaning they fail on server-client with non-dedicated aswell) I also encountered the useueall stuff: No errors when tring to play a .OGG file with unsupported birate (and thus did not play). AI spawning in advance and teleporting to location being about 20times slower then creating a new one on location Weird error in GUI elements because I used a static referenced in BIS wiki which apparently is not used anymore AI refusing to fire at unarmed enemies 50% of the time AI refusing to fire at civils even when setFriend is used Huge FPS drops when calling moveTo on AI with toPos on water AI helicopters refusin to enable searchlight no matter what Spawning more then 140ish units in a group not working (without giving an error) Probably more Don't get me wrong. I really love arma and how open their engine is. But for the love of god is about time they take a serious look at their scripting engine. Currently when I'm making stuff I feel like it's about 25% typing code and 75% trying to find out why the typed code is not working. Yes some cases it's not working because "code" but it's just so annoying that half of these cases it's because some weird thing from the arma engine.... Anyway. If anyone has some good feedback on how to fix my issues I would really appreciate that. Besides that I just hope devs start doing something about the amount of wtf's I (and probably others) have while coding this game. Share this post Link to post Share on other sites
jshock 513 Posted November 15, 2014 (edited) It seems that a lot of this is just locality issues, as I think you know, so don't take the following recommendation the wrong way. I would go to the wiki page on Multiplayer Scripting, just to make sure you have all your basis covered, and you may also just have a few things out of place, we all do it from time to time. And just to add a bit more to this, there is a lot going on in your above post, and it will be hard for us to go through and hit every point because for quite a bit of it we need to see more or get more information on each individual issue, which will just get extremely messy, especially when it comes to people trying to answer the same questions at the same time. Edited November 15, 2014 by JShock Share this post Link to post Share on other sites
mindstorm 8 Posted November 15, 2014 It seems that a lot of this is just locality issues, as I think you know, so don't take the following recommendation the wrong way. I would go to the wiki page on Multiplayer Scripting, just to make sure you have all your basis covered, and you may also just have a few things out of place, we all do it from time to time.And just to add a bit more to this, there is a lot going on in your above post, and it will be hard for us to go through and hit every point because for quite a bit of it we need to see more or get more information on each individual issue, which will just get extremely messy, especially when it comes to people trying to answer the same questions at the same time. Thx for the reply. But for example clearWeaponCargo in init means it will be executed on client and server right? Or am I missing some crusial information about how init script of vehicles placed from the map editor work? Or the player moveInCargo, how on earth am I going to fix this in a decent matter? Each client executes the script themselve. Should I really build in a moveIncargo on the server aswell because... wel arma? Share this post Link to post Share on other sites
jshock 513 Posted November 15, 2014 I would also take the following into consideration: https://community.bistudio.com/wiki/Functions_Library_%28Arma_3%29#Attributes Share this post Link to post Share on other sites
dr_strangepete 6 Posted November 15, 2014 clearWeaponCargo wiki page says that its Arguments are Global, but Effects are Local, meaning that it will only work on the computer where executed. You are looking for: clearWeaponCargoGlobal which has Global Arguments & Effects - designed for MP. You'll need to pay close attention to those icons while scripting to ensure you are executing code on the proper computer. But like previously said, short of actual code, its hard to tell whats breaking where, all i can say is that its likely fixable. Don't give up! ---------- Post added at 21:57 ---------- Previous post was at 21:50 ---------- you'll also want: clearMagazineCargoGlobal and addWeaponCargoGlobal Share this post Link to post Share on other sites
Tajin 349 Posted November 15, 2014 not to forget: -showScriptErrors Share this post Link to post Share on other sites
mindstorm 8 Posted November 15, 2014 Ok. And any tips on why some players are not moving into the helicopter at mission start? And again. Can anyone answer this: I thought stuff placed in the INIT of units placed on the map is executed on every client. Just like with triggers. Am I right on this one or not? Share this post Link to post Share on other sites
Tajin 349 Posted November 16, 2014 You're right about "init", but you're slightly wrong about triggers. They ONLY get executed on all clients, IF their condition is true on all clients. Share this post Link to post Share on other sites