Ask a simple question, get a simple answer

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

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 :lol:
Rescaling models didn't help fixing it
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?
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.
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: Ask a simple question, get a simple answer

Post by zimberzimber »

minmay wrote:
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 :lol:
Rescaling models didn't help fixing it
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?
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)
Like so:
Image
My asset pack [v1.10]
Features a bit of everything! :D
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by bongobeat »

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.
thanks for the tip, with the fade in set to 0, the transition looks better, except for the teleport jump effect.

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,
}
is there anything wrong with performance or something else if I put an occcluder on a wall decoration?
It's only for adding them to the side walls
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: Ask a simple question, get a simple answer

Post by zimberzimber »

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.
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 game
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.
Nice, gonna use this then.
My asset pack [v1.10]
Features a bit of everything! :D
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

bongobeat wrote:is there anything wrong with performance or something else if I put an occcluder on a wall decoration?
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.
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)
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?
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.
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: Ask a simple question, get a simple answer

Post by zimberzimber »

minmay wrote:
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)
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?
I followed these instruction:
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
And I think I see where the problem is. (correct me if I'm wrong)
Scaling game_matrix also scales local_srt, so I should just scale the rig?
My asset pack [v1.10]
Features a bit of everything! :D
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Aha! so it's my fault. :P

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)
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

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.
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

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
Image


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.
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: Ask a simple question, get a simple answer

Post by zimberzimber »

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)
My asset pack [v1.10]
Features a bit of everything! :D
Post Reply