Will o' the wisp

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!
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: Will o' the wisp

Post by Granamir »

minmay wrote:I don't think it will affect that either, actually. Just make sure to never use it on assets that are defined with minimalSaveState.
Yep i menat that it will affect load/save time only if u clone object changing minimalsavestate to true.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Will o' the wisp

Post by bongobeat »

Granamir wrote:
kelly1111 wrote:
Granamir wrote:Thank you.
I raised it with heightmap, but monsters get higher than floor so i now changed with an invisible platform and floor tile, rised with ':setWorldPositionY(1.3)'
Ok, but I still dont understand how you textured the sides of your raised platform/floor. I can look throught the world if I do that ...
Can you please explain a bit more?
Sure,
floor tile i used is: "dungeon_floor_dirt_01"
for sides i used "dungeon_ceiling_wall" with ":setWorldPositionY(-3.2)".

Btw using set world position and sutile offset pay attention to "minimalSaveState" in definition of object u use, if they have = true have to copy them and set as false, otherwise after u save/load they come back to standard position.
Thank you for pointing that!
I just wanted to ask, what about the offset command? Like the one bellow in the "model field"? Is it affected by the minimalSaveState?
I think I have a couple of model using the offset, without minimalSaveState
SpoilerShow

Code: Select all

defineObject{
	name = "marble_ceiling01",
	baseObject = "base_ceiling",
	components = {
		{
			class = "Model",
			model = "mod_assets/models/palace/marble_ceiling01.fbx",
			staticShadow = true,
			offset = vec(0, 1, 0),
		},
		{
		class = "Occluder",
		model = "assets/models/env/dungeon_ceiling_1111_occluder.fbx",
offset = vec(0, 1, 0),
		},
	},
	minimalSaveState = true,
}
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: Will o' the wisp

Post by Granamir »

bongobeat wrote: Thank you for pointing that!
I just wanted to ask, what about the offset command? Like the one bellow in the "model field"? Is it affected by the minimalSaveState?
I think I have a couple of model using the offset, without minimalSaveState
SpoilerShow

Code: Select all

defineObject{
	name = "marble_ceiling01",
	baseObject = "base_ceiling",
	components = {
		{
			class = "Model",
			model = "mod_assets/models/palace/marble_ceiling01.fbx",
			staticShadow = true,
			offset = vec(0, 1, 0),
		},
		{
		class = "Occluder",
		model = "assets/models/env/dungeon_ceiling_1111_occluder.fbx",
offset = vec(0, 1, 0),
		},
	},
	minimalSaveState = true,
}
As far as i know settings in "define object" are base settings u have in game; means just placing an item u have those settings, affected by minimal save sate, but nothing happens in game because u just used default settings.
If instead u use code in game to manipulate (offeset, rotate, etc.) object this affect minimal save state and u will see changes after save/load because game uses only defautl settings (those defined in "define object") after a load/save.
So, in this case, unless u change "minimalsavestate" in "define object" your dungeon will look different from what u see in your editor.
Solutions i thinked about are:
1) clone object u manipulate (copy paste object definition changing only minimalsavestate to false; as far as i know this way your definition overwrite game definition)
2) use a script and a timer in game to call periodically a functon that changes all objects u manipulated in game.
Still haven't tried which one is better, maybe solution 1 make save/load time longer, solution 2 can be a problem if u change/delete objects during gameplay (like lift, breakable walls, etc.).

But i'm not an expert, maybe someone with more experience can explain it better and/or find a better solution.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Will o' the wisp

Post by bongobeat »

Thanks,

to be sure, if I understand you, if you define an offset in the object definition, there is nothing to worry about in the game, the object will always be at the defined offset, after reloading the game?
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Will o' the wisp

Post by minmay »

I believe it works this way: Imagine minimalSaveState as respawning the object when the game is reloaded. So fields in component definitions will be applied again; the ModelComponent will have "mod_assets/models/palace/marble_ceiling01.fbx" for its "model" field, true for its "staticShadow" field, vec(0,1,0) for its "offset" field, any onInit hooks will be run again, et cetera. So long as the object's state never changes from the state it was defined with, you're fine.
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.
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: Will o' the wisp

Post by Granamir »

bongobeat wrote:Thanks,

to be sure, if I understand you, if you define an offset in the object definition, there is nothing to worry about in the game, the object will always be at the defined offset, after reloading the game?
As minmay told, yes, object definition=no worryes (but u can use only 1 offset XD).
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Will o' the wisp

Post by bongobeat »

thanks
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Post Reply