Jump to content

DeadWeight85

Member
  • Content Count

    21
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About DeadWeight85

  • Rank
    Private First Class
  1. DeadWeight85

    Adding an Event Handler (SP)

    Will try tonight TY.
  2. DeadWeight85

    Adding an Event Handler (SP)

    Tried this tonight but throws an error Error in expression <r + 1; Error position: <damage _skeet) > 0.1) then Error damage: Type String, expected Object _skeet = "Skeet_Clay_F"; counter = 0; fnc_showHits = { hintSilent format ["You've hit %1",counter]; }; fnc_trackHits = { counter = counter + 1; publicVariable "Hits"; }; if ((damage _skeet) > 0.1) then { _skeet addEventHandler ["killed", fnc_trackHits]; } else { "Hits" addPublicVariableEventHandler {call fnc_showHits}; };
  3. I am wanting to capture when a unit is killed, and display it sort of as a rudimentary kill tracker. I have added the event handler, with an output to but it seems to not see when the object I have is destroyed. I am sure I am missing something, but I cannot figure it out. I have placed the event handler in script that is called when the addaction is used: addMissionEventHandler ["EntityKilled", {hint format ["%1 was killed",name (_this select 0)];}];
  4. I am working a skeet machine script, just for fun but I am having some trouble with setting the direction of the skeet when they launch out of the machine. As it stands right now they will launch out in only one direction. I am looking to have them launch in a random direction to the front of the spawn point. As it stand right now I have this: _skeet = "Skeet_Clay_F" createVehicle getPos SM; _vel = velocity _skeet; _skeet setpos (SM modeltoworld [0, -0.6]); _skeetVel = _skeet setvelocity [-9 * sin getdir SM, -9 * cos getdir SM, 10 + random 2]; I was thinking of the setDir, but I was unsure on how to set it so that would be random. Any thoughts on how to get started?
  5. DeadWeight85

    SetVelocity Help

    _S1 = 'SmokeShell' createVehicle getMarkerPos "sspawn"; _S1 attachto [player]; player setvelocity [0,0,1000]; Tried this and the item itself gets velocity, but it will not apply the velocity to the player.
  6. DeadWeight85

    SetVelocity Help

    I tried this and apparently I am having trouble with Setvelocity in water, as it works on land but not in the water. Any ideas?
  7. Hello all, I am having some trouble with a script I am trying to create. I am trying to recreate something along the line of a DEAD for diving as scene in this video: https://youtu.be/nV3Q4ZxA2Vs?t=544 . What I have now is something that just spawns you ontop of the water when you use the addaction for the inflating vest. It literally just pops you up to the surface of the water. I am going for something that is more controlled and has a slower like in the video. private ["_myvest"]; _myvest = vest player; if ((_myvest == "V_Press_F") && (surfaceIsWater position player)) then { player setPosASL [getposASLW player select 0, getposASLW player select 1, 0]; //player setVelocity [0, 0, 10]; }; I thought remembered reading some where that you couldn't use setveolicty on a player, and that it had to be on an object but I couldn't find that again. If someone could point me in the right direction that would be great.
  8. DeadWeight85

    Cases & Switches Help

    Zenophon I am editing the Altis Life mission file, and in particular the processAction script. I am trying to make it a little more realistic and having the player need 2 items to process into 1. /* File: fn_processAction.sqf Author: Bryan "Tonic" Boardwine Description: Master handling for processing an item. */ private["_vendor","_type","_itemInfo","_oldItem","_newItem","_cost","_upp","_hasLicense","_itemName","_oldVal","_ui","_progress","_pgText","_cP"]; _vendor = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param; _type = [_this,3,"",[""]] call BIS_fnc_param; //Error check if(isNull _vendor OR _type == "" OR (player distance _vendor > 10)) exitWith {}; //unprocessed item,processed item, cost if no license,Text to display (I.e Processing (percent) ..." _itemInfo = switch (_type) do { case "sand": {["sand","glass",70,"Processing Sand"]}; default {[]}; }; //Error checking if(count _itemInfo == 0) exitWith {}; //Setup vars. _oldItem = _itemInfo select 0; _newItem = _itemInfo select 1; _cost = _itemInfo select 2; _upp = _itemInfo select 3; _hasLicense = missionNamespace getVariable (([_type,0] call life_fnc_licenseType) select 0); _itemName = [([_newItem,0] call life_fnc_varHandle)] call life_fnc_varToStr; _oldVal = missionNamespace getVariable ([_oldItem,0] call life_fnc_varHandle); _cost = _cost * _oldVal; //Some more checks if(_oldVal == 0) exitWith {}; //Setup our progress bar. disableSerialization; 5 cutRsc ["life_progress","PLAIN"]; _ui = uiNameSpace getVariable "life_progress"; _progress = _ui displayCtrl 38201; _pgText = _ui displayCtrl 38202; _pgText ctrlSetText format["%2 (1%1)...","%",_upp]; _progress progressSetPosition 0.01; _cP = 0.01; life_is_processing = true; if(_hasLicense) then { while{true} do { sleep 0.3; _cP = _cP + 0.01; _progress progressSetPosition _cP; _pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp]; if(_cP >= 1) exitWith {}; if(player distance _vendor > 10) exitWith {}; }; if(player distance _vendor > 10) exitWith {hint "You need to stay within 10m to process."; 5 cutText ["","PLAIN"]; life_is_processing = false;}; if(!([false,_oldItem,_oldVal] call life_fnc_handleInv)) exitWith {5 cutText ["","PLAIN"]; life_is_processing = false;}; if(!([true,_newItem,_oldVal] call life_fnc_handleInv)) exitWith {5 cutText ["","PLAIN"]; [true,_oldItem,_oldVal] call life_fnc_handleInv; life_is_processing = false;}; 5 cutText ["","PLAIN"]; titleText[format["You have processed %1 into %2",_oldVal,_itemName],"PLAIN"]; life_is_processing = false; } else { if(life_cash < _cost) exitWith {hint format["You need $%1 to process without a license!",[_cost] call life_fnc_numberText]; 5 cutText ["","PLAIN"]; life_is_processing = false;}; while{true} do { sleep 0.9; _cP = _cP + 0.01; _progress progressSetPosition _cP; _pgText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_upp]; if(_cP >= 1) exitWith {}; if(player distance _vendor > 10) exitWith {}; }; if(player distance _vendor > 10) exitWith {hint "You need to stay within 10m to process."; 5 cutText ["","PLAIN"]; life_is_processing = false;}; if(life_cash < _cost) exitWith {hint format["You need $%1 to process without a license!",[_cost] call life_fnc_numberText]; 5 cutText ["","PLAIN"]; life_is_processing = false;}; if(!([false,_oldItem,_oldVal] call life_fnc_handleInv)) exitWith {5 cutText ["","PLAIN"]; life_is_processing = false;}; if(!([true,_newItem,_oldVal] call life_fnc_handleInv)) exitWith {5 cutText ["","PLAIN"]; [true,_oldItem,_oldVal] call life_fnc_handleInv; life_is_processing = false;}; 5 cutText ["","PLAIN"]; titleText[format["You have processed %1 into %2 for $%3",_oldVal,_itemName,[_cost] call life_fnc_numberText],"PLAIN"]; life_cash = life_cash - _cost; life_is_processing = false; };[/Code] So I see the portion your talking about having to redo the array and where its called. I will have to give it a try later tonight.
  9. DeadWeight85

    Cases & Switches Help

    So Goblin how by adding the () will that allow me to place 2 items in my case?
  10. I am having a hard time understanding using cases and switches. I am trying to make it so that when the case it called it needs have 2 items to continue onto the next part. Here is an example: _vendor = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param; _type = [_this,3,"",[""]] call BIS_fnc_param; //Error check if(isNull _vendor OR _type == "" OR (player distance _vendor > 10)) exitWith {}; //unprocessed item,processed item, cost if no license,Text to display (I.e Processing (percent) ..." _itemInfo = switch (_type) do { case "sand": {["sand","glass",70,"Processing Sand"]}; default {[]}; }; [/Code] I am trying to get something like this case "sand": {["sand" && "water","glass",70,"Processing Sand"]}; Can anyone point me in the right direction?
  11. DeadWeight85

    Altis Life RPG

    I thank you very much my friend.
  12. DeadWeight85

    Altis Life RPG

    Does anyone happen to know where the text_cop & text_admin functions are for the cell phone. I was trying to add something to the function but I cannot seem to find it. The only thing that I can find with the cellphone is the cellphone.sqf in the pmenu and the cell.hpp in the dialog folder. Does anyone have any idea where these other functions would be located at?
  13. DeadWeight85

    Altis Life RPG

    TY Tonic for the quick reply. I have found it now.
  14. DeadWeight85

    Altis Life RPG

    @ Tonic TY for providing us with the mission file we appreciate it a lot. I much appreciate you doing the mod and making it possible for us to use it. I do have a question. I was trying to adjust the price for selling virtual items (ie Copper and Iron) but I cannot find where it is located it. When I look in fn_virt_sell I see _price = (__GETC__(sell_array) select _index) but where is the sell array located at? I cannot seem to find it any where. I thank anyone that can help me with this.
  15. Is there any way to stop the automatic refueling and repairing from the gas station that are placed on the map. I have tried the fix located here: http://forums.bistudio.com/showthread.php?129234-Stopping-refueling-at-fuel-pumps and it still does not stop it. Anyone have any suggestions?
×