Jump to content

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


FragZ

Recommended Posts

 

If you want that the hemp doesn't despawn when you harvest it, just comment the lines 30,31,32 on the hemp.sqf, like this :

 

//deleteVehicle _weed;
//[_objectID,_objectUID] call server_deleteObj;
//_weed setDamage 1;

 

That makes it useless to spawn more than one plant... and it makes you infinite harvest.

We were talking about Respawning the weed after X amount of time... well I followed correctly xD

Link to comment
Share on other sites

Use this smokeshit.sqf to make it medicinal and  a good ole buzz

This will heal the user 100%

 

 

thankz by: fragZ, ZeroK00L and krixes and combined by Calamity

 

[\spoiler]

/*
by: ZeroK00L
*/
    [] spawn {
    hint "You roll a fatty and smoke it! Damn! That shit is the chronic!";
    player removeMagazine 'ItemKiloHemp';
    Remove_Drug_effects =
    {
    {
    ppEffectDestroy _x;
    } forEach (_this select 0);
    ppEffectDestroy ppe2;
    ppEffectDestroy ppe3;
    setaperture 0;
    };
    _time = time;
    _effects = [];
player playMoveNow "ActsPercMstpSnonWpstDnon_sceneBardak01";
    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 + 60 < time) exitWith {[_effects] call Remove_Drug_effects;};
    };
    };

Link to comment
Share on other sites

 I was having trouble getting this to run. I followed everything in the tutorial, but I could not get HALV's weedfarms.sqf to load up. Went ahead and added the weedfarm.sqf to my Missions inside my Scripts folder. Then added          [] execVM "Scripts\weedfarm.sqf"; in my init.sqf. Started showing on my map (Chernarus). I am using Vilayer server hosting. Maybe you can add that to the tutorial for those who get stuck like I did when using HALV's script? Unless I am the only one who ran into situation.

Link to comment
Share on other sites

 I was having trouble getting this to run. I followed everything in the tutorial, but I could not get HALV's weedfarms.sqf to load up. Went ahead and added the weedfarm.sqf to my Missions inside my Scripts folder. Then added          [] execVM "Scripts\weedfarm.sqf"; in my init.sqf. Started showing on my map (Chernarus). I am using Vilayer server hosting. Maybe you can add that to the tutorial for those who get stuck like I did when using HALV's script? Unless I am the only one who ran into situation.

I think adding his script to the mission pbo and calling it in the init.sqf is pretty standard stuff man. People who are stuck are just gonna have to do it the old fashioned way and read the comments. Kudos to you for detailing your specific problem and the solution you found, this will help anyone who is lost.

Link to comment
Share on other sites

For anyone having this error in their RPT and being stuck at waiting for host.

ErrorMessage: File mpmissions\__cur_mp.Napf\description.ext, line 152: /ExtraRc/: Missing '}'

For me the solution was in the extra_rc.hpp file. When following Maca's instructions, do not include this

class ExtraRc {
    class 30m_plot_kit {
        class Test1 {
            text = "Test 1";
            script = "hint ""Test 1 was clicked!"";";
        };
        class Test2 {
            text = "Test 2";
            script = "hint ""Test 1 was clicked!"";";
        };
    };
};

Only include this

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

Make sure you adjust the paths to fit your server... for example my extra_rc.hpp is in a folder called custom, but the smokeshit and hemp.sqf are located in a folder called SmokeWeed which is inside the custom folder. So my paths look like

"execVM 'custom\SmokeWeed\smokeshit.sqf'";

As a side note, I copy pasted this error from someone on the second page. I am not running NAPF, Im running Chernarus so my error looked slightly different.

Link to comment
Share on other sites

I propose 2 things for people who know what they're doing (that rules me out).

1. Edit the healing version of the smokeshit.sqf so that it fully heals you but makes you hungry and thirsty.

2. Someone combine this with DZMS so AI are defending the weed plants :)

 

Side note. Excellent job everyone!

Link to comment
Share on other sites

Use this smokeshit.sqf to make it medicinal and  a good ole buzz

This will heal the user 100%

 

 

thankz by: fragZ, ZeroK00L and krixes and combined by Calamity

by: ZeroK00L    */
    [] spawn {
    hint "You roll a fatty and smoke it! Damn! That shit is the chronic!";
    player removeMagazine 'ItemKiloHemp';
    Remove_Drug_effects =
    {
    {
    ppEffectDestroy _x;
    } forEach (_this select 0);
    ppEffectDestroy ppe2;
    ppEffectDestroy ppe3;
    setaperture 0;
    };
    _time = time;
    _effects = [];
player playMoveNow "ActsPercMstpSnonWpstDnon_sceneBardak01";
    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 + 60 < time) exitWith {[_effects] call Remove_Drug_effects;};
    };
    };

[\spoiler]

This didnt work for me.

 

Oh, I see the problem. Some bad copy pasta I think sir. Your script should look like

/*
by: ZeroK00L    
*/
    [] spawn {
    hint "You roll a fatty and smoke it! Damn! That shit is the chronic!";
    player removeMagazine 'ItemKiloHemp';
    Remove_Drug_effects =
    {
Link to comment
Share on other sites

I propose 2 things for people who know what they're doing (that rules me out).

1. Edit the healing version of the smokeshit.sqf so that it fully heals you but makes you hungry and thirsty.

2. Someone combine this with DZMS so AI are defending the weed plants :)

 

Side note. Excellent job everyone!

Second part is easy.  I have done it with custom bases I have setup.  Just setup static spawns through DZMS and make it the coord of your weed farm.  I guess if you are using the random spawn weed farm script it would be a little more difficult, but for those with static spawn weed farms this would work perfectly.

Link to comment
Share on other sites

Having issues with this script.  Running epoch 1.0.4.2.  I am using the random spawn script for the weed farms as well.  I do use Vilayer and have put hemp.sqf, smokeshit.sqf and weedfarm.sqf into my mission pbo at folder location: custom\weedscript.  I have placed the following line in my mission pbo's init.sqf with the rest of my custom buildings: _nil = [] execVM "custom\weedscript\weedfarm.sqf";  I have edited my description file with:  #include "custom\extra_rc.hpp"  as the very last line.  And have placed the extra_rc.hpp file from the first post in the thread in the custom folder.  So far in game I don't see any markings on the map of where the weedfarms are.  I did see in my .RPT the locations where they spawned tho, so I went there.  The farms are there and I do get the harvest plant option from my knife, but it keeps telling me I need to be close to a plant in order to harvest and I am right on top of the plant.  Also, I gave myself a kilo of hemp through the database and when right clicking on it all i get is the option to craft bandages.  Any ideas?

Link to comment
Share on other sites

Ok, got it mostly working, had a step missing in the maca installation.  Ok so now the weeds spawn, i can smoke it and I can harvest it.  When I smoke it my guy just kinds of walks around funny and then drops on the ground lol.  Is this normal?  Last and most important, are the various weed farms supposed to show up on the map?  If they are then they aren't for me and would like some help figuring that out.  I am using the random weed farm script.

Link to comment
Share on other sites

Ok, got it mostly working, had a step missing in the maca installation.  Ok so now the weeds spawn, i can smoke it and I can harvest it.  When I smoke it my guy just kinds of walks around funny and then drops on the ground lol.  Is this normal?  Last and most important, are the various weed farms supposed to show up on the map?  If they are then they aren't for me and would like some help figuring that out.  I am using the random weed farm script.

I copy pasted HAVL's code and it works perfectly fine with green markers on weed farm locations. As of the smokign script, try to go down the OP to see other variants of the smoke script.

Here is mine:

 

     /*
    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;};
    };
    };


This version have a blur, no animations, and it lasts a minute and a half (look the _time + 90 part) and it replenish player's health.

Link to comment
Share on other sites

Second part is easy.  I have done it with custom bases I have setup.  Just setup static spawns through DZMS and make it the coord of your weed farm.  I guess if you are using the random spawn weed farm script it would be a little more difficult, but for those with static spawn weed farms this would work perfectly.

yea Im using the random ones to make it a bit more like a mission in and of itself.

Link to comment
Share on other sites

Anyone having trouble since updating to 1.0.5.1 with the fiber plant exploding when harvested? Just started after the update. I didn't know I was making butane oil!

My guess would be your antihack... Try disabling it and test it.

I run it perfectly fine still.

 

i was wanting to add other plant types to the harvest side of this script, i figured u could add the plants to the array, but how would u handle the output items..

Just add the item you want it to give... Like add a right click option on for example your hatchet and make it execute a script like for the weed, but make it give you *Ruby* for example... Depends on what you want to work it with :)

HMU if you are still having trouble or you want more precise infos on it.

Link to comment
Share on other sites

Hi, a few things:

you allready can harvest Hemp Plants but only the natural occuring ones (simply by clicking "Harvest Plant") could we add your harvest hemp function to the normal harvesting process?

So there are not 2 functions which do basically the same.

 

And the next question, my dynamically generated weedfarm script is not working properly. I use the one provided in the first post and everything is working fine except there are no markers on the map. 

 

This is the part in my .rpt

16:27:45 "[Random_Weed_Farm]: waiting for BIS_fnc_findSafePos"
16:27:45 "[Random_Weed_Farm]: Function loaded ... Server Building 5 Weed Farm(s)"
16:27:45 "[Random_Weed_Farm]: Found Location for a farm (128052) [12807.8,15183.9] with 4 plants"
16:27:45 "[Random_Weed_Farm]: Found Location for a farm (189166) [18949.3,3821.38] with 4 plants"
16:27:45 "[Random_Weed_Farm]: Found Location for a farm (115045) [11597.8,15943.2] with 4 plants"
16:27:45 "[Random_Weed_Farm]: Found Location for a farm (135127) [13552.1,7706.48] with 4 plants"
16:27:45 "[Random_Weed_Farm]: Found Location for a farm (188086) [18835.8,11864.3] with 4 plants"
16:27:45 "[Random_Weed_Farm]: Weed Farm(s) Done ... Broadcasting locations for clients"
16:27:45 "Res3tting B!S effects..."
16:27:45 "\z\addons\dayz_code\system\REsec.sqf:Monitoring Remote Exe..."
 
 
What should i do?
Link to comment
Share on other sites

 

Hi, a few things:

you allready can harvest Hemp Plants but only the natural occuring ones (simply by clicking "Harvest Plant") could we add your harvest hemp function to the normal harvesting process?

So there are not 2 functions which do basically the same.

 

And the next question, my dynamically generated weedfarm script is not working properly. I use the one provided in the first post and everything is working fine except there are no markers on the map. 

 

This is the part in my .rpt

16:27:45 "[Random_Weed_Farm]: waiting for BIS_fnc_findSafePos"
16:27:45 "[Random_Weed_Farm]: Function loaded ... Server Building 5 Weed Farm(s)"
16:27:45 "[Random_Weed_Farm]: Found Location for a farm (128052) [12807.8,15183.9] with 4 plants"
16:27:45 "[Random_Weed_Farm]: Found Location for a farm (189166) [18949.3,3821.38] with 4 plants"
16:27:45 "[Random_Weed_Farm]: Found Location for a farm (115045) [11597.8,15943.2] with 4 plants"
16:27:45 "[Random_Weed_Farm]: Found Location for a farm (135127) [13552.1,7706.48] with 4 plants"
16:27:45 "[Random_Weed_Farm]: Found Location for a farm (188086) [18835.8,11864.3] with 4 plants"
16:27:45 "[Random_Weed_Farm]: Weed Farm(s) Done ... Broadcasting locations for clients"
16:27:45 "Res3tting B!S effects..."
16:27:45 "\z\addons\dayz_code\system\REsec.sqf:Monitoring Remote Exe..."
 
 
What should i do?

 

What map are you running?

 

First of all, if you would follow the topic, I said this is made for CHERNARUS map. On Chernarus, there is NO weed plants thus you cannot harvest em by right clicking knife and using *Harvest Plant*. This is a mod to fit Chernarus. On NAPF or other maps using weed plants, when you harvest the weed plant it should give you ItemKiloHemp I guess... Just add THAT part to the extra_rc.hpp:

 

class ExtraRc {
	class ItemKiloHemp {
class smokeweed {
text = "Smoke the shit";
script = "execVM 'scripts\smokeshit.sqf'";
};
};
};

This basicly make the smoking script fit the harvested goods from the plant, no matter where it is taken in the game from (trader etc).

As of the random fields, they work fine for me. I used HAVL's code since it's all his work so you might want to ask him about that.

 

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...