Jump to content

[TUTORIAL] Harvestable hemp, smoking weed, pot farms.


FragZ

Recommended Posts

I'm using this variant of the smokeshit.sqf and ever since the epoch update the trip after smoking the weed is extremely intense and you can't see anything.  How do I turn the LSD type effect down?

 /*
by: ZeroK00L edited by FragZ Original code by Infistar.de and FragZserver.com
*/
[] spawn {
hint "You just smoked a kilo of weed! OMG 420 blaze it!";
player removeMagazine 'ItemKiloHemp';
Remove_Drug_effects =
{
{
ppEffectDestroy _x;
} forEach (_this select 0);
ppEffectDestroy ppe2;
ppEffectDestroy ppe3;
setaperture 0;
};
_time = time;
_effects = [];
while {true} do
{
ppe2 = ppEffectCreate ["chromAberration", 1555];
_effects = _effects + [ppe2];
ppe2 ppEffectAdjust [random 0.25,random 0.25,true];
ppe2 ppEffectCommit 1;
ppe2 ppEffectEnable true;
ppe3 = ppEffectCreate ["radialBlur", 1555];
_effects = _effects + [ppe3];
ppe3 ppEffectEnable true;
ppe3 ppEffectAdjust [random 0.02,random 0.02,0.15,0.15];
ppe3 ppEffectCommit 1;
sleep random(1);
r_player_blood = r_player_bloodTotal; //set their blood to the maximum allowed
r_player_lowblood = false; //set lowblood setting to false
10 fadeSound 1; //slowly fade their volume back to maximum
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5; //disable post processing blur effect
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5; //give them their colour back
r_player_lowblood = false; //just double checking their blood isnt low
player setVariable["USEC_BloodQty",r_player_bloodTotal,true]; //set their blood back up to maximum again
if (_time + 90 < time) exitWith {[_effects] call Remove_Drug_effects;};
};
};
Link to comment
Share on other sites

Thanks for sharing this script, awesome :P

Now to my Problem:

 

I followed the TuT but when i try to harvest with the knife i recive "You need to be near the weed plants in order to gather", i was rly near on that Plant.

Same for smoke weed, i got no option for it.

I Use macas right click script involved with the SelfBB and the WeedFarm.sqf from HALV (thanks for that), Hemp.sqf and smokeshit.sqf are from Tutorial.
The WeedFarms are spawning!

Server runs OverPoch on map Napf.

Please take a look on it

Here my extra_rc.hpp:

class ExtraRc {
    class ItemBloodbag {
        class Use {
            text = "Self Bloodbag";
            script = "execVM 'Scripts\SelfBb\SelfBb.sqf'";
        };
    };
    class ItemKiloHemp {
        class smokeweed {
            text = "Smoke the shit";
            script = "execVM 'scripts\weed\smokeshit.sqf'";
        };
    };
    class ItemKnife {
        class farmhemp {
            text = "Harvest the weed";
            script = "execVM 'scripts\weed\hemp.sqf'";
        };
    };    
};




My ui_selectSlot.sqf:


private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType","_erc_cfgActions", "_erc_numActions"];
disableSerialization;
_control =     _this select 0;
_button =    _this select 1;
_parent =     findDisplay 106;

//if ((time - dayzClickTime) < 1) exitWith {};

if (_button == 1) then {
    //dayzClickTime = time;
    _group = _parent displayCtrl 6902;
    
    _pos =         ctrlPosition _group;
    _pos set [0,((_this select 2) + 0.48)];
    _pos set [1,((_this select 3) + 0.07)];
    
    _item = gearSlotData _control;
    
    _conf = configFile >> "cfgMagazines" >> _item;
    if (!isClass _conf) then {
        _conf = configFile >> "cfgWeapons" >> _item;
    };
    _name = getText(_conf >> "displayName");
    
    _cfgActions = _conf >> "ItemActions";
    _numActions = (count _cfgActions);
    _height = 0;
    
    //Populate Menu
    for "_i" from 0 to (_numActions - 1) do
    {
        _menu =     _parent displayCtrl (1600 + _i);
        _menu ctrlShow true;
        _config =     (_cfgActions select _i);
        _type =     getText    (_config >> "text");
        _script =     getText    (_config >> "script");
        _outputOriented =     getNumber    (_config >> "outputOriented") == 1;
        _height = _height + (0.025 * safezoneH);
        _compile =  format["_id = '%2' %1;",_script,_item];
        uiNamespace setVariable ['uiControl', _control];
        if (_outputOriented) then {
            /*
                This flag means that the action is output oriented
                the output class will then be transferred to the script
                and the type used for the name
            */            
            _array =     getArray    (_config >> "output");
            _outputClass = _array select 0;
            _outputType = _array select 1;
            _name = getText (configFile >> _outputType >> _outputClass >> "displayName");
            _compile =  format["_id = ['%2',%3] %1;",_script,_item,_array];
        };
        
        _menu ctrlSetText format[_type,_name];
        _menu ctrlSetEventHandler ["ButtonClick",_compile];
    };
    
    // Add extra context menus
    _erc_cfgActions = (missionConfigFile >> "ExtraRc" >> _item);
    _erc_numActions = (count _erc_cfgActions);
    if (isClass _erc_cfgActions) then {
        for "_j" from 0 to (_erc_numActions - 1) do
        {
            _menu =     _parent displayCtrl (1600 + _j + _numActions);
            _menu ctrlShow true;
            _config =     (_erc_cfgActions select _j);
            _text =     getText    (_config >> "text");
            _script =     getText    (_config >> "script");
            _height = _height + (0.025 * safezoneH);
            uiNamespace setVariable ['uiControl', _control];
            _menu ctrlSetText _text;
            _menu ctrlSetEventHandler ["ButtonClick",_script];
        };
    };

    _pos set [3,_height];
    //hint format["Obj: %1 \nHeight: %2\nPos: %3",_item,_height,_grpPos];        

    _group ctrlShow true;
    ctrlSetFocus _group;
    _group ctrlSetPosition _pos;
    _group ctrlCommit 0;
};



 

In my init.sqf from Mission Folder:

//Weed
execVM "scripts\weed\weedfarm.sqf";

Hope some one can help me out :P

Thanks in Advance!


Greetz Ace

Link to comment
Share on other sites

Thanks for sharing this script, awesome :P

Now to my Problem:

 

I followed the TuT but when i try to harvest with the knife i recive "You need to be near the weed plants in order to gather", i was rly near on that Plant.

Same for smoke weed, i got no option for it.

I Use macas right click script involved with the SelfBB and the WeedFarm.sqf from HALV (thanks for that), Hemp.sqf and smokeshit.sqf are from Tutorial.

The WeedFarms are spawning!

Server runs OverPoch on map Napf.

Please take a look on it

Here my extra_rc.hpp:

class ExtraRc {

    class ItemBloodbag {

        class Use {

            text = "Self Bloodbag";

            script = "execVM 'Scripts\SelfBb\SelfBb.sqf'";

        };

    };

    class ItemKiloHemp {

        class smokeweed {

            text = "Smoke the shit";

            script = "execVM 'scripts\weed\smokeshit.sqf'";

        };

    };

    class ItemKnife {

        class farmhemp {

            text = "Harvest the weed";

            script = "execVM 'scripts\weed\hemp.sqf'";

        };

    };    

};

My ui_selectSlot.sqf:

private ["_control","_button","_parent","_group","_pos","_item","_conf","_name","_cfgActions","_numActions","_height","_menu","_config","_type","_script","_outputOriented","_compile","_array","_outputClass","_outputType","_erc_cfgActions", "_erc_numActions"];

disableSerialization;

_control =     _this select 0;

_button =    _this select 1;

_parent =     findDisplay 106;

//if ((time - dayzClickTime) < 1) exitWith {};

if (_button == 1) then {

    //dayzClickTime = time;

    _group = _parent displayCtrl 6902;

    

    _pos =         ctrlPosition _group;

    _pos set [0,((_this select 2) + 0.48)];

    _pos set [1,((_this select 3) + 0.07)];

    

    _item = gearSlotData _control;

    

    _conf = configFile >> "cfgMagazines" >> _item;

    if (!isClass _conf) then {

        _conf = configFile >> "cfgWeapons" >> _item;

    };

    _name = getText(_conf >> "displayName");

    

    _cfgActions = _conf >> "ItemActions";

    _numActions = (count _cfgActions);

    _height = 0;

    

    //Populate Menu

    for "_i" from 0 to (_numActions - 1) do

    {

        _menu =     _parent displayCtrl (1600 + _i);

        _menu ctrlShow true;

        _config =     (_cfgActions select _i);

        _type =     getText    (_config >> "text");

        _script =     getText    (_config >> "script");

        _outputOriented =     getNumber    (_config >> "outputOriented") == 1;

        _height = _height + (0.025 * safezoneH);

        _compile =  format["_id = '%2' %1;",_script,_item];

        uiNamespace setVariable ['uiControl', _control];

        if (_outputOriented) then {

            /*

                This flag means that the action is output oriented

                the output class will then be transferred to the script

                and the type used for the name

            */            

            _array =     getArray    (_config >> "output");

            _outputClass = _array select 0;

            _outputType = _array select 1;

            _name = getText (configFile >> _outputType >> _outputClass >> "displayName");

            _compile =  format["_id = ['%2',%3] %1;",_script,_item,_array];

        };

        

        _menu ctrlSetText format[_type,_name];

        _menu ctrlSetEventHandler ["ButtonClick",_compile];

    };

    

    // Add extra context menus

    _erc_cfgActions = (missionConfigFile >> "ExtraRc" >> _item);

    _erc_numActions = (count _erc_cfgActions);

    if (isClass _erc_cfgActions) then {

        for "_j" from 0 to (_erc_numActions - 1) do

        {

            _menu =     _parent displayCtrl (1600 + _j + _numActions);

            _menu ctrlShow true;

            _config =     (_erc_cfgActions select _j);

            _text =     getText    (_config >> "text");

            _script =     getText    (_config >> "script");

            _height = _height + (0.025 * safezoneH);

            uiNamespace setVariable ['uiControl', _control];

            _menu ctrlSetText _text;

            _menu ctrlSetEventHandler ["ButtonClick",_script];

        };

    };

    _pos set [3,_height];

    //hint format["Obj: %1 \nHeight: %2\nPos: %3",_item,_height,_grpPos];        

    _group ctrlShow true;

    ctrlSetFocus _group;

    _group ctrlSetPosition _pos;

    _group ctrlCommit 0;

};

 

In my init.sqf from Mission Folder:

//Weed
execVM "scripts\weed\weedfarm.sqf";

Hope some one can help me out :P

Thanks in Advance!

Greetz Ace

 

I have still problems to get them to work.

The weed Farms are spawning but when i try to harvest with the knife i recive "You need to be near the weed plants in order to gather".

And smoke weed doesnt work too, please help me.

Thanks!

Ace

Link to comment
Share on other sites

I have still problems to get them to work.

The weed Farms are spawning but when i try to harvest with the knife i recive "You need to be near the weed plants in order to gather".

And smoke weed doesnt work too, please help me.

Thanks!

 

I get two options harvest hemp  and harvest plant

I get the same error when I choose harvest hemp.

harvest plant is the one that works for me

you tried both ways ???

Link to comment
Share on other sites

I see a lot of people on here complaining that the get

 

"You need to be near the weed plants in order to gather"

When you right click on your knife, there are 2 options. 1 is harvest plant, the other is harvest hemp (or weed I forget). Makes sure you're clicking the one that says harvest hemp. If that still doesn't work, you did something wrong somewhere because this works fine. Unless, the newer versions of epoch break this? Not sure as I run 1.0.4.2 still.

Link to comment
Share on other sites

I get two options harvest hemp  and harvest plant

I get the same error when I choose harvest hemp.

harvest plant is the one that works for me

you tried both ways ???

I get only the option Harvest Plant.

 

I see a lot of people on here complaining that the get

When you right click on your knife, there are 2 options. 1 is harvest plant, the other is harvest hemp (or weed I forget). Makes sure you're clicking the one that says harvest hemp. If that still doesn't work, you did something wrong somewhere because this works fine. Unless, the newer versions of epoch break this? Not sure as I run 1.0.4.2 still.

My Server runs on OverPoch, Epoch 1.0.5.1 and Overwatch 0.2.5.

I will go over the Installation again and look for an error.

 

Thanks.

Link to comment
Share on other sites

Hello
 
I have a problem with the script when I'm next to the plant and I click on the right click option on the knife nothing is happening no message, no Action but when I'm not next to the plant I have the message that I'm too far from the plant 
 
I looked everywhere but I can not or I could make a mistake and I see is no error in my RPT
 
Hemp.sqf
 
Extra_rc
 
ui_selectSlot.sqf
 
My mapping is like this

 

_vehicle_1598 = objNull;

if (true) then
{
  _this = createVehicle ["fiberplant", [13714.064, 2836.0735, -2.2888184e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_1598 = _this;
  _this setPos [13714.064, 2836.0735, -2.2888184e-005];
};

 

 
I'm on the map Chernarus Version 1.0.5.1
 
Thank you in advance
Link to comment
Share on other sites

I think found out why its not worked for me.

I use the Safe Suicide 1.2.2 Script from mudzereli.

He use in his script also a modified ui_selectSlot.sqf.

So I am a little confused now.
Can use one of them, or both?

Is it possible to adjust one of them, so that safe Suicide and Harvest hemp will work?


Thanks in Advance!


 

Link to comment
Share on other sites

I think found out why its not worked for me.

I use the Safe Suicide 1.2.2 Script from mudzereli.

He use in his script also a modified ui_selectSlot.sqf.

So I am a little confused now.

Can use one of them, or both?

Is it possible to adjust one of them, so that safe Suicide and Harvest hemp will work?

Thanks in Advance!

 

Thats a bit beyond my knowledge but Im sure there is a way to combine them or something. Hopefully you get an answer

Link to comment
Share on other sites

It seems that a lot of the people experiencing trouble are running 1.0.5.1... I dont know if this script works for that version. Does anyone have it successfully working on a 1.0.5.1 server?

 

afaik it's be working fine ... i dont think anything change with this, unless its not installed correctly

 

 

I think found out why its not worked for me.

I use the Safe Suicide 1.2.2 Script from mudzereli.

He use in his script also a modified ui_selectSlot.sqf.

So I am a little confused now.

Can use one of them, or both?

Is it possible to adjust one of them, so that safe Suicide and Harvest hemp will work?

Thanks in Advance!

 

afaik it could work, but you need to customize his right click menu option to work with harvest hemp script, you will have to ask him how tho, as i havent studied his work enough to know how it works.

 

afaik it should be easy tho.

Link to comment
Share on other sites

I think found out why its not worked for me.

I use the Safe Suicide 1.2.2 Script from mudzereli.

He use in his script also a modified ui_selectSlot.sqf.

So I am a little confused now.

Can use one of them, or both?

Is it possible to adjust one of them, so that safe Suicide and Harvest hemp will work?

Thanks in Advance!

 

IN OVERWRITES\clickactions\config.sqf

just add your custom right clicks

you see near bottom

DZE_CLICK_ACTIONS = [

["ItemKnife","gather the Budz","execVM 'custom\hemp.sqf';","true"],
["ItemKiloHemp","smoke the Chronic","execVM 'custom\smokeshit.sqf';","true"]
Link to comment
Share on other sites

  • 3 weeks later...

Hey guys,

 

First let me say thank you for the script. 

 

I have this installed on my server and the plants are spawning just fine..  Here's my RPT 

23:28:16 "[Random_Weed_Farm]: waiting for BIS_fnc_findSafePos"
23:28:16 "[Random_Weed_Farm]: Function loaded ... Server Building 3 Weed Farm(s)"
23:28:16 "[Random_Weed_Farm]: Found Location for a farm (142142) [14275.3,6190.54] with 4 plants"
23:28:16 "[Random_Weed_Farm]: Found Location for a farm (109037) [10939.4,16707.3] with 5 plants"
23:28:16 "[Random_Weed_Farm]: Found Location for a farm (049051) [4974.04,15361.6] with 4 plants"
23:28:16 "[Random_Weed_Farm]: Weed Farm(s) Done ... Broadcasting locations for clients"

The problem I am having though is there arn't any map markers or broadcasts, does anyone have any suggestions as to where I could start to get these working.?

Link to comment
Share on other sites

 

would proberbly be better if you changed it to check if players inventory is full instead ... tbh i think setting a limit to how many you can have in your inventory is a bit stupid, since you can just put some down and harvest more, however checking if inventory is full will make sure the player can not have more magazines than allowed in inventory.

 

also i made a little somethin-somethin here for everyone who does not know how to use the editor or if you are just tierd of the same old field in the same old spot:

 

this script will create a random amount of farms and plants each restart, plants are created "labyrinth style" so it will seem like its placed perfectly close no matter how many plants you want and where they end up, markers are automaticly set for each farm and there is an option to blacklist areas like tradecitys ... (as always in my scripts) there is a few settings you can customize a bit ...

you can set how many farms you want max/min, how many plants you want max/min, how far from roads you want it to spawn and blacklisted areas where weed will not spawn (areas for cherno and napf is preset).

 

have fun:

 

 

 

no markers come up

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
×
×
  • Create New...