Script help need - SOLVED

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Script help need - SOLVED

Post by Drakkan »

Hi guys, it was a while, but I need your help again :) If somebody wanna make script which I need for my dungeon I will be reeeelay glad. This script is somehow complex, but I think it could be done.

Ok here is the thing - new member called Insal joins party (I have already used grimwigedts for it) - this will enable timer called Thief. After some time (let say 10 min) I need following script to start -

Insal will leave the party and steal all torches from all party members and also some kind of food from all members (lets say Pitroot breads and all chees). THeoreticaly it is not difficult (disable particular champion, run items iterator checks...) but practicaly I am not able to write it.
THanks for any help
EDIT: few notes - Insal could be any party member slot. All items carried by Insal (other then torches and food) need to be dropped on floor when he leave party
Last edited by Drakkan on Tue Apr 02, 2013 9:24 pm, edited 1 time in total.
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: Script help need

Post by Drakkan »

ok i got so far now - this script disable Insal from the party

Code: Select all

function remove()
removeChampion("Insal")
end

function removeChampion(name)
for i=1,4 do
local champ = party:getChampion(i)
if champ:getEnabled() and champ:getName() == name then
champ:setEnabled(false)
end
end
end
this script steal all items I need from inventories

Code: Select all

function steal()
stealItem("torch")
stealItem("pitroot_bread")
end

function stealItem(itemname)
 for champion=1,4 do
  for slot=1,31 do
   local item = party:getChampion(champion):getItem(slot)
   if item and item.name == itemname then
    party:getChampion(champion):removeItem(slot)
end
end
end
end
now I need all items carried by Insal other than above (torches, bread) to be dropped on floor. Any help pls ?
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: Script help need

Post by AdrTru »

Try to spawn new item of same type as you remove from party.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: Script help need - SOLVED

Post by Drakkan »

alraedy solved, thanks for tip anyway and thanks to John Wordsworth for help
Breath from the unpromising waters.
Eye of the Atlantis
Post Reply