Tovath Posted April 8, 2015 Share Posted April 8, 2015 Hello, The basic concept I am working on is a custom shovel for a character that never decays. Can I just comment out the code linking to the "finitieuses" function? Also can I force someone who is not the "character" to drop the shovel as if their inventory was full, or be unable to equip it at least? If you can tell me, what names in the file will also need to be completely changed to the new name that would be amazing. I'm trying to find good examples for comparison but I haven't found any great examples so far. Link to comment Share on other sites More sharing options...
greenglacier Posted April 8, 2015 Share Posted April 8, 2015 Maybe... @Mobbstar, help thiz guy plz. Link to comment Share on other sites More sharing options...
Tovath Posted April 8, 2015 Author Share Posted April 8, 2015 Any advice would be appreciated, I understand the code I have read reasonably well but I haven't tested very much of it etc. Link to comment Share on other sites More sharing options...
Kzisor Posted April 8, 2015 Share Posted April 8, 2015 @Tovath, Character Specific Items Tutorial to make the item infinite look at the Axe and then at Lucy. Spot the differences and remove the components which deal with it being sentient. Link to comment Share on other sites More sharing options...
Tovath Posted April 18, 2015 Author Share Posted April 18, 2015 Do you have a step by step tutorial to go with that file? I have a working custom item for a custom character in game, but when I add the lines from the file to my modmain.lua and the files to their folders it just crashes DST. Link to comment Share on other sites More sharing options...
SkullRave Posted April 18, 2015 Share Posted April 18, 2015 To remove the uses comment it out like this --inst:AddComponent("finiteuses") --inst.components.finiteuses:SetMaxUses(TUNING.WATHGRITHR_SPEAR_USES) --inst.components.finiteuses:SetUses(TUNING.WATHGRITHR_SPEAR_USES) --inst.components.finiteuses:SetOnFinished(inst.Remove)Add something like this to prevent other from picking it upinst.components.inventoryitem.onputininventoryfn = function(inst, player) if player.prefab ~= "CHARACTER NAME HERE" then inst:DoTaskInTime(0.1, function() player.components.inventory:DropItem(inst) player.components.talker:Say("It seems to slip right out of my hands!") end) endendYou can change the text to whatever you like or remove the player.component.talker:Say entirely Good luck modding. Link to comment Share on other sites More sharing options...
Tovath Posted April 19, 2015 Author Share Posted April 19, 2015 (edited) Yea I think I had finite uses figured out, thanks though! @Kzisor My bad, I let the artist do some custom dialogue and forgot I hadn't compiled since than. So he broke something, when I reverted back to a working state, I got your tutorial to work just fine thank you! Edited April 19, 2015 by Tovath Link to comment Share on other sites More sharing options...
Kzisor Posted April 19, 2015 Share Posted April 19, 2015 Yea I think I had finite uses figured out, thanks though! @Kzisor My bad, I let the artist do some custom dialogue and forgot I hadn't compiled since than. So he broke something, when I reverted back to a working state, I got your tutorial to work just fine thank you! I'm just going to note, that the step by step instructions are actually included in the mod itself as images. If you replicate the images in no certain order you will be able to create a perfect replica. The tutorial is also not meant to be a copy/paste thing for those wondering, I specifically made it not work with copy/pasting without additional steps being taken, after all you don't learn if all you do is copy and paste. Link to comment Share on other sites More sharing options...
Tovath Posted April 19, 2015 Author Share Posted April 19, 2015 I've got one custom item working in game with Character Specifics only now, the shovel.lua is a bit more convoluted than one of the hat lua though; because it has a gold and normal version in the same file. I'm attempting to get rid of the extra parts now in the shovel lua for my own custom lua. 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