Hi,
I am not good programmer so i need help. I made new recipe (which creates item) and i have a riddle in which you must put that item on altar and it spawns scroll with text. But then i need, as the scroll spawns, to destroy the item from recipe and i am unable to set that things ID to destroy it with script destroy(). Could anybody help please?
Help with scripting (destroying item from recipe)
Help with scripting (destroying item from recipe)
Runebooks: http://www.nexusmods.com/legendofgrimrock2/mods/13/? for Legend of Grimrock 2
Runebooks and books: http://grimrock.nexusmods.com/mods/217/ for Legend of Grimrock 1
Runebooks and books: http://grimrock.nexusmods.com/mods/217/ for Legend of Grimrock 1
Re: Help with scripting (destroying item from recipe)
Hi, so if I understood correctly, you want to put a special item on an altar, destroy it and then spawn a scroll on the same altar?
If it is right, then the script should be
Should work, I haven't tested - but you need to modify it for your necessity - altar must be your altar name, and item_name the name of your item.
If you have any other problems let me know
If it is right, then the script should be
Code: Select all
function spawnScroll()
for i in altar:containedItems() do
if i.name == "item_name" then
i:destroy()
altar:insertItem(spawn("scroll"))
end
end
end
If you have any other problems let me know
Re: Help with scripting (destroying item from recipe)
It is exactly what i wanted
and it is working perfectly
thak you so much 
Runebooks: http://www.nexusmods.com/legendofgrimrock2/mods/13/? for Legend of Grimrock 2
Runebooks and books: http://grimrock.nexusmods.com/mods/217/ for Legend of Grimrock 1
Runebooks and books: http://grimrock.nexusmods.com/mods/217/ for Legend of Grimrock 1
Re: Help with scripting (destroying item from recipe)
No problem ^^ Glad it helped 