Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Keeping the Swordsman Still

KeeperS Karu
Registered User
Join date: 18 Oct 2008
Posts: 31
06-21-2009 16:05
Heyla!

I'm revisiting a sword script I had modified and used a while back for a sword I had made, and now I'm thinking that I would like to add a new feature to it, one that keeps the swordsman from actually moving in the direction of the arrow key. In other words, I would like the swordsman to remain in place (or stand still) while still playing the sword swing animation. Is there a simple way for me to accomplish this, such as slipping in an extra line or two in the control event?

If there isn't a simple way to accomplish this, I'd still very much like to know what information I should begin studying.

Thanks for your help!

Keeper S. Karu
(KeeperS Karu)
RobbyRacoon Olmstead
Red warrior is hungry!
Join date: 20 Sep 2006
Posts: 1,821
06-21-2009 16:09
You need to capture the control keys without letting them pass through.

What I do is have separate states for "ready to attack" and "idle", and I call llTakeControls with the appropriate third parameter depending on state.

For idle, I call it with TRUE to allow the control keys to control movement, but when the idle state detects the mouse being held down, it switches to the "ready to attack" state which calls llTakeControls with FALSE as the third parameter to lock the player in place.

HTH

.
_____________________
KeeperS Karu
Registered User
Join date: 18 Oct 2008
Posts: 31
06-21-2009 17:33
All right. I'll give that a try and see how it goes. Thank you!