Can you rephrase that? I don't know what you are saying here. Do you mean that using the parentNode property on a ModelComponent is changing the parent model somehow?zimberzimber wrote:Attaching a model to a node for monsters with scaled down animations scales down the attached model, but the parent mesh gets resized to its original state
Rescaling models didn't help fixing it
Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
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.
- zimberzimber
- Posts: 432
- Joined: Fri Feb 08, 2013 8:06 pm
Re: Ask a simple question, get a simple answer
I have an ogre, that uses scaled down animations. (Like the micro ogres someone made for LoG1)minmay wrote:Can you rephrase that? I don't know what you are saying here. Do you mean that using the parentNode property on a ModelComponent is changing the parent model somehow?zimberzimber wrote:Attaching a model to a node for monsters with scaled down animations scales down the attached model, but the parent mesh gets resized to its original state
Rescaling models didn't help fixing it
Attaching a model to a node on the model causes the attached model become smaller, and the model that gets the attachment becomes biger (normal sized)
Like so:
My asset pack [v1.10]
Features a bit of everything!
Features a bit of everything!
Re: Ask a simple question, get a simple answer
thanks for the tip, with the fade in set to 0, the transition looks better, except for the teleport jump effect.zimberzimber wrote:scripts set the stairs to their location, stairs have invisible models and a custom location. However, I assume this'll be problematic if a player is to save/load a game.
Biggest issue is the stairs killing pillars/floors/ceiling.
Floor isn't a problem, can be added to the stairs up as their model, and set the material based on what you need,
Placing ceilings manually works fine.
Pillars though... I have no idea how to fix em without a custom model. I tried using a high pillar and just place them below/above the required location, but placing the upper one didn't work because it got removed by stairs_down. An impractical fix would be editing a pillars model to look like its where you need it, but its real location is on a lower height.
nice trick with placing the stairs elsewhere, but I prefer using a wall decoration, and have the stairs placed and shown at his exact position.
For the pillars, I use some double pillars object defined as a wall_decoration:
its based on dungeon pillars model, so no new model, only a new object, with offset that pop them on each side of the wall.
SpoilerShow
Code: Select all
defineObject{
name = "stairs_up_open_double_pillar",
baseObject = "base_wall_decoration",
components = {
{
class = "Model",
model = "assets/models/env/dungeon_pillar.fbx",
staticShadow = true,
offset = vec(-1.5,0,0),
},
{
class = "Model",
name = "pillar2",
model = "assets/models/env/dungeon_pillar.fbx",
offset = vec(1.5,0,0),
staticShadow = true,
},
},
minimalSaveState = true,
replacesWall = false,
}
It's only for adding them to the side walls
- zimberzimber
- Posts: 432
- Joined: Fri Feb 08, 2013 8:06 pm
Re: Ask a simple question, get a simple answer
Your trick is more reliable because a) it doesn't create a mess in the editor, and b) it won't break if you are to save/load a gamenice trick with placing the stairs elsewhere, but I prefer using a wall decoration, and have the stairs placed and shown at his exact position.
Nice, gonna use this then.For the pillars, I use some double pillars object defined as a wall_decoration:
its based on dungeon pillars model, so no new model, only a new object, with offset that pop them on each side of the wall.
My asset pack [v1.10]
Features a bit of everything!
Features a bit of everything!
Re: Ask a simple question, get a simple answer
No. You can put an OccluderComponent on anything, and in this case you should. Also remember that "wall decoration" isn't actually a meaningful distinction internally in Grimrock 2, it's just shorthand for a GameObject with wall placement and not replacesWall.bongobeat wrote:is there anything wrong with performance or something else if I put an occcluder on a wall decoration?
Okay, I see what you are saying, but I cannot reproduce the issue. I tried attaching a ModelComponent to a scaled node that has mesh data, and the node retained its scale. I think there's something funny about your animation. You aren't scaling local_srt or something like that are you?zimberzimber wrote:I have an ogre, that uses scaled down animations. (Like the micro ogres someone made for LoG1)
Attaching a model to a node on the model causes the attached model become smaller, and the model that gets the attachment becomes biger (normal sized)
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.
- zimberzimber
- Posts: 432
- Joined: Fri Feb 08, 2013 8:06 pm
Re: Ask a simple question, get a simple answer
I followed these instruction:minmay wrote:Okay, I see what you are saying, but I cannot reproduce the issue. I tried attaching a ModelComponent to a scaled node that has mesh data, and the node retained its scale. I think there's something funny about your animation. You aren't scaling local_srt or something like that are you?zimberzimber wrote:I have an ogre, that uses scaled down animations. (Like the micro ogres someone made for LoG1)
Attaching a model to a node on the model causes the attached model become smaller, and the model that gets the attachment becomes biger (normal sized)
And I think I see where the problem is. (correct me if I'm wrong)Isaac wrote:In Blender, Import the ogre, select the armature, import the animation.
Change the pivot to the cursor
Center the cursor ( <shift> + S )
Then select the game_matrix object, and scale it down.
Then press <CRTL> + A to apply scale.
https://www.dropbox.com/s/r14f98w0flrhk ... k.avi?dl=0
Scaling game_matrix also scales local_srt, so I should just scale the rig?
My asset pack [v1.10]
Features a bit of everything!
Features a bit of everything!
Re: Ask a simple question, get a simple answer
Aha! so it's my fault.
I'm not at home, and no Blender here. I suppose one would need to drop further down the hierarchy before scaling and applying. I've made custom monsters before, but never with the Blender export script.
(But I am about to, and plan to use node parenting; so I'm very interested in the process, and its pitfalls)
I'm not at home, and no Blender here. I suppose one would need to drop further down the hierarchy before scaling and applying. I've made custom monsters before, but never with the Blender export script.
(But I am about to, and plan to use node parenting; so I'm very interested in the process, and its pitfalls)
Re: Ask a simple question, get a simple answer
I can't test it myself at the moment, but I think you should try making your animation scale all of local_srt's children and not local_srt itself. You can do this easily by opening your existing animations and applying local_srt's scale (which just transfers it to the children). It is possible that this will just result in the same problem though.
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.
Re: Ask a simple question, get a simple answer
Experimental stairwell object. Looks nice, works as intended; has no [noticeable] fade...
But it has a bit of a (really bad ) snag; one that I'd like to fix, but haven't figured out how to do it yet.
At the end of the ascent or descent, the engine always displays a single frame with the party grossly off-center.
The staircase is a single asset, placed on the map; at the top of the [single] elevation change.
*Project includes a new [variant] dungeon stairs model.
https://www.dropbox.com/s/v1mkijllq4yct ... s.zip?dl=0
If I can't find a fix for the glitch, I think I will try some other method, without using the stairs component.
But it has a bit of a (really bad ) snag; one that I'd like to fix, but haven't figured out how to do it yet.
At the end of the ascent or descent, the engine always displays a single frame with the party grossly off-center.
The staircase is a single asset, placed on the map; at the top of the [single] elevation change.
*Project includes a new [variant] dungeon stairs model.
https://www.dropbox.com/s/v1mkijllq4yct ... s.zip?dl=0
If I can't find a fix for the glitch, I think I will try some other method, without using the stairs component.
Last edited by Isaac on Tue Aug 09, 2016 1:31 am, edited 2 times in total.
- zimberzimber
- Posts: 432
- Joined: Fri Feb 08, 2013 8:06 pm
Re: Ask a simple question, get a simple answer
So, scaling local_srt instead of game_matrix fixed the model getting larger, but the attached model will still get scaled down.
Worked around it by creating a new model, which is just a rescaled spear. I'll be using it to rotate it into the right position, because changing world rotation for the model through the definition changes nothing.
I'm not going to add it to the monsters model itself because I plan on having these monsters walk around with different weapons.
EDIT: Apperantly some animations deform if you scale through local_srt and not through the game_matrix. Scaling through root_node flips normals. I've noticed the problematic animations have everything but the 3 main parents move. (game_matrix, root_node, and local_srt)
Worked around it by creating a new model, which is just a rescaled spear. I'll be using it to rotate it into the right position, because changing world rotation for the model through the definition changes nothing.
I'm not going to add it to the monsters model itself because I plan on having these monsters walk around with different weapons.
EDIT: Apperantly some animations deform if you scale through local_srt and not through the game_matrix. Scaling through root_node flips normals. I've noticed the problematic animations have everything but the 3 main parents move. (game_matrix, root_node, and local_srt)
My asset pack [v1.10]
Features a bit of everything!
Features a bit of everything!