Jump to content

Ivanoff.N

Member
  • Content count

    75
  • Joined

  • Last visited

  • Medals

Community Reputation

46 Excellent

About Ivanoff.N

  • Rank
    Corporal
  1. Just place a trigger and in activation place null=blackfish SetVehicleCargo Box Blackfish is the name of the vehicle and box is the name of the cargo. There is an addon with that functionality in the workshop. http://steamcommunity.com/sharedfiles/filedetails/?id=1199318917 Maybe looking at it will shed some light on how to write this script.
  2. Okay this is the full thing: //This below is some BIS code to make the 3d icon show params [["_units", []]]; if (isNil "BIS_iconUnits") then { BIS_iconUnits = [];}; BIS_iconUnits append _units;if (!(isNil "BIS_fakeTexture")) exitWith { true}; BIS_fakeTexture = [1,1,1,0] call BIS_fnc_colorRGBAtoTexture; addMissionEventHandler[ "Draw3D", { { //these are the variables I use to calculate mortar elevation, direction and charge private _unit = _x; //Determine selection positions for the markers private _poschargepl = _unit modelToWorld [_unit selectionPosition "pilot" select 0, _unit selectionPosition "pilot" select 1,_unit selectionPosition "pilot" select 2 ]; private _poschargepl2 = _unit modelToWorld [_unit selectionPosition "usti hlavne" select 0, _unit selectionPosition "usti hlavne" select 1,_unit selectionPosition "usti hlavne" select 2 ]; private _poschargepl3 = _unit modelToWorld [_unit selectionPosition "OsaHlavne" select 0, _unit selectionPosition "OsaHlavne" select 1,_unit selectionPosition "OsaHlavne" select 2 ]; //Get direction of the mortar base private _Globdir = ((getdir (_unit))); if ((_unit iskindof "StaticMortar")&&(alive _unit)) then { if (! isnull (gunner _unit)) then { // Determine charge private _charge = getnumber (configfile >> "CfgWeapons" >> (currentweapon _unit) >> (currentweaponmode (gunner _unit)) >> "artillerycharge"); //Determine gun elevation private _Gunelev = Deg (( _unit) AnimationPhase "MainGun"); //Convert gun elevation to milliradian (Note, there are no calculations for slope here so if mortar is not on even surface the elevation is not shown correctly) private _Gunelevfin = (round((((_Gunelev)+75))*17.77777777777778)); //Get mortar turret direction in relation to mortar base and convert to 360 degrees private _Gundir = ((Deg ((_unit) AnimationPhase "MainTurret")-360)% 360); //Get turret direction in relation to world private _endres = (((((_gundir)*-1))+_Globdir)%360); //Convert direction to milliradian private _endresfin = ((round((_endres)*17.77777777777778))); //Convert variables to strings to be displayed private _prsnmbr = str (round(_charge*3)) ; private _prsnmbr2 = str _endresfin; private _prsnmbr3 = str _Gunelevfin; //Draw 3d icons drawIcon3D [ BIS_fakeTexture, [0,125,255,1], [_poschargepl select 0, _poschargepl select 1, (_poschargepl select 2)], 0, -0.5, 0, "Dir "+_prsnmbr2, 0, 0.025 ]; drawIcon3D [ BIS_fakeTexture, [0,125,255,1], [_poschargepl2 select 0, _poschargepl2 select 1, (_poschargepl2 select 2)], 0, -0.5, 0, "Ch "+_prsnmbr, 0, 0.025 ]; drawIcon3D [ BIS_fakeTexture, [0,125,255,1], [_poschargepl3 select 0, _poschargepl3 select 1, (_poschargepl3 select 2)], 0, -0.5, 0, "Ang "+_prsnmbr3, 0, 0.025 ]; } }; } forEach BIS_iconUnits; } ]; This makes a 3d marker and places it on the mortar and shows its data to someone standing outside. The function is executed by the mortar [[mortarname]] call fnc_function; Problem is that in single player the displayed data is correct. But in multiplayer, the data displayed differs from the one the gunner is seeing. It is not off by much, few mills, but still it is off.;
  3. private _gundirection = ((getdir (vehicle gunner _unit))); //Unit is the mortar the script is executed on. That is basically the script to read gun direction, is there another place to read it from as global ?
  4. Hi. I am writing a script for artillery so that a person standing outside of the mortar can see the mortar`s elevation and direction. And it works in SP, however in multiplayer I get false readings. The digits I get is not what the gunner sees. Are the values local ? If so is it possible to get true gunner`s values, globalize them and share with people nearby ?
  5. No, they don`t exist, they will be spawned via createvehicle. The script that spawns them can not be altered, it has to be another script that makes them run my function..
  6. One more question. How to make all lanterns execute my function ? I need to include all those on the map already as well as those that are created mid mission. I use { [[_x]] call NN_fnc_myfunction;} count allMissionObjects "Land_Camping_Light_F"; but that only seems to affect the ones that are already placed but not the future ones.
  7. Thanks for the solution guys. Sorry you failed to understand what this is for, but it works exactly how I need it to. Thanks again.
  8. The value as a string. For example I get the direction of 180 and I need it to just be a static number, not the dynamic variable. Like I said, place a lantern, e.g set the dir to 130. Store this value. Then rotate this lantern to 220 e.g. Then restore the value e.g. with a hint "previous rotation was 130" Then rotate again to e.g. 300 Then restore the value e.g. with a hint "previous rotation was 220" e.t.c. But I need it to not work with a certain lantern but to all lanterns on the map even those that will be spawned in the future.
  9. The idea is you store objects rotation (position or any other data) then you move object then you restore previous data to see how that object was rotated (positioned or other) before it was moved. Is it possible to store it as a string ?
  10. Will it store many variables for each object ? And if so how to then get those variables and apply them to these objects again ?
  11. Hi I am having a problem with storing object data. I have an object, lets say it is "Land_Camping_Light_F" and it calls a function. Inside a function: getdir this select 0 //gets me the direction of the object this function is executed by all objects of this class. However I need to store this data for every object so that later I can see where this object was pointing although now it`s direction is different. Is that possible in arma ?
  12. Combat Realism Scripts

    Thanks, been playing this game for 13 years just found out about it now lol.
  13. Combat Realism Scripts

    hey one more question, how do you actually animate this ? Is it playmove or switchmove or there is another command ?
×