Darihon Posted June 12, 2014 Report Share Posted June 12, 2014 Hello, Since we stopped working on our "Epoch Life", I decided to throw one of our scripts live: "Processing script". This script allows people to process (i.e gold ore into goldbar). Installation: Same as our good old friend "Bank Robbery". I used the same piece of code and changed it a bit. You need to edit the classname, since I wasn't able to find a nice themed item with this! Add this piece of code in "fn_selfactions.sqf". // Processing _processing = cursorTarget isKindOf "CHANGE ITEM HERE"; if ((speed player <= 1) && _processing && (player distance cursorTarget < 5)) then { if (s_player_processing < 0) then { s_player_processing = player addAction ["Process Item","scripts\process.sqf",cursorTarget, 0, false, true, "",""]; }; } else { player removeAction s_player_processing; s_player_processing = -1; }; // Processing Add this above: ~ line 73 } else { //Engineering dayz_myCursorTarget = objNull; ...... ..... Download: http://pastebin.com/xeZuXHpJ Creep and Defent 2 Link to comment Share on other sites More sharing options...
calamity Posted June 14, 2014 Report Share Posted June 14, 2014 have a few questions for you.. I cant get any scroll option I want to allow players to create a notebook as output for the cctv script I use then I will add the camera as a buildable and players can set up a CCTV at where they want.. at least thats the plan... ///////////////////////////// // Processing _processing = cursorTarget isKindOf "ItemTopaz"; if ((speed player <= 1) && _processing && (player distance cursorTarget < 5)) then { if (s_player_processing < 0) then { s_player_processing = player addAction ["Process Item","custom\process.sqf",cursorTarget, 0, false, true, "",""]; }; } else { player removeAction s_player_processing; s_player_processing = -1; }; ///////////////////////////// // Processing ///////////////////////////// // CCTV Custom self actions _isLaptop = _cursorTarget isKindOf "Notebook"; if (_isLaptop && _canDo) then { if (s_player_laptop < 0) then { s_player_laptop = player addAction ["Activate Laptop", "cctv\init.sqf",_cursorTarget, 1, true, true, "", ""]; } } else { player removeAction s_player_laptop; s_player_laptop = -1; }; ///////////////////////////// } else { //Engineering private ["_ELItem","_ELEx","_ELLicense"]; // Exchange Script // Configuration: _ELItem = "ItemTopaz"; _ELEx = "Notebook"; _ELLicense = "ItemFlashlight"; // so I have dropped the topaz and tried scrolling on it, I also tried scroll with it in my inventory and I get no new process option I would like the topaz to be processed into a notebook I have a flashlight as tool needed in inventory and topaz needed as part needed to process. Link to comment Share on other sites More sharing options...
Darihon Posted June 15, 2014 Author Report Share Posted June 15, 2014 Did u add the piece of code inside of fn_selfactions and did u change the classname into the item that u put your cursor on? Link to comment Share on other sites More sharing options...
calamity Posted June 15, 2014 Report Share Posted June 15, 2014 yah I show it it last post at the top.. added like this.... maybe the ItemTopaz just wont work as a scoll item ///////////////////////////// // Processing _processing = cursorTarget isKindOf "ItemTopaz"; if ((speed player <= 1) && _processing && (player distance cursorTarget < 5)) then { if (s_player_processing < 0) then { s_player_processing = player addAction ["Process Item","custom\process.sqf",cursorTarget, 0, false, true, "",""]; }; } else { player removeAction s_player_processing; s_player_processing = -1; }; ///////////////////////////// // Processing ///////////////////////////// // CCTV Custom self actions _isLaptop = _cursorTarget isKindOf "Notebook"; if (_isLaptop && _canDo) then { if (s_player_laptop < 0) then { s_player_laptop = player addAction ["Activate Laptop", "cctv\init.sqf",_cursorTarget, 1, true, true, "", ""]; } } else { player removeAction s_player_laptop; s_player_laptop = -1; }; ///////////////////////////// } else { //Engineering {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = []; s_player_repair_crtl = -1; Link to comment Share on other sites More sharing options...
Darihon Posted June 15, 2014 Author Report Share Posted June 15, 2014 No, then you would do something like this: _processing = ''ItemTopaz'' in magazines player Not tested and not sure if it works. Then u need to delete && (player distance cursortarget < 5) too. Link to comment Share on other sites More sharing options...
raymix Posted June 15, 2014 Report Share Posted June 15, 2014 @calamity: use typeOf for classnames. isKindOf is for base classes (that holds multiple classnames within it). For example: isKindOf "Cars" typeOf ["UAZ", "Ural"] Link to comment Share on other sites More sharing options...
Halvhjearne Posted June 15, 2014 Report Share Posted June 15, 2014 @calamity: use isTypeOf for classnames. isKindOf is for base classes (that holds multiple classnames within it). For example: isKindOf "Cars" isTypeOf ["UAZ", "Ural"] isTypeOf? Link to comment Share on other sites More sharing options...
raymix Posted June 15, 2014 Report Share Posted June 15, 2014 Oops, fixed. I should probably get some sleep... Link to comment Share on other sites More sharing options...
calamity Posted June 16, 2014 Report Share Posted June 16, 2014 could we get a working example of this? I have tried many times with no success :( Link to comment Share on other sites More sharing options...
Darihon Posted June 16, 2014 Author Report Share Posted June 16, 2014 What do you want to do? I can see u want to do something with "ItemTopaz". Link to comment Share on other sites More sharing options...
chipsandcheese Posted August 29, 2014 Report Share Posted August 29, 2014 Is it possible to make it so you can only process a particular item in a particular building? Would add a lot to the game, in my opinion. For example - Engines only when in factories - Wheels when in garages - Backpacks (from canvas) when in a certain building too And etc Link to comment Share on other sites More sharing options...
ARC_Solo Posted August 29, 2014 Report Share Posted August 29, 2014 Not 100% sure but if you add a trigger It may work Something like this maybe? private ["_inRange","_trigger","_pos","_usable","_inRange"] _trigger = ["Building name"]; _pos = getPosATL player; _usable = (nearestObjects [_pos, _trigger, 5]); // 5 is distance from. _inRange = count _usable > 0; if (_inRange) then { That should allow you to run the specific script only when in range and/or in the specific building. Link to comment Share on other sites More sharing options...
Darihon Posted August 30, 2014 Author Report Share Posted August 30, 2014 What Skellyy says: Use a trigger. He even give you an example of it. I'll see if I have time to edit the code to add the trigger. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now