Yes, the snail model, animations, textures, and sounds are all in the .dat from the start, you only need to add scripts.
Note: When dabbling with definition files outside the editor... Some changes gets read on CTRL+R, but not all.. some stuff is cached!
So! RESTART YOUR EDITOR EVERY ONCE IN A WHILE
Monster definition
Code: Select all
defineAnimationEvent{
animation = "assets/animations/monsters/snail/snail_attack.fbx",
event = "attack",
frame = 13,
}
defineObject{
name = "snail",
baseObject = "base_monster",
components = {
{
class = "Model",
model = "assets/models/monsters/snail.fbx",
storeSourceData = true,
},
{
class = "Animation",
name = "animation",
currentLevelOnly = true,
animations = {
idle = "assets/animations/monsters/snail/snail_idle.fbx",
moveForward = "assets/animations/monsters/snail/snail_walk.fbx",
turnLeft = "assets/animations/monsters/snail/snail_turn_left.fbx",
turnRight = "assets/animations/monsters/snail/snail_turn_right.fbx",
attack = "assets/animations/monsters/snail/snail_attack.fbx",
getHitFrontLeft = "assets/animations/monsters/snail/snail_get_hit_front_left.fbx",
getHitFrontRight = "assets/animations/monsters/snail/snail_get_hit_front_right.fbx",
getHitBack = "assets/animations/monsters/snail/snail_get_hit_back.fbx",
getHitLeft = "assets/animations/monsters/snail/snail_get_hit_left.fbx",
getHitRight = "assets/animations/monsters/snail/snail_get_hit_right.fbx",
fall = "assets/animations/monsters/snail/snail_get_hit_front_left.fbx",
},
},
{
class = "Monster",
meshName = "snail_mesh",
level=1,
health = 90,
evasion = -10,
exp = 60,
lootDrop = { 75, "snail_slice", 10, "snail_slice" },
traits = { "animal" },
hitEffect = "hit_goo",
capsuleHeight = 0.2,
capsuleRadius = 0.7,
hitSound = "snail_hit",
dieSound = "snail_die",
},
{
class = "MeleeBrain",
name = "brain",
sight = 2.5,
},
{
class = "MonsterMove",
name = "move",
sound = "snail_walk",
resetBasicAttack = false,
turnDir = 0,
cooldown = 4,
},
{
class = "MonsterTurn",
name = "turn",
sound = "snail_walk",
cooldown = 4,
},
{
class = "MonsterAttack",
name = "basicAttack",
sound = "snail_attack",
cooldown = 4,
attackPower = 6,
animationSpeed = 1,
animation = "attack",
},
}
}
Code: Select all
defineMaterial{
name = "snail",
diffuseMap = "assets/textures/monsters/snail_dif.tga",
specularMap = "assets/textures/monsters/snail_spec.tga",
normalMap = "assets/textures/monsters/snail_normal.tga",
doubleSided = false,
lighting = true,
alphaTest = false,
blendMode = "Opaque",
textureAddressMode = "Wrap",
glossiness = 100,
depthBias = 0,
}
defineMaterial{
name = "snail_shell",
diffuseMap = "assets/textures/monsters/snail_dif.tga",
specularMap = "assets/textures/monsters/snail_spec.tga",
normalMap = "assets/textures/monsters/snail_normal.tga",
doubleSided = false,
lighting = true,
alphaTest = false,
blendMode = "Opaque",
textureAddressMode = "Wrap",
glossiness = 40,
depthBias = 0,
}
--- Sounds
defineSound{
name = "snail_walk",
filename = "assets/samples/monsters/snail_walk_01.wav",
loop = false,
volume = 0.7,
minDistance = 1,
maxDistance = 10,
}
defineSound{
name = "snail_attack",
filename = {
"assets/samples/monsters/snail_attack_01.wav",
--"assets/samples/monsters/snail_attack_02.wav",
},
loop = false,
volume = 1,
minDistance = 1,
maxDistance = 10,
}
defineSound{
name = "snail_hit",
filename = {
"assets/samples/weapons/hit_bone_01.wav",
"assets/samples/weapons/hit_bone_02.wav",
"assets/samples/weapons/hit_flesh_01.wav",
},
loop = false,
volume = 1,
minDistance = 1,
maxDistance = 10,
}
defineSound{
name = "snail_die",
filename = "assets/samples/monsters/snail_die_01.wav",
loop = false,
volume = 1,
minDistance = 1,
maxDistance = 10,
}