For anyone that was having the same issue as me, I think I figured it out, the object was trying to use an animation that I had not set up correctly.
You need to have 3 main bits:
- declare the animation name and link it to the file in a .asset file in the same directory as your animations.
- add the animation to the pdxmesh of your object in the same .gfx file that you declare your mesh
- set what state the object should actually use at different times.
I was just trying to do the last one and had put the name of my .anim file in place of the spot where you select your animation. You basically have to follow the same setup that animated portraits use.
- Your .asset file should look like this:
entity = {
name = "name_to_use_for_your_entity_name"
pdxmesh = "name_to_use_for_your_pdx_mesh"
default_state = "idle"
state = { name = "idle" animation = "name_to_use_as_your_animation_ID" animation_blend_time = 0 chance = 2.0 looping = no next_state = idle}
scale = 1.12
}
animation = {
name = "name_to_use_as_your_animation_type"
file = "name_of_your_file.anim"
}
- And your .gfx file should look like this:
objectTypes = {
pdxmesh = {
name = "name_to_use_for_your_pdx_mesh"
file = "directory_of_your_mesh_file.mesh"
scale = 1.0
animation = { id = "name_to_use_as_your_animation_ID" type = "name_to_use_as_your_animation_type" }
}
}
You need to have 3 main bits:
- declare the animation name and link it to the file in a .asset file in the same directory as your animations.
- add the animation to the pdxmesh of your object in the same .gfx file that you declare your mesh
- set what state the object should actually use at different times.
I was just trying to do the last one and had put the name of my .anim file in place of the spot where you select your animation. You basically have to follow the same setup that animated portraits use.
- Your .asset file should look like this:
entity = {
name = "name_to_use_for_your_entity_name"
pdxmesh = "name_to_use_for_your_pdx_mesh"
default_state = "idle"
state = { name = "idle" animation = "name_to_use_as_your_animation_ID" animation_blend_time = 0 chance = 2.0 looping = no next_state = idle}
scale = 1.12
}
animation = {
name = "name_to_use_as_your_animation_type"
file = "name_of_your_file.anim"
}
- And your .gfx file should look like this:
objectTypes = {
pdxmesh = {
name = "name_to_use_for_your_pdx_mesh"
file = "directory_of_your_mesh_file.mesh"
scale = 1.0
animation = { id = "name_to_use_as_your_animation_ID" type = "name_to_use_as_your_animation_type" }
}
}