Return to Inventory
Re: Return to Inventory
one thing you might want to do is flavour the text and add a sound to when it drops the torch too =)
Re: Return to Inventory
Yeah I noticed that afterward :p
- vidarfreyr
- Posts: 71
- Joined: Sat Oct 20, 2012 4:40 am
Re: Return to Inventory
I´m trying to use this script to disarm the players, that is: taking any and all items in hands.
I made a simplified script..
..and sure enough it removes any item from hands and puts them in inventory. But the script fails when the inventory is full. Returning the error: "string expected, got table". Seems to me that the spawn function can't read the 'item' variable in the same way that the 'insertItem' command does. Any ideas for a workaround? Any other variable type I could use?
I made a simplified script..
SpoilerShow
Code: Select all
function disarm()
for champ = 1,4 do
for slot = 7,8 do
item = party:getChampion(champ):getItem(slot)
if item ~= nil then
for itemSlot = 11,32 do
if itemSlot < 32 then
if party:getChampion(champ):getItem(itemSlot) == nil then
party:getChampion(champ):insertItem(itemSlot,item)
party:getChampion(champ):removeItem(slot)
break
end
else
spawn(item,party.level,party.x,party.y,party.facing)
party:getChampion(champ):removeItem(slot)
break
end
end
end
end
end
end
- vidarfreyr
- Posts: 71
- Joined: Sat Oct 20, 2012 4:40 am
Re: Return to Inventory
..perhaps a use of wildcards would be needed here?
Re: Return to Inventory
it's beyond me but Xanathar can do it
Finished Dungeons - complete mods to play
Re: Return to Inventory
Hi
the best solution would be:
In this way it should handle all the cases like nested containers, scrolls, torches, etc. etc.
How to install grimq:
the best solution would be:
- Install grimq (see my signature, it's just a file to be copy/pasted into your dungeon, so don't fear its complexity) Installation notes below.
- Replace the spawn/removeItem part with the code below:
Code: Select all
local saveditem = grimq.saveItem(item)
party:getChampion(champ):removeItem(slot)
grimq.loadItem(saveditem, party.level, party.x, party.y, party.facing, saveditem.id)
How to install grimq:
- Download the zip from http://code.google.com/p/lualinq/downlo ... -1.3.2.zip
- Extract grimq.lua, and copy paste its code into a scripting entity in your dungeon called grimq
- Done
... - (You might also want to change AUTO_ALL_SECRETS=true to AUTO_ALL_SECRETS=false at the top of grimq scripting entity).
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com
The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563
My preciousss: http://www.moonsharp.org
The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563
My preciousss: http://www.moonsharp.org