Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Just animate, don't move!

Stig Olafson
Lemmy stole my sideburns.
Join date: 31 Jan 2005
Posts: 84
01-08-2006 15:52
I am trying my hand at using the old, familiar swordfighting script.
I've set it up with various anims I've found along the way.
The only thing that I can't get to work, or rather, to stop is this:

To trigger the anim, you hold LMouse and press a movoement button. The anims trigger fine, but the avatar still moves (or jumps or crouches). Being a scripting neophyte, I can't figure out how to stop this from happening.

I appeal now to the various assembled sages and gurus to help me out, pleeeeaaase!
_____________________
There is no right time, there is only now.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
01-09-2006 01:40
I'm pretty sure you want to play with llTakeControls() so you intercept the movement button presses and do your own thing.

I've not actually tried, but I think it should work. Good luck!
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
01-09-2006 03:33
Specifically, the last parameter in llTakeControls is the flag for whether the control is passed on to the avatar after you've dealt with it, which in your case needs to be FALSE.

Thinking about it, though, I found that you can't have a combination of some controls passed on and some not. So if you take control of direction buttons and left mouse without passing them through, surely you'd get a static avatar who can do sword moves, unless you implemented a whole new movement routine for when they weren't pressing left mouse?

Can't think of any way round that... maybe put in TRUE, and use llStopAnimation to cancel the natural movement?
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
01-09-2006 04:39
As I said before I've not used it for this, but I think if you take controls and use the left arrow (say) to play a particular anim (a cut to the left say) you'll get the anim played... I guess this means that the fighters will return to the same points between actions so you might need to get the anims right for that.

From the title of the question I assume that's what Stig is after - just animate don't move.

Isome ways for a sword fighting set up it might make things easier - I press left arrow, you press shift-left (the block for the left arrow attack) and we can also communicate that nothing happens because the blow is correctly parried. You'll use the dynamics of moving around, but get something that looks pretty good I suspect.
Stig Olafson
Lemmy stole my sideburns.
Join date: 31 Jan 2005
Posts: 84
01-09-2006 10:25
Thanks for your help.

It does indeed mean I can't move when not pressing the button, although I think I might be able to work around that.

However, then llStopAnimation on the default moving might be just right... I'll wander off down both paths and see what I can find.

Thanks again.
_____________________
There is no right time, there is only now.
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
01-09-2006 14:33
use MoveToTarget to hold your position while the mouse button is down rather than retaking controls. the problem with retaking controls is that the mouse button being down flag will get reset even if you're still holding it down.
_____________________