Script - Return Weapon to Alter
Posted: Sat Dec 01, 2012 12:17 am
Do anyone have some idea of how to get an item/weapon placed on the ground to return to a location?
Official Legend of Grimrock Forums
https://mail.almosthumangames.com/forum/
https://mail.almosthumangames.com/forum/viewtopic.php?t=4419
Code: Select all
hammer_1:destroy()Code: Select all
if findEntity(hammer) then findEntity(hammer):destroy()Code: Select all
local thething = findEntity(hammer)
if thething then
thething:destroy()
endCode: Select all
function itemCheck(item)
for champ = 1,4 do
for slot = 7,8 do
x = party:getChampion(champ):getItem(slot)
if x ~= nil then
if x.name == item then
party:getChampion(champ):removeItem(slot)
returnItem(item,champ)
end
end
end
end
end
function returnItem(item,champ)
altar_1:addItem(spawn("BladeOfLightning"))
hudPrint("The Blade of Lightning yanks from your hand,")
hudPrint("and flies through the air, out of sight!")
playSound("lightning_bolt_hit")
end
function checkBlade()
itemCheck("BladeOfLightning")
endCode: Select all
scriptRemoveBladeDrop_1: cannot serialize table 'x' with metatable
stack traceback:
[C]: in function 'error'
[string "ScriptEntity.lua"]: in function 'saveValue'
[string "ScriptEntity.lua"]: in function 'saveState'
[string "GameMode.lua"]: in function 'saveGame'
[string "GameMode.lua"]: in function 'autoSave'
[string "Crystal.lua"]: in function 'onClick'
[string "GameMode.lua"]: in function 'mousePressed'
[string "GameMode.lua"]: in function 'update'
[string "Grimrock.lua"]: in function 'display'
[string "Grimrock.lua"]: in main chunk
OS Version 6.2
OEM ID: 0
Number of processors: 8
Page size: 4096
Processor type: 586
Total memory: 16349 MB
Free memory: 8289 MB
Display device 0:
Device name: \\.\DISPLAY1
Device string: NVIDIA GeForce GTX 670
State flags: 08000005
Display device 1:
Device name: \\.\DISPLAY2
Device string: NVIDIA GeForce GTX 670
State flags: 00000001
Display device 2:
Device name: \\.\DISPLAY3
Device string: NVIDIA GeForce GTX 670
State flags: 00000000
Display device 3:
Device name: \\.\DISPLAY4
Device string: NVIDIA GeForce GTX 670
State flags: 00000000