Rest/Shared Dreams
-
- Posts: 6
- Joined: Wed Jan 25, 2017 5:48 am
Rest/Shared Dreams
I am trying to figure out how to mimic - rest/shared dreams function from the original game. Has anyone already done this?
- Dr.Disaster
- Posts: 2874
- Joined: Wed Aug 15, 2012 11:48 am
Re: Rest/Shared Dreams
Aye. Check out Komag's Remake of the game.
Re: Rest/Shared Dreams
It's not animated (gears don't turn), but I did the best I could to recreate at least the basic look and feel
Finished Dungeons - complete mods to play
Re: Rest/Shared Dreams
The way you can do it is rather involved, but works. You create a new level for the cinematic, teleport the party there at the beginning and back from it when it ends.Komag wrote:It's not animated (gears don't turn), but I did the best I could to recreate at least the basic look and feel
For the gears (or any animation), you make custom button objects, and assign custom animated models; (made in Blender). The button class in LoG has a scriptable :push() function, and so you animate actions (or loop actions) by repeatedly calling the button on a timer.
You will have to redefine the hardcoded button sound effect as silent, and redefine all of the official buttons to connect to a sound effect script that plays the button sound effect [by default] for any ID that it doesn't recognize; and plays the sound effect of your choice for each animation (by the calling object ID).
This is how I did the animations in my ORRR2 room for LoG1.
Last edited by Isaac on Wed Feb 08, 2017 8:16 am, edited 1 time in total.
Re: Rest/Shared Dreams
If you want to play a looping animation, it's usually easier to use the Monster class, since it supports a looping idle animation:
The code for this is a lot shorter and self-contained. The button approach makes seamless loops functionally impossible, since you can't hold the game's framerate constant.
The disadvantage of this is that the Monster class occupies a square, so you can't put it in a square that's supposed to be empty, like you can with a button. And you need to put it in a square where occlusion doesn't cull it at the wrong times. So depending on where you need your animation, it may not be usable. In the case of recreating the dreams the Monster approach is definitely easier, since the party won't be moving anyway.
Code: Select all
defineObject{
name = "drinn_fountain",
class = "Monster",
model = "mod_assets/models/env/drinn_fountain.fbx",
meshName = "Torus_001",
animations = {
idle = "mod_assets/animations/drinn_fountain.fbx",
},
moveSound = "silence",
attackSound = "silence",
hitSound = "silence",
dieSound = "silence",
hitEffect = "hit_goo",
capsuleHeight = 0.4,
capsuleRadius = 0.6,
health = 400,
sight = 1,
attackPower = 1,
accuracy = 1,
coolDown = { 42, 42 },
protection = 1,
evasion = -1000,
movementCoolDown = 42,
noRecoilInterval = { 0.2, 0.7 },
exp = 0,
healthIncrement = 1,
attackPowerIncrement = 1,
brain = "Melee",
immunities = { "assassination", "backstab" },
onMove = function() return false end,
onTurn = function() return false end,
onAttack = function() return false end,
onDamage = function() return false end,
onProjectileHit = function() return false end,
-- crashed Monster:destroy() for some reason
-- onDie = function() return false end,
editorIcon = 56,
}
The disadvantage of this is that the Monster class occupies a square, so you can't put it in a square that's supposed to be empty, like you can with a button. And you need to put it in a square where occlusion doesn't cull it at the wrong times. So depending on where you need your animation, it may not be usable. In the case of recreating the dreams the Monster approach is definitely easier, since the party won't be moving anyway.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.