Jump to content

editing to "DJPaul's Sort Inventory"


Recommended Posts

Hi all,

I use mod "DJPaul's Sort Inventory" I'm trying to adjust to two different things were sorted into a backpack "Weapons" + "Armor"

https://steamcommunity.com/sharedfiles/filedetails/?id=444438334

 

Original:

return {
  ["workshop-444438334"]={
    configuration_options={ backpackCategory="weapons", funMode="yes", keybind=120, maxLights=2 },
    enabled=true 
  } 
}

 

Edit:

return {
  ["workshop-444438334"]={
    configuration_options={ backpackCategory="weapons+armor", funMode="yes", keybind=120, maxLights=2 },
    enabled=true 
  } 
}

modinfo.lua: https://pastebin.com/raw/ZCRhPCM9

modmain.lua: https://pastebin.com/raw/P0EFRgwx

Can anyone advise me how to do it?

Link to comment
Share on other sites

Hi

Thanks, good question! I don't know if you're familiar with Lua, but, I am not going to give you the code, but if you want to learn like I did and figure it out, I'm always happy to point you in the right direction:

1) Changing the option value like that was never going to work. The mod does not support multiple groups in the backpack preference. Sorry! :)

2) The item groups are defined here https://github.com/paulgibbs/DJPaul-Sort-Inventory/blob/6f50b3ab9db9a8ddc898bfdc0886cd89263c5354/modmain.lua#L219 and from line 257 onwards to the end of that function, that's the basics of the sorting logic.

I would suggest for now you edit the mod file and merge the itemIsArmour and itemIsWeapon checks together (say, both into the weapon bag), and then you can choose "weapon" in the game for both. Remember you'll need this modified on the server's copy, as well as local copies on your computer (I'm assuming you play multiplayer; if you're playing solo, you can get away with only changing your local copy).

The downside is that when I update the mod in the future, it is going to overwrite and lose your changes, so backup your changes once you have them working, so you can restore the files (or changed lines) in the future.

3) Alternatively, maybe we could work together and add support for multiple backpack item categories into the mod itself, so everyone can benefit. I'd definitely be up to help you, if you're willing to do most of the dev work on that. Let me know!

Thanks for using the mod :)

 

Link to comment
Share on other sites

Thank you for answer!

I know that LUA is a scripting language, but unfortunately I cannot work with him (I do not have the knowledge)

Quote

I would suggest for now you edit the mod file and merge the itemIsArmour and itemIsWeapon checks together (say, both into the weapon bag), and then you can choose "weapon" in the game for both. Remember you'll need this modified on the server's copy, as well as local copies on your computer (I'm assuming you play multiplayer; if you're playing solo, you can get away with only changing your local copy).

This solution i like. I beg you, you can edit the code and send it to me somewhere?

Link to comment
Share on other sites

8 hours ago, Ellie96 said:

why not ? :(

Because if each modder start to make another version of his mod for each person asking he will never do anything else. And because it's not a due to have someone doing something for you. Because it takes time. Because if you want something specific, you have to do your part of efforts. And because helping someone to do something is sometimes better than doing it for him.

 

I mean, not all the modders will accept that you change their mod to what you want. Here, he is ok, he is ok to help you and if you do your part he is even ok to add some changes to the main mod. It's a lot.

 

If you can't you can't. Not everyone want or is able to learn how to mod. But if you can't, you must respect its decision, not making sad smileys in the hope he'll change his mind.

Link to comment
Share on other sites

How this is related to my post ?

No, i will not teach you to work with LUA, but i did some tutorial about modding, you could look at them and download some simple mods to see how they work. Then try yourself to do a simple mod, then do things more difficult. Of course, you could ask for help time to time (in the forum, not to me), if you tried to find how to do by yourself first.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
  • Create New...