Hi Fazzasx
I will try to explain.
The animation system in Grimrock works like this, you allways have a model file, and an animation file.
Obviously the model file contains the model, but the animation file contains the movements of nodes inside the model.
With the Grimrock model toolkit (GMT) open up the temple_secret_button_large.model
in the Nodes section you will see 3 nodes
Root Node
button_mesh
temple_wall_button_large_mesh
When you select them in the GMT you they will get highlighted red, you can see that the button_mesh is the button, and that temple_wall_button_large_mesh is the surrounding wall.
Now this is where the animation file comes into play, go to Anim, and load the animations from the env directory.
select the temple_secret_button_large_press and it will start to play, you can see this is working fine.
now select a different animation like temple_secret_button_small_press
They button has moved into place where the small button is in the temple tileset.
What we have learned is that the animation file controls the position of moving elements inside the model.
The animation file in this case is simply taking the node with the name button_mesh and moving it back and forth
If you select an animation designed for something else like dungeon_pit_trapdoor_close the button simply disappears, thats because that animation has no location for a mesh called button_mesh, its looking for nodes called l_door and r_door.
This also means that if you want to have a button in a different location then the ones already ingame (temple, dungeon or prison buttons) you will need to create your own animation file, and you can do that in the GMT by modifying the existing one and saving it as something else
In the Anim you need to select the button_mesh node ones again and change its location with the position +/-
When you have the button in a correct place save the modified animation as something new.
We are almost done.
you then need to create the new secret button object inside your lue files.
Code: Select all
defineObject{
name = "fazzasx_temple_secret_button_large_", -- name it
class = "Button",
model = "mod_assets/models/env/faxxasx_temple_secret_button_large.fbx", -- this is your model from blender, with wall mesh and a button mesh
pressAnim = "mod_assets/animations/env/fazzasx_temple_secret_button_large_press.fbx", -- this is your modified animation from the GMT
replacesWall = true,
placement = "wall",
editorIcon = 12,
}
Hope that helps you get on track.