Jump to content

D. Patterson

Member
  • Content Count

    77
  • Joined

  • Last visited

  • Medals

Everything posted by D. Patterson

  1. I don't want to start building up scripts, and have to restart because they were all built off poorly performing scripts. If any one you would like to give me any pointers, that'd be appreciated. Edit: Here is pastebin ID 1Q6Cnj7Y For some reason pasting the code in this causes half of it to be cut-off. Basic function of the script is: You shoot a 3GL gas grenade. If any AI's are in a vicinity, they will be forced to animate and cannot fight back.
  2. D. Patterson

    Would anyone like to help me optimize?

    Well I just did a performance test and it took the engine 0.0014 Milliseconds to evaluate If(AmmoGun == "SmokeShellGreen") then {[] execVM "Teargas.sqf"}; when false and 0.0088 Milliseconds when true. So if the math scales linearly, and I will have a max of about 10 shooting simultaneously, I could technically run about 360 of these event handlers before I get a noticeable stutter.
  3. D. Patterson

    Would anyone like to help me optimize?

    I'm getting a Type Number, Expected Object error on the line _Projectile = _this select 0; This is my Init code: this addEventHandler ["fired",{If(_this select 4 == "G_40mm_SmokeGreen") then {[(_this select 6)] execVM "TearGas.sqf"};}]; _Projectile is reporting back as 1780056: ugl_slug.p3d I also added: _Null = [_x] spawn { _AI = _this select 0; Sleep 65; _AI enableAI "ANIM"; _AI setVariable ["Blinded",0,false]; }; to my code, I assume this is what you meant by the spawn.
  4. D. Patterson

    Would anyone like to help me optimize?

    Okay code so far: Event Handler: this addEventHandler ["fired",{If(_this select 4 == "G_40mm_SmokeGreen") then {execVM "TearGas.sqf"};}]; TearGas Script: G6xJfMVA <- PasteBin ID Everything is still working.
  5. D. Patterson

    Would anyone like to help me optimize?

    Seems like firedNear has to do with the firing unit, and not the projectile destination? This is what I think I should use for the eventHandler this addEventHandler ["fired",{If(_this select 4 == "G_40mm_SmokeGreen") then {execVM "TearGasEH.sqf"};}]; Should this perform well and not be too intensive?
  6. D. Patterson

    Would anyone like to help me optimize?

    I considered an eventhandler, but it seemed like it'd be more resource intensive to run code every time a weapon is fired, than just checking every 10 seconds.
  7. D. Patterson

    How to get civilian to shoot civilian?

    For Posterity: Apparently setFriend is not mutual. Basically what I require is Civ A to kill Civ B, but Nato A can't shoot at either (I will not be using Opfor or Independent). I paired Civ A to opfor and Civ B to Indep and it changed the color of their icon in 3D editor (Apparently you can just completely delete the parent unit afterwards, they will remain that side until re-paired with a higher ranking civilian) and added the following to my Init WEST setFriend [EAST,1]; EAST setFriend [WEST,1]; EAST setFriend [RESISTANCE,0]; So now Opfor will shoot at AAF, AAF will not shoot at Opfor, and Blufor will not shoot at either.
  8. So far the only method I've found to work is a BIS_fnc_relativeDirTo/setDir combined with forceWeaponfire but it looks horrible. doFire, doWatch, doTarget will not get the civilian to aim at the target, let alone fire. (If I can get them to at least aim at the target, I can use forceWeaponFire).
  9. I want a scroll menu option to control a UAV and/or AV without the player having a terminal, is this possible? The AV is specifically the Mk30A .50cal
  10. D. Patterson

    Control UAV via AddAction

    The concept is that there is a Hunter which is linked to the UAV. You could store the tablet in the vehicle, but that'll be unreliable in Multiplayer.
  11. I tried _houseLoc = getMarkerPos "realtor" nearObjects ["Land_i_House_Big_01_V1_F", 5000]; { _hsmrk = createMarkerLocal ["Marker",getPos _x]; _hsmrk setMarkerType "Select"; } forEach _houseLoc; and it's only marking one house.
  12. I want to make NV Goggles invisible. I already tried the following: (hmd player) hideObject true; And _NV = (AssignedItems player) select 3; hint _NV; // Does return NVGoggles _NV hideObject true;
  13. https://community.bistudio.com/wiki/File:Arma3_CfgWeapons_U_I_OfficerUniform.jpg Is there a PSD template? Or Do I need to paint over the texture. Also why does setObjectTexure not work?
  14. Basically I have an array of UID's stored on server. I randomly select one of the UIDs, check if they are online, then addAction. What is best way to correlate the UID to an object that I can use addAction with? Note: It's inside a for do loop, with _i correlating to the UID entry in the array.
  15. I found out how to slowly add color correction, but how do I slowly remove it to default?
  16. http://pastebin.com/raw.php?i=KwHD19Jv Getting Type Any, Expected Number error with |#|nearObjects tagged
  17. D. Patterson

    Why isn't nearObjects working?

    Thanks for all the help so far, but one last quick question and this should work. http://pastebin.com/raw.php?i=FgN5XZMe Code so far, what do I put in the waitUntil ? So it waits till map is clicked?
  18. D. Patterson

    Why isn't nearObjects working?

    Im going to have much more script afterwards, is it still fine to put it in the brackets? Edit: Tried this, nothing happens when I click. http://pastebin.com/raw.php?i=KE4rG88q
  19. D. Patterson

    Why isn't nearObjects working?

    Now the only issue I have, this is my script. http://pastebin.com/raw.php?i=szihQzg6 It does not work until I change it to this. http://pastebin.com/raw.php?i=9GXEH62k Is there a way to fix this without using global variables?
  20. D. Patterson

    Why isn't nearObjects working?

    Edit: Appears to be working now.
  21. D. Patterson

    Why isn't nearObjects working?

    _pos is defined via 'onMapSingleClick' (When I hint str _pos it returns valid position). Also even with [15000,15000] nearObjects ["_houseClass",_Dist]; it returns an error.
  22. Cargo setDir ((getDir ActiveTruck) + 135); Why does this keep giving a different relative angle?
  23. I tried ((getDir ActiveTruck) + 90) mod 360; and it doesnt work. Without the modulo, the issue still persists even when the heading is less than 360. EDIT: Solved. I over-complicated things, when an object is attached using AttachTo, setDir becomes relative the object it is attached to. So I can simply do Cargo setDir 180; and it'll be same angle relative the truck, no matter the trucks relative angle to the world.
  24. So I have a script that randomly spawns a player at any Land_i_Shed_Ind_F on the map. However I want to spawn a HEMTT inside, or next to the shed. Safely 99% of the time. No getting stuck, no exploding, no crushing the player. How should I do this?
×