Page 317 of 396

Re: Ask a simple question, get a simple answer

Posted: Sun Jul 28, 2019 5:11 pm
by bongobeat
ok,
thank you for the answer.

Re: Ask a simple question, get a simple answer

Posted: Sun Jul 28, 2019 8:14 pm
by minmay
Skuggasveinn wrote: Thu Jul 25, 2019 4:00 pm
bongobeat wrote: Thu Jul 25, 2019 1:31 pm is that possible to play the same animation for 2 same model in this object?
yes but, offsetting a model doesn't offset the animation, so when the animation plays on the second model it will "jump" into the original position.
What you want is to offset the animation in blender and save it out for the second model.

kind regards.
Skuggasveinn.
This depends on the animation. Some animations set the position of RootNode and some don't. As it happens, the animation bongobeat is using doesn't; it will keep the offset.
Anyway, to animate two models, you need two AnimationComponents:

Code: Select all

defineObject{
	name = "forest_spruce_sapling_pillar_2x1",
--	baseObject = "base_pillar",
	components = {
		{
			class = "Model",
			model = "assets/models/env/forest_spruce_sapling_02.fbx",
			staticShadow = true,
		},
		{
			class = "Animation",
			animations = {
				sway = "assets/animations/env/forest_spruce_sapling_02_idle.fbx",
			},
			playOnInit = "sway",
			loop = true,
		},
		{
			class = "Model",
			name = "pil2",
			model = "assets/models/env/forest_spruce_sapling_02.fbx",
			offset = vec(0, 0, -3),
			staticShadow = true,
		},
		{
			class = "Animation",
			name = "animation2",
			model = "pil2",
			animations = {
				sway = "assets/animations/env/forest_spruce_sapling_02_idle.fbx",
			},
			playOnInit = "sway",
			loop = true,
		},
	},
	placement = "pillar",
	editorIcon = 108,
	minimalSaveState = true,
}

Re: Ask a simple question, get a simple answer

Posted: Sun Jul 28, 2019 8:26 pm
by Isaac
That is a really great tip. I was unaware that the model could be specified. 8-) 8-) 8-)

Re: Ask a simple question, get a simple answer

Posted: Wed Aug 07, 2019 6:46 pm
by vanblam
How do you control the direction the party's facing when you exit stairs. I have 2 stairs on the same level that are facing different directions, how do I control what direction there facing when they exit the other side?

Re: Ask a simple question, get a simple answer

Posted: Wed Aug 07, 2019 7:27 pm
by Isaac
Via script placing their position, or [in editor] via invisible teleporter with its destination set to its own tile, and its spin feature set to the direction.

(Of course you'll have to suitably handle the teleporter behavior afterwards, to allow them to reenter the stairs without effect.)

Re: Ask a simple question, get a simple answer

Posted: Wed Aug 07, 2019 10:24 pm
by vanblam
Isaac wrote: Wed Aug 07, 2019 7:27 pm Via script placing their position, or [in editor] via invisible teleporter with its destination set to its own tile, and its spin feature set to the direction.

(Of course you'll have to suitably handle the teleporter behavior afterwards, to allow them to reenter the stairs without effect.)
I forgot about the invisible teleporter LOL. Been creating assets so much I almost forgot how to build a level :P One more question, is it possible to remove the fade?

Re: Ask a simple question, get a simple answer

Posted: Wed Aug 07, 2019 11:20 pm
by minmay
You can hack around the fade on StairsComponent/ExitComponent by calling GameMode.fadeIn(0,0) every frame. However, this won't give you seamless stairs as the party's stair climbing animation doesn't quite actually reach the top/bottom.

Re: Ask a simple question, get a simple answer

Posted: Fri Aug 09, 2019 5:47 am
by Lorial
I received bug reports for custom alcoves which I gave additional components, namely "Clickable" and "Surface". However, bugs were reported saying that after a save&reload, items placed inside cannot be retrieved anymore. I assume the clickable option is lost during a save.

I deleted the minimalSaveState bit and upon starting a new custom dungeon it seemed to work just fine, but I am uncertain whether this really fixed the issue. In the Grimrock Asset Pack all the "pedestals" use the minimalaveState, so I am not sure.
Any idea?

Code: Select all

defineObject{
	name = "catacomb_alcove_candle_02",
	baseObject = "base_wall",
	components = {
		{
			class = "Model",
			model = "assets/models/env/catacomb_alcove_candle_02.fbx",
			staticShadow = true,
		},
		{
			class = "Light",
			range = 3.5,
			color = vec(1.1, 0.68, 0.35),
			brightness = 7,
			castShadow = true,
			staticShadows = true,
			staticShadowDistance = 0,
			shadowMapSize = 256,
			fillLight = true,
			offset = vec(-0.3, 1.15, 0.15),
			onUpdate = function(self)
				local noise = math.noise(Time.currentTime()*3 + 123) * 0.5 + 0.9
				self:setBrightness(noise * 10)
			end,
		},
		{
			class = "Particle",
			particleSystem = "catacomb_alcove_candles_02",
		},
		{
			class = "Surface",
			offset = vec(0, 0.85, 0.2),
			size = vec(1, 0.65),
		},
		{
			class = "Clickable",
			offset = vec(0, 0.85+0.1, 0),
			size = vec(1.1, 0.2, 0.9),
			pedestal = true,
		},
		{
			class = "Occluder",
			model = "assets/models/env/catacomb_alcove_01_occluder.fbx",
		},
	},
	editorIcon = 92,
--	minimalSaveState = true,
}

Re: Ask a simple question, get a simple answer

Posted: Fri Aug 09, 2019 6:03 am
by Lorial
For a custom tile damaging spell (similar to fireburst and shockburst), how can I prevent casting in front of the party if the tile is blocked?
Apparently, this can lead to a CTD at the edge of a level and allows cheating by casting through grates and even solid walls.

Re: Ask a simple question, get a simple answer

Posted: Fri Aug 09, 2019 6:38 am
by minmay
Lorial wrote: Fri Aug 09, 2019 5:47 amIn the Grimrock Asset Pack all the "pedestals" use the minimalaveState, so I am not sure.
This is not true. There is only one pedestal in the asset pack and it does not have minimalSaveState. Objects that have SurfaceComponents or SocketComponents, including the object you posted, will break if you give them minimalSaveState.