Jump to content

Icky Stick Mod


RickL

Recommended Posts

I was just wondering if one of you more experienced modders could take a look at something I am working on?

 

I'm attempting to edit the in game smokes to be more realistic, being as I don't like to carry around 1000's of individual smokes. Basically, I'm trying to package them for later consumption.

 


 

What I need of you, is to let me know (or edit my files), of what I need to do to get this working correctly.

 

Thanks

Link to comment
Share on other sites

 

*snip*

 

Here's what I noticed. First in the mod.info file:

name=?IckySticksposter=poster.pngdescription=Package them Smokesid=?IckySticks

The question marks in the name and id need to be removed.

 

and in the .txt file:

        imports	{		Base,items	}

"items" is not a proper module, remove it. That line should just read Base with no comma.

	item Cigarette	{		...	}

If you are trying to edit the Base cigarette item, you need to add an "s" on the end of the name. The base item is Cigarettes.

	item CartonofCigarettes    {		Count	=	1,		Weight	=	1,		Type	=	Food,		DisplayName	=	Carton of Cigarettes,		Icon	=	IckySticks,    }}

The brace at the end here needs to be moved to the very bottom of the file. This is a big one, causing all the recipe code below to be completely ignored by the game.

recipe Put in Pack	{	   Cigarette,       Cigarette=25,       Result:PackofCigarettes,       Time:20.0,	}

Remove reference to extra cigarette, add "s" to the "Cigarette" ingredient. Just Cigarettes=25, should work fine for the ingredients

	recipe Open Carton of Cigarettes	{	  PackofCigarettes,	  Result:PackofCigarettes=8,	  Time:25.0,	}}

Change the ingredient to the CartonofCigarettes, and add the closing brace that was moved from the end of the items section to close out all the code.

 

Also, something to keep in mind with the changes you've made is that cigarettes will be much rarer as you've reduced the count to 1 without editing the distribution, meaning that cigarettes will be found in singles, with no chance of finding a pack or carton. I would recommend making the base Cigarettes item your pack item, and make the single cigs into a new item, kind of like this:

	item Cigarette	{		Count	=	1,		Weight	=	0.5,		Type	=	Food,		DisplayName	=	Pack of Cigarettes,		Icon	=	IckySticks,	}		item SingleCigarette	{		Count	=	1,		HungerChange	=	0,		Weight	=	0.0,		RequireInHandOrInventory	=	Lighter,		Type	=	Food,		UnhappyChange	=	-10,		DisplayName	=	Cigarette,		StressChange	=	-25,		Icon	=	IckySticks,		CustomContextMenu = Smoke,		CustomEatSound = 	}

That way, you don't have to edit the loot distribution, and now you'll find packs that can be opened for 25 (btw, all standard packs in America that I'm aware of carry 20 smokes, not 25, and 10 packs per carton, but maybe those just aren't my brands...) where you would have found 20 loose cigs before. Just don't forget to change the recipes to reference Cigarettes when you mean a pack, and SingleCigarette or whatever you decide to call it when you mean a cig.

 

Haven't tested it, but it should work after those changes. Hope this helps, good luck!

 

Edit: link removed, having some issues after a quick playtest. Maybe I'll give this one a further look later on, but I really don't have the time right now. Hope this gets you in the right direction, at least.

Link to comment
Share on other sites

It does help... a lot, thank you.

 

It kinda works in game now. I can add them to a package or carton, but.... the only problems are:

 

I get the option to pack into cartons but the carton does not show up in my inventory when I pack them, whereas packages do and when I open packages, I get 400 cigarettes placed in my inventory. I could not test opening cartons since they don't show up

 

I've changed it so it takes from the base files as you suggested (ie... renamed "cigarette" to "cigarettes").

 

I guess I need to play around with things a bit more, but at least it does show up in game. Thanks again.

 

 

One last thing, I'm from the Canada part of America, packs come in 25's, 20's and I think maybe 15's.

Link to comment
Share on other sites

Ok, things pretty much work as intended with this code:

 

module IckySticks{	imports	{		Base	}/****** Items ******/		item PackofCigs	{		Count	=	1,		Weight	=	0.5,		Type	=	Food,		DisplayName	=	Pack of Cigarettes,		Icon	=	IckySticks,	}		item CartonofCigs    {		Count	=	1,		Weight	=	1,		Type	=	Food,		DisplayName	=	Carton of Cigarettes,		Icon	=	IckySticks,    }	/****** Recipes ******/		recipe Put in Pack	{	   Cigarettes=20,       Result:PackofCigs,       Time:20.0,	}		recipe Put in Carton	{	   PackofCigs=10,       Result:CartonofCigs,       Time:30.0,	}		recipe Open Pack	{	  PackofCigs,	  Result:Cigarettes=2,	  Time:15.0,	}	recipe Open Carton	{	  CartonofCigs,	  Result:PackofCigs=10,	  Time:25.0,	}}

 

but if I unpack a pack of cigs,

recipe Open Pack	{	  PackofCigs,	  Result:Cigarettes=2,	  Time:15.0,	}

I get 40 cigs in my inventory.

 

If I change Result:Cigarettes=2, to Result:Cigarettes=1, I only get a single cig. instead of the 40.

 

If I go higher in numbers, ie. Result:Cigarettes=20, then I get 400 single cigs in my inventory.

 

I really don't have any idea why.

Edited by RickL
Link to comment
Share on other sites

Htm, try changing the result for the pack open recipe to just Result:Cigarettes, without the numbers. That might trigger Cigarettes count number properly, giving 20.

Also, I don't think packs or cartons need an item type of Food. I forget if misc items even have a type, but look up something like nails to see what type if any to use.

Link to comment
Share on other sites

Htm, try changing the result for the pack open recipe to just Result:Cigarettes, without the numbers. That might trigger Cigarettes count number properly, giving 20.

 

That did not work, unfortunately.

 

Could it be a bug?

 

Also, I don't think packs or cartons need an item type of Food. I forget if misc items even have a type, but look up something like nails to see what type if any to use.

 

I changed them to be what nails are: Type = Normal,

Link to comment
Share on other sites

So... I ended up drinking a bunch of coffee tonight, which means tinkering with mods! And some insomnia later, but right now we live in the present!

 

I got it working, with two glitches that I don't know how to fix. The problem was how the edits to the Base Cigarettes item were being done, which is required to remove the Count (so that the unpacking recipe gives the right number) and change it to the Cigarette Pack (so that distribution doesn't have to be changed to still find whole packs as loot). Here's what I did:

 

IckySticks.txt

module IckySticks{	imports	{		Base, farming	}/****** Items ******/		item CigaretteSingle	{		HungerChange	=	0,		Weight	=	0.0,		RequireInHandOrInventory	=	Lighter,		Type	=	Food,		UnhappyChange	=	10,		DisplayName	=	Cigarettes,		StressChange	=	-25,		Icon	=	IckySticks,		CustomContextMenu = Smoke,		CustomEatSound = 	}		item CartonofCigs    {		Weight	=	1,		Type	=	Normal,		DisplayName	=	Carton of Cigarettes,		Icon	=	IckySticks,    }	/****** Recipes ******/		recipe Put in Pack	{	   CigaretteSingle=20,       Result:Cigarettes,       Time:20.0,	}		recipe Put in Carton	{	   Cigarettes=10,       Result:CartonofCigs,       Time:30.0,	}		recipe Open Pack	{	  Cigarettes,	  Result:CigaretteSingle=20,	  Time:15.0,	}	recipe Open Carton	{	  CartonofCigs,	  Result:Cigarettes=10,	  Time:25.0,	}	recipe Make Flies Cure	{        GardeningSprayEmpty,        Water=3,		CigaretteSingle=5,		Result:GardeningSprayCigarettes,		Time:40.0,	}} 

This file adds all the recipes, and the new items being added by the mod. Now that the Base Cigarettes is the pack (see below), a new CigaretteSingle is made (with the count removed). From here, you can edit the amount you get from the packing/unpacking recipes, and even the stat changes from smoking a stogie (maybe change the unhappiness into a positive value while taking a hit to boredom?). This also imports the farming module so that the Insecticide Spray can be made with the new CigaretteSingle item, but there isn't any way to remove the old recipe (which now eats up 5 whole packs) without editing the farming.txt file directly.

 

IckySticksBaseEdits.txt (in the same folder)

module Base{	item Cigarettes	{		Weight	=	0.5,		Type	=	Normal,		DisplayName	=	Pack of Cigarettes,		Icon	=	IckySticks,	}}

The problem with editing the Base Cigarettes item before was that you can't edit another module's item by importing it into a different module. You have to load that module directly, which requires a new .txt file with a different module line and no imports block.

 

Also, there's a slight-to-moderate bug that I noticed in testing that I don't know how to fix. Cigarettes have to have Food as their item type to be able to smoke them, and any time a recipe has a food item as a result, you gain Cooking XP. This means you get XP every time you open a pack (6 without reading skillbooks in my playtesting), creating an infinite XP exploit by packing and unpacking cigarettes, allowing you to master Cooking with very little effort as well as a source of infinite skill points.

 

The only way I can think of to fix this would be to change Cigarettes into a pill, but I couldn't get the stat changes to work because I couldn't find where in the lua files that stats for pill are defined.

 

So if you're okay with an Insecticide recipe that can eat up 5 packs instead of 5 cigarettes if you click on the wrong recipe, and an infinite-xp glitch, here's my caffeine-induced contribution...

 

Dropbox Link

 

Take it easy! All this typing about Cigarettes... time for a nicotine break!

Link to comment
Share on other sites

I'm OK on everything but the exploit. I'll make a post in support and see if they can tell me where to find the lua that the pill stats are located in, as that would be a better way to go. I did find something in for pills in the base items.txt but I don't think that will work.

	item Pills	{		Weight	=	0.2,		Type	=	Drainable,        UseDelta	=	0.1,		UseWhileEquipped	=	FALSE,		DisplayName	=	Painkillers,		Icon	=	PillsPainkiller,		Tooltip = Tooltip_Painkillers,	}	item PillsAntiDep	{		Weight	=	0.2,		Type	=	Drainable,        UseDelta	=	0.1,		UseWhileEquipped	=	FALSE,		DisplayName	=	Anti depressants,		Icon	=	PillsAntidepressant,		Tooltip = Tooltip_PillsAntidepressant,	}	item PillsBeta	{		Weight	=	0.2,		Type	=	Drainable,        UseDelta	=	0.1,		UseWhileEquipped	=	FALSE,		DisplayName	=	Beta Blockers,		Icon	=	PillsBetablocker,		Tooltip = Tooltip_PillsBetablocker,	}	item PillsSleepingTablets	{		Weight	=	0.2,		Type	=	Drainable,        UseDelta	=	0.1,		UseWhileEquipped	=	FALSE,		DisplayName	=	Sleeping Tablets,		Icon	=	PillsSleeping,		Tooltip = Tooltip_PillsSleeping,	}

 

Also I added:

 

BoredomChange = 5,

 

and

 

UnhappyChange = -5,

 

That should be enough I feel.

 

Again, thank you very much for the help. You will of course, get credit. (:

 

POE

Link to comment
Share on other sites

I agree, making it a pill would be the way to go. The problem is that stats for pills (like unhappiness, etc. with exception of vitamins fatigue change) aren't in the scripts or lua folders as far as I can tell. If they can be changed to a pill it would probably be best to get rid of loose cigs altogether and make the pack a drainable item with UseDelta of 0.05 (so that it gets drained after 20 uses). That would also fix the problem of the insecticide, since we wouldn't need the duplicate recipe anymore.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...