Page 1 of 1

adding a custom item

Posted: Thu Nov 07, 2013 11:27 am
by RChevalier
Hello, firstly I have no experience whatsoever in modding period, but wanted to start somewhere so... hence the reason why I post it here... any help would be greatly appreciated.

I'm currently playing the Master Quest mod solo, and I wanted to modify the spirit_mirror_pendant to give 50% instead of the default 25%. Is there a easy way to make this happen? I'm ok with a hard way as well so long as there are clear instructions. I would imagine cloning the original and editing the value would be a start but have no idea to actually implement it, what file to edit, where to put it, etc... thanks in advance.

Re: adding a custom item

Posted: Thu Nov 07, 2013 1:50 pm
by Komag
Unfortunately the properties of that item don't have anything to edit about the percentage of XP, that seems to be hardcoded in the game elsewhere that we don't have access to.

There are some potential tricks that might be possible, such as setting up on every monster death to check if anyone in the party has the pendant and adding extra XP manually to them, but that would be a lot of work

Re: adding a custom item

Posted: Thu Nov 07, 2013 4:11 pm
by msyblade
When you create a new dungeon in the editor, it will create a folder with the dungeon name in "documents/Almost Human/Legend of Grimrock/dungeons". In that folder you will find all of the files that make up your dungeon (minus everything default built into the game). Since all of the regular assets are not visible, it is recommended to download the "asset pack" from here, which has the definitions for all of the stock items/spells/monsters or objects. (The pendant is stock, in the asset pack). So, in the folder for your dungeon, there will be subfolders. One of those is called "scripts"; go in there and you want the "items.lua". You can then define your own object, or clone an existing one and change it slightly for your use (After checking out examples from the asset pack or existing mods with their source available). Many mods (including Komags Master Quest) have the source files available near the .dat file download, so I suggest you start there. Although, if you are completely inexperienced, Komags scripting and workarounds are sure to make your head spin, so you may try to find a simpler project to dissect. Hope this helps!

Re: adding a custom item

Posted: Thu Nov 07, 2013 9:23 pm
by petri
For what it's worth, the exp bonus of Spirit Mirror Pendant and many other hardcoded features of items can be modified from item definitions in LoG2. You can also define many sets of bonuses and enable/disable them at will :)

Re: adding a custom item

Posted: Thu Nov 07, 2013 10:28 pm
by Komag
Nice to hear, thanks! :D

Re: adding a custom item

Posted: Fri Nov 08, 2013 12:58 am
by DesperateGames
Rchevalier, as Komag said it might be possible but a lot of work as you would have to clone every monster in your dungeon to add a function exectuion to the onDie scripting Hooks. But if you are interested I'm sure we will be able to help you with this. A semi-hard approach would be to add an item that gives XP over time very slowly....if I think about it the effect should be similiar gameplay-wise as you exchange one free equipment slot against quicker leveling for this character. Maybe you need to add something to prevent someone leaving his computer on over night, but it should be less work to implement this I think.

Re: adding a custom item

Posted: Fri Nov 08, 2013 2:34 am
by Komag
I can't remember if we can check a character's XP? If so then we could very often check whether it has gone up and by how much, and add extra percentage. But now that I think about it, IIRC we can't check XP