Jump to content

Need help finding data/code/script


lance789

Recommended Posts

I'm looking for the data/code that is used by Betablockers and Sleeping Pills. Does anyone know where i can find the data which these two effect? (for example, code that effects panic).

Also, i cant seem to find the base game item distribution lua/script. can someone please tell me where it is?

Edited by lance789
Link to comment
Share on other sites

How do i distributed items to home refrigerators? Is it something like this:

-- Ham Sandwichtable.insert(SuburbsDistributions["all"]["stove"].items, "Base.HamSandwich");table.insert(SuburbsDistributions["all"]["stove"].items, 5.5);table.insert(SuburbsDistributions["grocery"]["counter"].items, "Base.HamSandwich");table.insert(SuburbsDistributions["grocery"]["counter"].items, 0.2);

what do i put for home refrigerators?

Link to comment
Share on other sites

-snip-

I believe for home refrigerators it should be

table.insert(SuburbsDistributions["all"]["fridge"].items, "Base.HamSandwich");table.insert(SuburbsDistributions["all"]["fridge"].items, 5.5); 

SuburbsDistribution.lua is located in Project Zomboid\media\lua\server\Items

Also code for Meds is hardcoded and not easily editable as far as I know.

Link to comment
Share on other sites

forgot to mention, i remember seeing somewhere where functions like getStress() and changeStress() were among a list of all functions in game. is there anyway to alter the values of these functions without having them be permanent? like for example, using hot drink to push back the time required for sleep to be necessary?

Link to comment
Share on other sites

  • forgot to mention, i remember seeing somewhere where functions like getStress() and changeStress() were among a list of all functions in game. is there anyway to alter the values of these functions without having them be permanent? like for example, using hot drink to push back the time required for sleep to be necessary?

In item script like, say:

 

item SleepKilla	{		Weight			=	0.1,		Type			=	Food,        	FatigueChange		=	-100,		DisplayName		=	Sleep Killer,		Icon			=	GenericIcon,	}

FatigueChange changes the tiredness level (So it basically pushes back sleep), the only item that does that (I believe) is Vitamins but it's such a tiny amount that it barely registers, 100 would probably remove tiredness related moodles, you'd need to experiment with it.

As for editing other moodle effects, I can't help you, sorry, I'm crap at lua. I do pray they will de-hardcode this stuff at some point.

Nevermind this go below to Edit3:

Edit: Actually, in item script you can have

 

BoredomChange = xx,StressChange = xx,UnhappyChange = xx,

This allows for changing Boredom, Stress and Happiness related moodles -xx is positive change xx is negative.

Edit2: I found one more:

EnduranceChange = xx,

It modifies endurance (Tiredness from running, swinging etc.) But -xx is negative and xx values are positive change. I don't think any item in-game uses that but it works nonetheless.

Edit3: Screw it here is a list of all things that I know you can do with item script:

item ExampleItem
{
Weight = 0.1,
        Type = Food, (Food, Drainable, Normal, Container) It really depends on what you intend to do with it.
        DaysTotallyRotten = x, (Days before food is rotten, adding unhappines and boredom + poison power to it)
        DaysFresh = x, (Days before food loses all effects other than hunger and gets boredom and happines penalty)
        HungerChange = x, (Hunger reduction\addition)
        ThirstChange = x, (Thirst reduction\addition)
        StressChange = x, (Stress reduction\addition)
        UnhappyChange = x, (Happiness reduction\addition)
        BoredomChange = x, (Boredom reduction\addition)
        EnduranceChange = x, (Endurance reduction\addition) -x is negative in this case!
        FatigueChange = x, (Tiredness reduction\addition)
        DisplayName = Example Name, (Name visible in game)
        Icon = ExampleIcon, (Icon the item uses in game)
        AlcoholPower        =   1, (For Disinfection, possibly)
        Alcoholic = TRUE, (For Alcholic beverages, AlcoholPower has nothing to do with it)
        Poison = true, (Poisonous TRUE\FALSE)
        PoisonPower = 40, (Poison Power, 40 is bleach levels, 5 Poison Ivy)
        UseForPoison = 15, (I don't know what this does)
        OBSOLETE = true, (Unknown, possible won't show up in-game through distribution without breaking saves)
        EvolvedRecipe = Cake:2, (For use with evolved recipes, don't know much about this)
        PoisonDetectionLevel = 1, (Unknown, possible how much of the item is required in recipe to show it's poison)
        AlwaysWelcomeGift = true, (Unknown effect TRUE\FALSE)
        FoodType     =   Meat, (Meat, Game, Fruits, Unknown Effect)
        DangerousUncooked = TRUE, (Is poison if uncooked TRUE\FALSE)
        IsCookable = TRUE, (Self explanatory TRUE\FALSE) 
        MinutesToBurn = 25, (Minutes before item is burned)
        MinutesToCook = 5, (Minutes before item is cooked)
        FishingLure     =   true, (Can be used as lure when fishing)
        CustomEatSound = PZ_DrinkingFromBottle, (Sound used when item is eaten)
        ReplaceOnUse = base.item, (When item is used (it runs out) base.item spawns in player inventory)
}

And that's only for food related items... Hope it helped.

Link to comment
Share on other sites

some of these i didnt know were usable, like

 

AlwaysWelcomeGift (need to get this implemented in my code)

EnduranceChange (what exactly does this apply to?)

AlcoholPower        =   1 (HOLY CRAP i didnt know this was a thing!!! need to use)

PoisonPower = 40 (didnt know this was a thing, should prob use this in conjunction with spicy foods)

UseForPoison = 15, (I don't know what this does)

EvolvedRecipe (i know how to use this, but since i've coded my items in a way to where some pieces are universal (such as batter and sandwhich fillings, i wont need this)

PoisonDetectionLevel (i've seen this somewhere before, i think it may come in handy when NPCs are enabled) >:3

ReplaceOnUse = base.item (is the base.item part specifically needed? i know pre build 30 you just have the item tag alone to spawn it on use)

 

 

So, this is pretty much what the first 40 items i have looks like:

 

-- [ Script File]module Extended_Foods {	imports		{			Base		}item TasteyHamSandwich		{			HungerChange		=	-95,			Type				=	Food,			DisplayName			=	Ham Sandwich,			IsCookable			=	FALSE,			DaysTotallyRotten	=	4,			UnhappyChange		=	35,			FatigueChange		=	-5,			StressChange		=	-3.0,			Icon				=	Item_EFM_BLANK.png,			DaysFresh			=	2,		}					recipe Make Ham Sandwich						{							BreadSlices=2/Sandwich,							HamSlices,							SandwichFilling,																					Result:TasteyHamSandwich,							Time:20.0,						}											recipe Make Ham Sandwich						{							HamSandwich,							SandwichFilling,																					Result:TasteyHamSandwich,							Time:20.0,						}}-- [ LUA File ]require "Items/SuburbsDistributions";require "Items/Extended_Foods";require "Items/Extended_Foods_Medical";Extended_Foods = {}Extended_Foods.version = "1.0";Extended_Foods.author = "lance789";Extended_Foods.modName = "Extended Foods Mod";-- Tastey Ham Sandwichtable.insert(SuburbsDistributions["all"]["stove"].items, "Base.TasteyHamSandwich");table.insert(SuburbsDistributions["all"]["stove"].items, 2);table.insert(SuburbsDistributions["all"]["fridge"].items, "Base.HamSandwich");table.insert(SuburbsDistributions["all"]["fridge"].items, 1.0); table.insert(SuburbsDistributions["grocery"]["counter"].items, "Base.TasteyHamSandwich");table.insert(SuburbsDistributions["grocery"]["counter"].items, 0.1);table.insert(SuburbsDistributions["spiffoskitchen"]["counter"].items, "Base.TasteyHamSandwich");table.insert(SuburbsDistributions["spiffoskitchen"]["counter"].items, 0.5);table.insert(SuburbsDistributions["kitchen_crepe"]["counter"].items, "Base.TasteyHamSandwich");table.insert(SuburbsDistributions["kitchen_crepe"]["counter"].items, 0.4);Events.OnGameBoot.Add(Extended_Foods.init);

so this looks about right?

Link to comment
Share on other sites

Looks good, don't ask me about .lua code though, I suck at .lua

EnduranceChange affects exhaustion from Running\swinging, you know, that moodle with lungs :P

ReplaceOnUse = module.itemname Not sure what you meant but base.item was just an example placeholder item not something that has to be there.

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