Any means to access inventory?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Mebaru
Posts: 19
Joined: Sun Oct 14, 2012 2:03 pm

Any means to access inventory?

Post by Mebaru »

Hello,
There's no means to access/manipulate party inventory or I am missing something? Couldn't find in docs.
User avatar
Shroom
Posts: 98
Joined: Tue Mar 27, 2012 6:37 pm
Location: UK

Re: Any means to access inventory?

Post by Shroom »

http://www.grimrock.net/modding/scripting-reference/

and scroll down to the last few entries in Champion section :)
User avatar
crisman
Posts: 305
Joined: Sat Sep 22, 2012 9:23 pm
Location: Italy

Re: Any means to access inventory?

Post by crisman »

Sure, what do you want to know? How to add an item? how to look for an item in the inventory? To remove it? _Here's the list of instructions. Hope it helps!

Champion:insertItem(slot, item)
Inserts an item to an equipment slot. Slot must be one of the following: 1 (head), 2 (torso), 3 (legs), 4 (feet), 5 (cloak), 6 (neck), 7 (left hand), 8 (right hand), 9 (gaunlets), 10 (bracers), 11-31 (backpack slots).

Champion:removeItem(slot)
Removes an item from an equipment slot.

Champion:getItem(slot)
Returns an item in an equipment slot.
User avatar
crisman
Posts: 305
Joined: Sat Sep 22, 2012 9:23 pm
Location: Italy

Re: Any means to access inventory?

Post by crisman »

@shroom oh man, you've beaten me for two seconds... :D
Mebaru
Posts: 19
Joined: Sun Oct 14, 2012 2:03 pm

Re: Any means to access inventory?

Post by Mebaru »

My bad. Missed info about 11-31 being backpack slots... :mrgreen: Thanks!
Mebaru
Posts: 19
Joined: Sun Oct 14, 2012 2:03 pm

Re: Any means to access inventory?

Post by Mebaru »

Hmm,
Champion:getItem() seem always returning nil to me - party:getChampion(1):getItem(i) wherever slot I test (ie 1-31). What's me doing wrong? :geek:

update:
Weird thing! all nil from getItem() is if your champions have only everlasting torch equiped. If party has any other item beside everlasting torch - getItem() works fine and return all items correctly, including debug torch.
User avatar
crisman
Posts: 305
Joined: Sat Sep 22, 2012 9:23 pm
Location: Italy

Re: Any means to access inventory?

Post by crisman »

Mebaru wrote:Hmm,
Champion:getItem() seem always returning nil to me - party:getChampion(1):getItem(i) wherever slot I test (ie 1-31). What's me doing wrong? :geek:

update:
Weird thing! all nil from getItem() is if your champions have only everlasting torch equiped. If party has any other item beside everlasting torch - getItem() works fine and return all items correctly, including debug torch.
I've tried but it's working fine for me... don't know what happened to you
Post Reply