Page 1 of 3

Sx_Town_Set - Swinging Door

Posted: Tue Dec 16, 2014 8:41 pm
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,
}

Re: Sx_Town_Set - Swinging Door

Posted: Wed Dec 17, 2014 2:33 am
by QuintinStone
Maybe this LOG1 to LOG2 animation converter will do the trick?

viewtopic.php?f=22&t=7913&p=84745#p84745

Re: Sx_Town_Set - Swinging Door

Posted: Wed Dec 17, 2014 7:07 am
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.

Re: Sx_Town_Set - Swinging Door

Posted: Wed Dec 17, 2014 8:42 am
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 :)

Re: Sx_Town_Set - Swinging Door

Posted: Wed Dec 17, 2014 4:18 pm
by msyblade
Skuggs said he will look at it ( and likely fix it) tonight. :D

Re: Sx_Town_Set - Swinging Door

Posted: Thu Dec 18, 2014 12:13 am
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 :)

Re: Sx_Town_Set - Swinging Door

Posted: Thu Dec 18, 2014 6:09 am
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.

Re: Sx_Town_Set - Swinging Door

Posted: Thu Dec 18, 2014 6:16 am
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.

Re: Sx_Town_Set - Swinging Door

Posted: Thu Dec 18, 2014 6:36 am
by Skuggasveinn
Good point, I haven't looked into exporting animations with bitcpy's script, sounds like weekend activity :D

Re: Sx_Town_Set - Swinging Door

Posted: Thu Dec 18, 2014 8:30 pm
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