Sx_Town_Set - Swinging Door

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!
User avatar
Eleven Warrior
Posts: 745
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Sx_Town_Set - Swinging Door

Post by Eleven Warrior »

Hi guys well Skuggs or John Wordsworthy. I am trying to get the Swing door to work in LOG 2, but I have just encountered my first hurdle. The animations don't work (see below code error) I have also included the Object Code (below) It only has the animation part and no open sounds etc.... I think the animation has to be upgraded to Version 2 whatever that means :)

In fact do I class the the object as a door and add the door controllers, sounds,etc... to this object? I would really like to get this to work guys because the doors going up/down and sideways is cool but this door opens like a normal door which by the way is awesome ahy :) Thxs for any help on this

--- Code Error ---

=== Software Failure ===

[string "Animation.lua"]:0: Invalid file version (expected v2, got v1): mod_assets/sx_towntileset/animations/swingdoor_close.animation
stack traceback:
[C]: in function 'load'
[string "Animation.lua"]: in function 'loadProperties'
[string "GameObject.lua"]: in function 'initComponents'
[string "Arch.lua"]: in function 'spawn'
[string "DungeonEditor.lua"]: in function 'addObjectTool'
[string "DungeonEditor.lua"]: in function 'mapView'
[string "DungeonEditor.lua"]: in function 'update'
[string "Grimrock.lua"]: in main chunk

Code: Select all

---Testing Swing Door ---
defineObject{
name = "sx_town_door_opens",
components = {
{
class = "Model",
model = "mod_assets/sx_towntileset/models/sx_town_door2.fbx",
staticShadow = true,
},
{
class = "Animation",
animations = {
open = "mod_assets/sx_towntileset/animations/swingdoor_open.fbx",
close = "mod_assets/sx_towntileset/animations/swingdoor_close.fbx",
},
},
},
placement = "wall",
editorIcon = 160,
automapIcon = 88,
minimalSaveState = true,
}
User avatar
QuintinStone
Posts: 72
Joined: Sat Nov 01, 2014 9:58 pm

Re: Sx_Town_Set - Swinging Door

Post by QuintinStone »

Maybe this LOG1 to LOG2 animation converter will do the trick?

viewtopic.php?f=22&t=7913&p=84745#p84745
Crypt of Zulfar
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Sx_Town_Set - Swinging Door

Post by msyblade »

IIRC the town tile swinging door is actually a "Lever". Skuggs found all sorts of useful modding backdoors using a levers animation instead of a doors. I think it is because a doors node moves with the animation or something like that.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Eleven Warrior
Posts: 745
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Sx_Town_Set - Swinging Door

Post by Eleven Warrior »

Mysblade you are right about the door being a lever, I just wish Skuggs would help on this door thxs for the replys guys.

SKUGGS: PLEASE HELP ON THIS MATE OR I AM GOING TO GO NUTS MAN :)
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Sx_Town_Set - Swinging Door

Post by msyblade »

Skuggs said he will look at it ( and likely fix it) tonight. :D
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Eleven Warrior
Posts: 745
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Sx_Town_Set - Swinging Door

Post by Eleven Warrior »

Hi. Thank you for your help Mysblade that's so awesome that Skuggs will look at it. Thxs to you to Skuggs. It's a awesome door, I used it a lot in my mod that was nearly finished and now it will be great in LOG 2. Ok thxs again guys much appreciated :)
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: Sx_Town_Set - Swinging Door

Post by Skuggasveinn »

Hi

The error you are getting is normal, the file format has changed.
The 5th byte of the animation file holds the version, in LoG1 it was simply 01 but LoG2 is expecting the byte to be 02 (as documented in the reference guide)
Also there seems to be some difference in the structure of keyframes, simply changing the version to 02 just crashes the editor in new spectacular ways :lol:

My pipeline was Blender > FBX > GrimFBX > animation format , but it is broken atm.
Maybe John will have some time over x-mas to work on the MeshCraft so there is a working pipeline.
I'm a terrible programmer and writing something that can safe down a Blender or FBX animation in the LoG2 format is way out of my league.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Sx_Town_Set - Swinging Door

Post by minmay »

Skuggasveinn wrote:My pipeline was Blender > FBX > GrimFBX > animation format , but it is broken atm.
Maybe John will have some time over x-mas to work on the MeshCraft so there is a working pipeline.
I'm a terrible programmer and writing something that can safe down a Blender or FBX animation in the LoG2 format is way out of my league.
bitcpy's Blender exporter has perfectly exported every animation I've tried so far.
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
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: Sx_Town_Set - Swinging Door

Post by Skuggasveinn »

Good point, I haven't looked into exporting animations with bitcpy's script, sounds like weekend activity :D
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: Sx_Town_Set - Swinging Door

Post by Skuggasveinn »

QuintinStone wrote:Maybe this LOG1 to LOG2 animation converter will do the trick?

viewtopic.php?f=22&t=7913&p=84745#p84745
First reply is spot on (prozail also pointed me today to the GrimAnimConverter tool)
just use the tool to convert the animation to V2 format (just drag the file to the exe tool and it will pop out the V2 version)
Since this door is a lever hack, and levers don't have a hardcoded position anymore you just need to add the offset the the definition.

Code: Select all

defineObject{
	name = "sx_swingdoor",
	baseObject = "lever",
	components = {
		{
			class = "Model",
			model = "mod_assets/models/swingdoor_ani.fbx",
			offset = vec(0,1.375,0),
		},
		{
			class = "Animation",
			animations = {
				activate = "mod_assets/animations/swingdoor_open.fbx",
				deactivate = "mod_assets/animations/swingdoor_close.fbx",
			}
		},
	},
}
Maybe its time to do a proper door in LoG2 (and skip the lever hack) :D
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
Post Reply