Jump to content

Jigsor

Member
  • Content Count

    628
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by Jigsor

  1. Jigsor

    AddWeaponCargo in MP

    Maybe add InventoryOpened EH to player, then check for type of ammo box container: Object - connected container or weaponholder, Then inventory the box and add InventoryClosed EH to player and refill the box with inventories items?
  2. So I have 2 position arrays. Point a and point b. I would like to make a third point c (position array). Point c (triangle height not z coordinate) should be equidistant from point a and b but not inline with either and not to far away in height that the triangle become right or accute. Any ideas from the position or math geniuses?
  3. Wow, that's the ticket. A perfectly symmetrical obtuse isosceles triangle using that formula Larrow. Making Beautiful bell curves with Rejenorst's Bezier Curve function now... Thanks a ton guys :bounce3:
  4. Jigsor

    Ambient Combat Sound

    Yep, good catch. Change was made to original post. Thank you 2nd Ranger. ---------- Post added at 06:55 AM ---------- Previous post was at 06:51 AM ---------- @Gattobuono, step 1. copy code to init.sqf step 2. place an object you want the sound to come from in the editor and name it objective_pos_logic. step 3. save and preview.
  5. Hey Tonic, Thank You for the update. Nothing but lots of positive feedback on it in latest unreleased build of BMR Insurgency Heads up on this error I caught when entering "B_Boat_Armed_01_minigun_F" as commander and same error again entering the back of same boat, though all seams to work ok? 0:36:46 Error in expression <ncObject) then { setObjectViewDistance [_dist,100]; tawvd_object = _dist; };> 0:36:46 Error position: <_dist,100]; tawvd_object = _dist; };> 0:36:46 Error Undefined variable in expression: _dist 0:36:46 File mpmissions\__CUR_MP.fallujah\taw_vd\fn_updateViewDistance.sqf, line 26 Found simple fix by adding extra case to switch in fn_updateViewDistance.sqf case ((vehicle player) isKindOf "Ship"): { setViewDistance tawvd_car; _dist = tawvd_car; };
  6. Very nice, script solution is working great. Thank you zorrobyte!
  7. isTouchingGround is unreliable and may never return true so I recommend. (nuclear in thisList) && {(getPosatl nuclear select 2) < 2 || isTouchingGround nuclear}
  8. Zorrobyte, Is it possile with script version to only apply caching to certain groups spawned by script rather than allGroups. EOS is already handle caching for units it spawns, but I have groups spawning in side missions that I would like to cache with your script.
  9. At desired location of light place a game logic on the map under insert unit, SIDE: Game Logic, CLASS: Objects, and put this in it's init field. light = "#lightpoint" createVehicleLocal position this; light setLightBrightness 0.2; light setLightAmbient[0, 0.2, 0]; light setLightColor[0, 3, 1]; light lightAttachObject [this, [0,0,0]]; Change the values for different results. There are also these: Land_PortableLight_single_F Land_PortableLight_double_F
  10. If I am reading this correctly, Coolinator is asking for help refilling ammo box not replacing them. This will replenish the inventory of the box with what ever contents it has at script run time and continue to do so by looping every x minutes. Maybe a good idea to not allow boxes to take damage as well. I have not implemented any code for crates containing backpacks yet but give this a try. It is working well in my Insurgency mission. //SimpleCrateRefill.sqf by Jigsor //Refills ammo crates with contents inventoried at script run time. // run via script example: //_nul = [CrateObject,DelayMinutes] execVM "scripts\SimpleCrateRefill.sqf"; // run via init field of ammo box in editor example: //_nul = [this,10] execVM "scripts\SimpleCrateRefill.sqf"; if (!isServer) exitWith {}; waitUntil {time > 0}; sleep (random 10); private ["_crate","_delay","_all_mags","_all_weps","_all_items","_has_items"]; _crate = _this select 0; _delay = (_this select 1) * 60; _has_items = false; _all_mags = magazineCargo _crate; _all_weps = WeaponCargo _crate; _all_items = ItemCargo _crate; //_backpacks = getBackpackCargo _crate; if (count _all_items > 0) then {_has_items = true;}; while {true} do { clearMagazineCargoGlobal _crate; sleep 0.3; clearWeaponCargoGlobal _crate; sleep 0.3; if (_has_items) then {clearItemCargoGlobal _crate;}; sleep 0.3; {_crate addMagazineCargoGlobal [_x, 1];} foreach _all_mags; sleep 0.3; {_crate addWeaponCargoGlobal [_x, 1];} foreach _all_weps; sleep 0.3; if (_has_items) then {{_crate addItemCargoGlobal [_x, 1];} foreach _all_items;}; sleep _delay; };
  11. Jigsor

    BMR Insurgency

    I am currently working on a version to support CAF as opposing force and should be done within a couple of days. ---------- Post added at 05:34 PM ---------- Previous post was at 05:23 PM ---------- @ruckinloe. I appologize, v0_97was set force advance flight model on helis before Heli DLC release and was unsure of what that entailed as not having tried the Dev build. Version 0_98 will have this set to option based instead. The change can easily be done yourself if you care to do so by dePBOing the mission and open description.ext in a text editor and change this line: forceRotorLibSimulation = 1;// Default value: 0 - options based; 1 - force enable; 2 - force disable to this: forceRotorLibSimulation = 0;// Default value: 0 - options based; 1 - force enable; 2 - force disable Then convert the mission back to pbo file.
  12. Jigsor

    Ambient Combat Sound

    I checked this script out, but I didn't like the fact that the sounds are not positional (3d). In fact they are mono. Below uses all A3 sounds beginning with battlefield_explosions* and battlefield_firefight* and plays them in 3d. It requires an object/logic as the positional source. This example uses invisible object "Land_ClutterCutter_small_F" I named objective_pos_logic. It works out well if object is placed/moved to the center of AO, objective or where ever you want the sound to come from. Note: in line the with playsound3d command, the last 3 numbers "5,1,600" represent volume,pitch,distance that sound is audible. // A3 Ambient Combat Sound in 3D if (!isdedicated && hasInterface) then { [] spawn { waitUntil {!isNull player}; waitUntil {player == player}; private ["_allsounds","_source"]; _allsounds = []; _source = objective_pos_logic;// object/logic while {true} do { private ["_sound","_sound1","_sound2","_maxtype"]; _allsounds = _allsounds - _allsounds; _sound1 = format ["A3\Sounds_F\ambient\battlefield\battlefield_explosions%1.wss",ceil (random 5)]; _sound2 = format ["A3\Sounds_F\ambient\battlefield\battlefield_firefight%1.wss",ceil (random 4)]; _allsounds pushBack _sound1; _allsounds pushBack _sound2; _maxtype = (count _allsounds); _sound = _allsounds select (floor random _maxtype); playsound3d [_sound,_source,false,getPosasl _source,5,1,600]; sleep (1 + random 29); }; }; };
  13. I know you can call functions or run code from BIS eventhandlers, but how do you run a script from a custom eventhandler? I want to execVM script.sqf whenever eventhandler is updated regardless of value. The value will be filtered in the script it runs. If the value is not something I need the script will exit. Then eventhandler will get updated very seldom so I am not worried about network traffic. I have been using a custom Eventhandlers like this: "some_array" addPublicVariableEventHandler {call compile format ["%1",_this select 1]}; but I would like to do something like this: "some_array" addPublicVariableEventHandler {execVM "scripts\my_script.sqf"}; "some_array" addPublicVariableEventHandler { if (_this select 1) then { nul = [] execVM "scripts\my_script.sqf";};}; Does not seem to work. I can see through debug that the value some_array is getting updated with PV, but the script in the eventhandler is not firing. Is this possible?
  14. Lol this thread is so old with no replies until yesterday. Thanks DreadedEntity. I had already figured it out and got it working some days after asking for help. "GLOBAL_customEH" addPublicVariableEventHandler { [(_this select 1)] execVM "myScript.sqf"; }; Was what I found worked. "publicVariableEventHandlers do not fire on the machine that the variable was publicVariable'd from" I knew about that. The event handler was server side and needed to run the script. Player needed to only PV new value. I could not run script from client side it had code that the server needed to handle, hence why I needed to trigger script on server.
  15. addScore and addScoreSide commands are executed Server side only. Killed eventhandler runs where the unit is local. If unit does not belong to server as in server spawned AI than Killed eventhandler will not work unless you use a global variables inthe EH and you publicVariable the global variable. The best MP way: //init.sqf if (isServer) then { if (isNil "paddscore") then {paddscore = 0;}; "paddscore" addPublicVariableEventHandler {_data = _this select 1; (_data select 0) addScore (_data select 1);}; }; Then when you need to give score from client side //player_side_script.sqf _player = player; _pscore = 2; paddscore = [_player, _pscore]; publicVariableServer "paddscore"; When you need to give score from Server side use same as above except replace player with a variable representing player because Dedicated server does not recognize player command and replace publicVariableServer with publicVariable.
  16. _drone1 = [getMarkerPos "marker1", 200, "O_UAV_01_F", EAST] call BIS_fnc_spawnVehicle; createVehicleCrew (_drone1 select 0); _vehicleObject = _drone1 select 0;//vehicle object _vehicleCrew = _drone1 select 1;// vehicle crew _vehicleGrp = _drone1 select 2;// group of vehicle _wp = _vehicleGrp addWaypoint [_pos, 200]; BIS_fnc_spawnVehicle returns: Array - 0: created vehicle (Object), 1: all crew (Array of Objects), 2: vehicle's group (Group).
  17. Dirty Haz, all links lead to steam subscription only. Could you provide an alternative direct download?
  18. Jigsor

    Bezier Curve function.

    Rejenorst, the update of passing through the control point is great and is working with accuracy. For the radar, I was over thinking how the how reflections would work, but line intersects would work just fine as the radar receiver would only ping when one of the beam axis is aligned with object anyways I believe. Good stuff, thank you.
  19. Jigsor

    Dart Drone Cannot See Opfor

    Maybe try adding crew to the UAV so that knowsabout works. createVehicleCrew this;
  20. Private command does not define variables. It only localizes them to be used within the scope of the script. _ array must be defined within the scope of your script before it is used like: _array = []; or _array = [element1,element2]; If the Error is comming form the function then passed variable to the function must be defined in the function itself like: private "_pvar2"; _pvar2 = _this select 0; You can totally pass a private variable to another script or function as long as it is again defined in the other script/function. What is the error exactly? Also maybe try to pass the variable to function like this: [_pvar2] call WAK_fnc_someFunction; It can be handy to make your variables global ie; without _ for testing in debug console to verify variable values. After testing and verifying that that the variables are valid and that script /function works then change them back to local variables with leading underscore.
  21. Jigsor

    Bezier Curve function.

    This is very cool. Good thinking outside of the box. Could be very handy for waypoints. Would it be possible to double the distance of curve peak in the function so precalculations are not necessary for accuracy? Kinda off topic but, it would be cool to see similar function calculating parabola curve to be used in a spinning radar simulation. Anyway, this has great potential. Very nice.
  22. Jigsor

    turn camera a 180 degrees?

    camSetDir was just updated with last stable patch. I have not tried it, but it may work.
  23. Jigsor

    BMR Insurgency

    Big if you wouldn't mind, could you please reupload mission pack to Armaholic once again? Thank You. Hotfixed all missions. Fixed: animation bug found in Delivery mission due to BIS command change Fixed: Script errors in rewarded vehicle paradrop. Removed Weapons marker created when deploying Opfor MHQ.
  24. Jigsor

    BMR Insurgency

    Mission pack updated to version 0_97
  25. Happy to see this in A3. Nice work Zonekiller.
×