Question : I want to force a monster to strafe left or right when I tell it to (by using a modified onThink hook, calling a fonction in a script entity). How can I accomplish that ?
Context : Me and one of my friend, created a new monster from scratch, modelling and animations. Almost everything works fine : moving forward, turning left and right, different attack animations. It's using the UggardianBrain with some modifications with the onThink hook.
The new monster is almost finished, but there is one thing I didn't manage to make it work : strafing left and right. I checked the others monsters definitions and while they do strafe in game, they only have the two animations definitions for "strafing" and nothing else, beside the MonsterMove component.
I checked the scripting reference (and JKos doc) for the MonsterMoveComponent and found setStrafeRightAnimation (or left) and setStrafeLeft, but I don't know how to use them properly. The first one take a string as an argument, but what string exactly ? The animation name ? The path of the animation ? I tried severals things, but I got an "invalid component" in the editor or "attempt to call a nil value".
Do I need to create two other MonsterMove components in my monster definition with the above method/property ?
The second one takes a boolean. Do I need to put this value at true at runtime when I want to force it to move ?
Code: Select all
animations = {
idle = "mod_assets/animations/deathSkullIdle.fbx",
moveForward = "mod_assets/animations/deathSkullMoveForward.fbx",
strafeLeft = "mod_assets/animations/deathSkullStrafeLeft.fbx",
strafeRight = "mod_assets/animations/deathSkullStrafeRight.fbx",
[...]
Code: Select all
{
class = "MonsterMove",
name = "strafeLeft",
sound = "medusa_walk",
cooldown = 0,
animationSpeed = 1.6,
strafeLeft=true,
strafeLeftAnimation = "strafeLeft",
},Can someone shed some light ?
Thanks in advance,
Vand