If I'm not mistaken, then monsters action are a compination of 2 things.
The animation event system and the brain.
the brain is the AI that calls for action given whats going on.
the animation event system triggers attacks from specific key-frames
I don't thing we can create a brain, put we can assign existing ones to a monster
we have several brains to choose from
Melee
Ranged
Goromorg
Tenticle
Uggardian
Crab
IceLizard
Warden
Slime
HerderBig
HerderSmall
Ogre
SkeletonArcher
(warning, assigned a brain that calls for an action that is not defined for the monster will crash the game, like assigning the Ogre brain on a archer, and when the Ogre brain calls for "side attack" there is no such animation on the skeleton archer and booom you see desktop)
If we take a look at the Tenticles for example and the party was standing 2 squares from it
the Tenticle brain would know it can't attack us, its coing to idle or/and withdraw.
but if we are standing right in front of it, the Tenticle brain would call for an "attack" and the attack animation would play
if we look into the animation_events.lua we can see the following
Code: Select all
defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack.fbx",
event = "attack",
frame = 15,
}
defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack.fbx",
event = "attack",
frame = 20,
}
defineAnimationEvent{
animation = "assets/animations/monsters/drainage_tentacles/drainage_tentacles_attack.fbx",
event = "attack",
frame = 25,
}
so on frame 15 of the attack animation it triggers an attack, having a change to damage the party, also on frame 20 and 25
That tells is we need to define on what frame something will "hit" the party, or in the case of ranged attacks on what frame a projectile will "leave" the monster.
Here is what I think is the bad news (I would love to be wrong), since we can't make a brain, we need to use existing ones, and there is not one monster in the game that can do both melee and ranged.
So I would thing that you need to create 2 mummies, one thats melee and another thats ranged and use the scarab attack on the ranged one and have the scarab attack as a spell, the monster only animates casting animation and triggers the scarab spell.
Melee attacks seem to be only one per monster, ranged attack seem to take multible values.
in the monsters.lua you can see something like this.
rangedAttack = { 45, "lightning_bolt_greater", 25, "ice_shards", 20, "fireball_greater", 10, "poison_bolt" },
so 45% it will use lightning_bolt_greater, 25% of the time ice_shards and so on.
but all this is new ground, and there is a good change that I'm 100% wrong here
Skuggasveinn.