Jump to content

chemicalcosh

Member
  • Content Count

    5
  • Joined

  • Last visited

  • Medals

Community Reputation

3 Neutral

About chemicalcosh

  • Rank
    Rookie
  1. after a bit more reading I understand the access levels better, if anyone else is struggling with a similar problem you can't modify anything with access level = 3 and you must create a new class. The easiest way of doing this is to extend the existing class. also the #define macros are extremely powerful and have saved me from a shitload of similar class declarations. anyone else that is new like me I would defo recommend reading up on them! https://community.bistudio.com/wiki/Arma_3_Characters_And_Gear_Encoding_Guide#Using_macros
  2. Hi there, was wondering if someone could help. I am trying to make a simple addon that will add a new type of magazine that is usable in all of the base rifles. My plan was to do something like the following for each rifle: class SDAR_Base_F; class arifle_SDAR_F: SDAR_Base_F { magazines[] = {"20Rnd_556x45_UW_mag","30Rnd_556x45_Stanag","30Rnd_556x45_Stanag_Tracer_Red","30Rnd_556x45_Stanag_Tracer_Green","30Rnd_556x45_Stanag_Tracer_Yellow","30Rnd_556x45_Stanag_green","30Rnd_556x45_Stanag_red","20Rnd_556x45_UW_mag_Training"}; }; So basically I thought I would just override the magazines[] property of the arifle_SDAR_F (my custom magazine class is the one at the end 20Rnd_556x45_UW_mag_Training). However I've tested it and it doesn't seem to work on the base weapons. I'm guess this is because each class on cfgWeapons is access = 3 - does this mean I'm screwed on my original plan and I need to also make a custom weapon to hold my custom magazine?
  3. Ok well I have tested all these solutions on dedicated server now and all clients can see the spawned units fine, I used the solution provided by r3vo as I liked the compactness and the faster use of getPos. So thanks r3vo, and also to everyone else that replied. Working code: private _randomSpawnPos = NpcSmuggler getPos [(random 20) + 1,random 359]; _smuggler = "B_Soldier_F" createUnit [_randomSpawnPos, (group player), "", 0.5];
  4. Wow thank you for such quick replies, very much appreciated! Just so I can double check I have understood your replies correctly: 1) Because createUnit is already global, my messing around with remoteExec and server functions is pointless - createUnit being global already takes care of all that (propagation) for me? 2) Even if I did need to use remoteExec it wouldn't work anyway because I made syntax errors with function position and forgot to whitelist it in CfgFunctions (doh, I understand now.) 3) "Once you group the AI unit to the players group, the unit becomes local to that players PC" - I'm a bit confused what this means, I thought createUnit was global? I think I am going to go and re-read the wiki again :p
  5. Hi guys I am trying to test out some multiplayer specific coding, and am a bit confused why the following is not working. Basically I am trying to: 1) Player goes to NPC and picks spawn action from scroll menu 2) Server spawns a unit close to the NPC, and assigns it to the group of the player who requested it Am I correct in thinking that the server should spawn the unit, so everyone connected can then see the unit? If it is done just on the client only the client would see it correct? Or have I got this wrong and the server is spawning it but only the server can see it..... Here is my code, it works perfectly fine if i test in the editor and the unit spawns as expected. When I run it on dedicated server I get nothing, no spawn no error on screen or in RPT. Any help or pointers would be very much appreciated! initPlayerLocal.sqf NpcSmuggler addAction ["Add AI Smuggler","NpcSmuggle\Smuggle.sqf",nil,6]; NpcSmuggle\Smuggle.sqf _group = group player; [_group] remoteExec ['Srv_IIS_Start_Smuggle',2,FALSE]; Srv_IIS_Start_Smuggle = { private ["_group","_distance","_direction"]; _group = _this select 0; _distance = [1,20] call BIS_fnc_randomInt; _direction = [0,359] call BIS_fnc_randomInt; _randomSpawnPos = [NpcSmuggler, _distance, _direction] call BIS_fnc_relPos; _smuggler = _group createUnit ["B_Soldier_F", _randomSpawnPos, [], 0, "FORM"]; };
×