Ken Posted June 30, 2014 Share Posted June 30, 2014 I want to know how to add a costume option like "Play" for an item when you right click on it on inventory and how to make it to change the character status like health, boredom or happiness. Link to comment Share on other sites More sharing options...
RoboMat Posted June 30, 2014 Share Posted June 30, 2014 I suggest that you take a look at the InventoryContextMenu.lua file. This tutorial is outdated, but it shows you the basics:http://pz-mods.net/guide/how-to-create-inventory-context-menus/ Link to comment Share on other sites More sharing options...
Ken Posted June 30, 2014 Author Share Posted June 30, 2014 I suggest that you take a look at the InventoryContextMenu.lua file. This tutorial is outdated, but it shows you the basics:http://pz-mods.net/guide/how-to-create-inventory-context-menus/i understand that but now how do i add to change the status of the player not to destroy the item? Link to comment Share on other sites More sharing options...
RoboMat Posted June 30, 2014 Share Posted June 30, 2014 To change the player stats you'll have to "get" the player and then use the functions for whatever you want to do: http://theindiestone.com/zomboidjavadocs/zombie/characters/IsoPlayer.html The item shouldn't be destroyed by default. Link to comment Share on other sites More sharing options...
Ken Posted June 30, 2014 Author Share Posted June 30, 2014 To change the player stats you'll have to "get" the player and then use the functions for whatever you want to do: http://theindiestone.com/zomboidjavadocs/zombie/characters/IsoPlayer.html The item shouldn't be destroyed by default.and one more question...how do i make it just for an item? Link to comment Share on other sites More sharing options...
RoboMat Posted June 30, 2014 Share Posted June 30, 2014 Check if the clicked item is the item of your mod. Pseudocode: for item in listofitems do if item:getName() == 'awesomeModItem2' then doAweSomeStuff(item); endend Link to comment Share on other sites More sharing options...
Ken Posted June 30, 2014 Author Share Posted June 30, 2014 Check if the clicked item is the item of your mod. Pseudocode:for item in listofitems do if item:getName() == 'awesomeModItem2' then doAweSomeStuff(item); endendok...i'm confused right now but i'll try to understand..anyway thanks for help Link to comment Share on other sites More sharing options...
RoboMat Posted June 30, 2014 Share Posted June 30, 2014 What are you confused with in particular? Link to comment Share on other sites More sharing options...
Ken Posted June 30, 2014 Author Share Posted June 30, 2014 What are you confused with in particular?in the link that you gave me are 1000000 things and i don't know for sure what they are doing just by the namei'm new on modding so can you give me a starting code? Link to comment Share on other sites More sharing options...
Ken Posted June 30, 2014 Author Share Posted June 30, 2014 What are you confused with in particular?instead of "listofitems" i put my module? and how do i "get" player? and where do i put this in the code? in the code from your tutorial Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now