Page 10 of 36
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Thu Oct 04, 2012 7:43 pm
by crisman
petri wrote:crisman wrote:Once I've tried to make a goromorg statue fourway acting like an alcove, for placing scrolls on it (if I recall correctly in the base game you can find a scroll on it once).
For some reasons the model shifted forward and it wasn't in the middle of a square anymore.
I should try that again...
Hint: eye sockets
Thak you very much Petri!
I did it, but now I cannot post any pictures or the script.
I'll do that later!
EDIT: Okay, here's the script
defineObject{
name = "goromorg_socket",
class = "Alcove",
anchorPos = vec(0.0, 0.18, 0.16),
targetPos = vec(0.0,0.18, 0.17),
targetSize = vec(0.3, 0.3, 0.3),
placement = "floor",
onInsertItem = function(self, item)
return item.name == "scroll" and self:getItemCount() == 0
end,
editorIcon = 92,
}
Now, this is almost exactly like a socket, it's not a physical object, and you cannot put things inside in-game, but only via script or inspector.
To place it you must put in front of the statue, like this screen shows (don't bother with the timers are there for something else
) The socket is facing East in this case.
And here's the result
Now here's a story. After 99 level of a very dangerous dungeon, after fighting several eating-men monsters, after passing several deadly trap, and solved crazy puzzles, you are in front of the Scroll of Power, those who read it will gain incredible Wisdom and will receive the answer of meaning of life and so on.
Looks like the goromorgs have a nasty sense of humor...
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Fri Oct 05, 2012 2:12 am
by Batty
They'll be no end to alcoves...the scroll on the statue is another good one.
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Fri Oct 05, 2012 2:18 am
by Neikun
I thought you guys wanted it on the statues arms lol
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Fri Oct 05, 2012 11:22 am
by Blichew
I haven't seen any fix-post yet, but If there was one already, then this post is unnecessary
flatline wrote:Batty wrote:Wall Lanterns Resurrected
Ignore the previous wall lantern solution as it doesn't work outside the editor. The lanterns you light don't survive save games because they were created via FX when I should have used objects instead. So, here is the revised fully functioning and simpler solution:
Code: Select all
defineObject{
name = "wall_lantern_fx_3",
class = "LightSource",
lightPosition = vec(-1.18, 1.85, 0),
lightRange = 12,
lightColor = vec(0.7, 0.5, 0.5),
brightness = 10,
castShadow = true,
particleSystem = "torch",
placement = "floor",
editorIcon = 88,
}
defineObject{
name = "wall_lantern_fx_2",
class = "LightSource",
lightPosition = vec(0, 1.85, -1.18),
lightRange = 12,
lightColor = vec(0.7, 0.5, 0.5),
brightness = 10,
castShadow = true,
particleSystem = "torch",
placement = "floor",
editorIcon = 88,
}
defineObject{
name = "wall_lantern_fx_1",
class = "LightSource",
lightPosition = vec(1.18, 1.85, 0),
lightRange = 12,
lightColor = vec(0.7, 0.5, 0.5),
brightness = 10,
castShadow = true,
particleSystem = "torch",
placement = "floor",
editorIcon = 88,
}
defineObject{
name = "wall_lantern_fx_0",
class = "LightSource",
lightPosition = vec(0, 1.85, 1.18),
lightRange = 12,
lightColor = vec(0.7, 0.5, 0.5),
brightness = 10,
castShadow = true,
particleSystem = "torch",
placement = "floor",
editorIcon = 88,
}
Define 4 LightSource objects - one for each facing position. The only difference between the four is the name and lightPosition. This has to be done because the convenient FX translate() function doesn't work with LightSource objects. They can't be moved. You also need to define a sound object:
Code: Select all
defineSound{
name = "wall_lantern_crackling",
filename = "assets/samples/env/torch_burning_01.wav",
loop = true,
volume = 0.5,
minDistance = 2,
maxDistance = 6,
}
Lastly, replace the logical lantern script. It's simpler now.
Code: Select all
defineObject{
name = "wall_lantern_logical",
class = "Alcove",
anchorPos = vec(0, 1.65, 0),
targetPos = vec(0, 1.65, 0),
targetSize = vec(0.2, 0.2, 0.2),
onInsertItem = function(self, item)
if item.name == "torch" or "everlasting_torch" then
spawn("wall_lantern_fx_"..self.facing, self.level, self.x, self.y, 0)
playSoundAt("wall_lantern_crackling", self.level, self.x, self.y)
self:destroy()
end
end,
placement = "wall",
replacesWall = false,
editorIcon = 84,
}
Don't forget the visual lantern script from my previous post.
Batty, I've copied your stuff and it works fine except that it seems the script accepts ANY object to light the lanterns. When I fool around in the editor, I can put in a sling and still light one of the lanterns. At first, I thought the script lacked a "else"-parameter telling it to end if anything but a torch was inserted. I can't seem to fix it though. Thoughts?
Great work btw, and I'm quite new to scripting Grimrock so bear with me. I did manage to make some nice looking drainage floors with custom fires glowing far below and filling the room with smoke, so progress is being had.
The way I see it is that item.name "everlasting_torch" is actually "torch_everlasting" but the case is in this line:
Code: Select all
if item.name == "torch" or "everlasting_torch" then
It should be:
Code: Select all
if item.name == "torch" or item.name == "torch_everlasting" then
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Fri Oct 05, 2012 12:40 pm
by Lmaoboat
I wonder if would be possible just to make an alcove that you could control the object placement of using the inspector in the editor.
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Fri Oct 05, 2012 1:18 pm
by Neikun
Likely not.
NEWS: Just finishing up on a goromorg shield carrier alcove. Looks really neat.
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Fri Oct 05, 2012 1:30 pm
by Neikun
Introducing..
The Goromorg Shield Carrier
Code: Select all
defineObject{
name = "goromorg_shield_slot",
class ="Alcove",
anchorPos = vec(0.02, 1.44, 0.12),
anchorRotation = vec(90,0,270),
targetPos = vec(0,1.7, 0),
targetSize = vec(0.1, 0.8, 0.2),
onInsertItem = function(self, item)
local allowed = {"shield_valor", "legionary_shield","shield_elements","heavy_shield"}
for i = 1, #allowed do
if item.name == allowed[i] then
return item.name == allowed[i] and self:getItemCount() == 0
end
end
end,
placement = "wall",
replacesWall = false,
editorIcon = 92,
}
This is a logical alcove, and so you can put it on whatever wall you want. It's designed to fit nicely on the goromorg's arms though.
Happy modding!
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Fri Oct 05, 2012 10:00 pm
by Merethif
Neikun wrote:Introducing.. The Goromorg Shield Carrier
Ok, now guys, you are really getting insane...
...KEEP IT COMING
BTW, may I suggest alcove for the orbs into dragon statue mouth?
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Fri Oct 05, 2012 10:17 pm
by Neikun
Merethif wrote:Neikun wrote:Introducing.. The Goromorg Shield Carrier
Ok, now guys, you are really getting insane...
...KEEP IT COMING
BTW, may I suggest alcove for the orbs into dragon statue mouth?
Well I find the gems to be a little to small for that, but the ore would do nicely.
-will likely work on that later.
Re: (Object Assets) Empty Catacomb as Alcove and other alcov
Posted: Fri Oct 05, 2012 10:38 pm
by Merethif
Neikun wrote:Merethif wrote:Neikun wrote:Introducing.. The Goromorg Shield Carrier
Ok, now guys, you are really getting insane...
...KEEP IT COMING
BTW, may I suggest alcove for the orbs into dragon statue mouth?
Well I find the gems to be a little to small for that, but the ore would do nicely.
-will likely work on that later.
I mean the orbs like Orb of Radiance or Zhandul Orb. They're even slightly bigger then ore.