Choubidou Posted October 23, 2015 Share Posted October 23, 2015 Hi guys , im trying to use the function "write note" ( for journal , notebook etc ) to a drainable item . item Exempleitem{LightDistance = 20,Weight = 0.50,DisappearOnUse = FALSE,Type = Drainable,TorchCone = TRUE,UseDelta = 0.0005,LightStrength = 0.8,DisplayName = Exemple item,CanBeWrite = true,PageToWrite = 20,Icon = Exempleitem, The problem is , if i set Type = Drainable,the CanBeWrite = true,PageToWrite = 20, not work , it work only with type = Literature , so i need to have type Literature + drainable bur i dont know how to do this.I tried to modifie the ISInventoryPaneContextMenu.lua there :if testItem:getCategory() ~= "Literature" or testItem:canBeWrite() then isAllLiterature = false; end if testItem:getCategory() == "Literature" and testItem:canBeWrite() then canBeWrite = testItem; end like thisif testItem:getCategory() ~= "Literature" or testItem:getCategory() ~= "Drainable" or testItem:canBeWrite() then isAllLiterature = false; end if testItem:getCategory() == "Literature" or testItem:getCategory() == "Drainable" and testItem:canBeWrite() then canBeWrite = testItem; endBut it not work. If someone can help me would be very nice . Sorry for my english . Thanks Link to comment Share on other sites More sharing options...
MisterInSayne Posted October 23, 2015 Share Posted October 23, 2015 if testItem:getCategory() ~= "Literature" or testItem:getCategory() ~= "Drainable" or testItem:canBeWrite() then isAllLiterature = false;end^ this is your problem.this means: if the item is not literature or not drainable then.if the item is a drainable, it's not a literature, so doesn't get through. same vica versa. also, try doing: if ( testItem:getCategory() == "Literature" or testItem:getCategory() == "Drainable" ) and testItem:canBeWrite() then canBeWrite = testItem; endinstead of if testItem:getCategory() == "Literature" or testItem:getCategory() == "Drainable" and testItem:canBeWrite() then canBeWrite = testItem; end Link to comment Share on other sites More sharing options...
Choubidou Posted October 23, 2015 Author Share Posted October 23, 2015 I tried if ( testItem:getCategory() == "Literature" or testItem:getCategory() == "Drainable" ) and testItem:canBeWrite() then canBeWrite = testItem; endBut nothing change in game , like i have to modifie something else but i have no idea what to do ... i had search all " canBeWrite " files but only ISInventoryPaneContextMenu.lua contains this .... Link to comment Share on other sites More sharing options...
Choubidou Posted October 24, 2015 Author Share Posted October 24, 2015 Nobody can help me ? I cant continu my mod if i find not the solution Link to comment Share on other sites More sharing options...
EnigmaGrey Posted October 24, 2015 Share Posted October 24, 2015 You can only have one category per item (in this case, it's a literal object defined in Java, such as Literature). The way you get around it is working with an item's mod data (t = someObj:getModData(), t["canBeWrite"] = true) but you'll then have to build your own functionality. Might be a good idea to search the game files for carpentry/fishing books and see how they're done first, though. Link to comment Share on other sites More sharing options...
Choubidou Posted October 24, 2015 Author Share Posted October 24, 2015 Hum thanks to difficult for me I give up this idea . 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