Re: Ask a simple question, get a simple answer
Posted: Mon Oct 26, 2020 2:35 am
Official Legend of Grimrock Forums
http://grimrock.net/forum/
1) It must be this thead:ratman wrote: ↑Tue Oct 27, 2020 7:18 pm I have two questions: Firstly, I believe that I saw somewhere on the forum that someone had a script so that if the party was wearing metal armor they took damage, but I can't find that topic again. Secondly, how do I make custom portraits for my mod? Is there an exact size that they need to be? Thanks.
About the format... In that linked thread Petri mentions TGA, but the asset pack portraits are in DDS format. DDS format also works, but it's not always a save option in one's image editor. *Even so... DDS portraits must be referenced as .tga files in the scripts.
Yes, thank you. I'm trying to modify it so that when the party is in the snowy maps, or the desert maps, they take cold or fire damage depending on the armor they are wearing. (in the snowy map they would take less damage for cloth or leather armor, and more for metal or no armor.)Zo Kath Ra wrote: ↑Tue Oct 27, 2020 9:13 pm 1) It must be this thead:
A thank you and a script question
Code: Select all
rock_1:setWorldRotationAngles(0, 0, 0)
rock_1:setSubtileOffset(0, 0)
rock_1:setWorldPositionY(0)
Code: Select all
function setSurfaceItemFacing(containerId, identifier, facing) --identifier can be object name or ID
if type(containerId) ~= "table" then
local obj = findEntity(containerId)
facing = iff(facing<4 and facing>-1, facing, 0)
if obj then
for _,itm in chest_1.surface:contents() do
if identifier == itm.go.name or identifier == itm.go.id then
local subtileX, subtileY = itm.go:getSubtileOffset()
local pos = itm.go:getWorldPositionY()
itm.go:setPosition(obj.x,obj.y,facing,obj.elevation,obj.level)
itm.go:setSubtileOffset(subtileX,subtileY)
itm.go:setWorldPositionY(pos)
return
end
end
print("ERROR: "..self.go.id.." : setSurfaceItemFacing : \"item not found\"") --comment out if using with delayedCall.
else
print("ERROR: "..self.go.id.." : setSurfaceItemFacing : \"container not found\"")
end
else local caller = iff(containerId.go and containerId.go.name, containerId.go.name.."s", "caller")
print("ERROR: "..self.go.id.." : setSurfaceItemFacing : \"incompatible with "..caller.."\"")
end
end
--==========================================================================================={This line, and all lines below it are safe to comment out, or delete.}===
--usage example parameters: <container object>, <Item object>, <intended item facing>
setSurfaceItemFacing("chest_1", "figure_skeleton_1", 0)
-- alternatively, the function is compatible with delayedCall but can cause "item not found" console spam if the item is removed
--before the event completes. The line for printing this error can be commented out if need be.
for x = 0, 3, 1 do
delayedCall("script_entity_1", x+2, "setSurfaceItemFacing", "chest_1", "figure_skeleton_1", x)
end