Jump to content

Recommended Posts

Posted

Hey, I'm making mod with injectors. 

There's quite much I need to make, at least for learning's sake. 

 

Is there any more efficient way of making crafting result multiple items than using OnCreate with Lua? 

Well, that's not so important, it works this way so that can be left there. 

 

But more importantly, I need to get my hands on player's needs at lua scale, meaning I need to get modify all these pain, depression, hunger, thirst, and to temporary modify increase and decrease multipliers. I can't find those myself (I tried digging) so I hope someone of you can tell me where to get all that.

 

I can't remember right now what all other stuff I need help with, but these are first that came in mind. 

 

Reason where I need these are my so-called potions with longer effects, and to prevent continuous injecting without nasty side effects, like pain and getting heavily toxicated (yes, mixtures use alcohol), or eventually death. (That's grim)

if someone wants to know more, I'm willing to tell. 

My data is a bit scattered and unorganized so I don't attach it here, at least not yet. 

 

Kinda messy text, but I hope you can dig out what I meant.

Asking is always my last resort  :D

 

Thanks in advance. 

Posted

	player:getBodyDamage():RestoreToFullHealth();	player:getStats():setHunger(0);	player:getStats():setPanic(0);	player:getStats():setBoredom(0);	player:getStats():setThirst(0);	player:getStats():setFatigue(0);
I use this to heal the player constantly for debugging reasons.

RegularX has made a quite similar mod called XMod (IIRC) which has healing potions and lots of other stuff. I'd suggest that you check out his code too.

Posted

This XMod has quite interesting lua stuff there.

 


EDIT:

Still no way to get access to player pain and toxicity? I'd really like to get my injections have a bit more potent alcohol, and increase pain whenever using injections, or is health and pain same thing

 

How about that code behind pills, or is it hidden in java? 

 

I found these functions (accidentally), I thought I checked this site many times over...

Anyway, here's link if someone else had same problem.

http://projectzomboid.com/modding/index.html?zombie/characters/IsoGameCharacter.Stats.html


 

Also, is there any way to make new modifiers to items, and add new function in lua?

In this case "VialType" and "getVialType()".  

This would potentially shorten my lua code behind crafting. 

 item InjectorEmpty{Weight = 0.21,Type = Normal,VialType = Vial,DisplayName = Injector (Empty),Icon = InjectorEmpty.png,} item Vial{Weight = 0.01,Type = Normal,DisplayName = Vial,Icon = Vial.png,}

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