Dynamic swords
|
Blade Murakami
Registered User
Join date: 4 Sep 2005
Posts: 1
|
09-19-2005 07:29
I was wondering something. Would it be possible to have a "dynamic" sword where you could execute different moves at the push of certain buttons?
The idea I had in mind was to make a sword set where this was possible -- the first one out was going to be a katana. Anyway, what I want the sword to do is use the number pad. 5 will draw the sword, and 5 will put it away(it'll be initially attached to the hip of the avatar). Then, 8 will execute an overhead attack, 7 and 9 will execute diagonal slashes for left and right, and 4 and 6 will make horizontal slashes. 1, 2 and 3 will block high, and left and right. Would something like this be possible?
I know it'd take custom animations, and I'm willing to build the actual model and learn Poser to do the animations, but that would be insane if it was possible.
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
09-19-2005 08:09
Yes and no.
There are eight control key sets (I think, I don't actually use them), the arrows, shift-left and shift-right and pg up, pg down. For a display set (kata, form whatever) you could certainly use those to control the avatar and the animations played, but obviously they'd interrupt your movement of the avatar so writing them as a fighting set would be much harder.
You could also key to silent control phrases and add them to your sale package as gestures (gestures can include saying things, I have a dance bracelet that takes controls on /1337 and so have gestures for those controls for start, stop, next, prev etc.) that would work - you could hijack f2, f3, f4 say, with single key, control and shift combinations to duplicate your nine pad.
You could agitate for the llTakeControls() and so forth families of events and controls to be extended - I'm pretty sure there's a feature vote asking for that which you could vote on.
|
Osprey Therian
I want capslocklock
Join date: 6 Jul 2004
Posts: 5,049
|
09-19-2005 10:11
I know this is not what you mean, but I thought it might be useful to see if you don't already know about it: SimCombat, by Doc Boffin - you can try it at the Kill Club.
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
09-19-2005 15:23
As Eloise said, gestures would probably be your best bet currently.
But NUMPAD_* being sent to the control event would be extremely useful... Maybe we could get that in the next release or so.
|
Julian Fate
80's Pop Star
Join date: 19 Oct 2003
Posts: 1,020
|
09-19-2005 20:09
You could put something in your control handler to detect the crouch key being held down. When it is, the four arrow keys and jump could trigger fighting moves singly and in combination. When crouch isn't down, they behave normally and move your avatar around. It isn't much of a sacrifice to lose the ability to crouch.
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
09-20-2005 02:30
According to the wiki the controls event doesn't detect for the crouch key.
It does, however, detect for the left mouse button in both mouselook and normal modes, so you could use that in combination with the others, although mouse button, down, shift right and page up gives one hand cramp I suspect...
|
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
|
09-20-2005 06:12
LSL does detect the crouch (C/PageDown) key.
You can use a complex case tree to trigger different actions depending on key combinations (forward and strafe-left, for example) along with left mouse button. You can even, given some code-fu skills, make it detect quick taps or double taps on a movement key.
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
|
Vilkacis Mason
Registered User
Join date: 30 Aug 2005
Posts: 49
|
09-20-2005 06:25
I've been thinking about this for awhile, but I've honestly held back in replying here because I don't want someone to create such a system before I do. Or rather, I don't want someone to create it first and create it poorly. But eh.
I was thinking of making this much more like Bushudo Blade, with 'stances'. Imagine 3 modes. High stance, movement, and low stance. Page up and down switch between the stances. So if you're striking in any stance and suddenly need to move, it's only one press away. This gives you four moves per stance (or six, if you shift-arrow) and a decent way to move around. If you use mouse buttons a little as well, you have a way of doing a simple strike even in movement-mode. Then plant your feet down in a lower-stance and get to more graceful forms. I think I would use the shift-arrow keys to rotate your character while in a stance. Or perhaps a way to side-step. Many fighting games get away with only two attack buttons, I think four in each stance (eight basic moves total, not including any possible 'special' or combo movements) is adequate.
The only problem now is weapon interaction. I don't know how I'd handle that; everything I've planned up to this far is just concept. I'm not as familiar with LSL as I'd like to be yet. While an actively interactive system, using physics, probably appeals to certain people, I find it to be more troublesome as an idea. Lots of people hitting others that don't want to be hit. Lots of sim lag adding to weapons flying through each other. Lots of weapons just bouncing off each other rather than coming to an agreeable lock.
I was thinking of a more virtual system. Should one character 'block', or use a movement that would counter their opponent's movement, the system knows and puts them in a 'block' or in certain cases 'lock' pose, which you can throw off or push out or whatnot. Much like how Dynasty Warriors handles this, with the two weapons locked together and much sparks and button mashing. My version would have less button mashing, but the basic concept would be the same.
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
09-20-2005 06:27
My bad, I always think of page down as fly down, not crouch. Shows how much time I spend in combat situations in SL 
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
09-20-2005 16:46
From: Vilkacis Mason The only problem now is weapon interaction. I don't know how I'd handle that; everything I've planned up to this far is just concept. I'm not as familiar with LSL as I'd like to be yet. While an actively interactive system, using physics, probably appeals to certain people, I find it to be more troublesome as an idea. Lots of people hitting others that don't want to be hit. Lots of sim lag adding to weapons flying through each other. Lots of weapons just bouncing off each other rather than coming to an agreeable lock.
I was thinking of a more virtual system. Should one character 'block', or use a movement that would counter their opponent's movement, the system knows and puts them in a 'block' or in certain cases 'lock' pose, which you can throw off or push out or whatnot. Much like how Dynasty Warriors handles this, with the two weapons locked together and much sparks and button mashing. My version would have less button mashing, but the basic concept would be the same.
I don't mean to crash your party, but you DO know that attachments aren't physical, and don't collide with anything?
|
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
|
09-20-2005 18:16
From: Keknehv Psaltery I don't mean to crash your party, but you DO know that attachments aren't physical, and don't collide with anything? In addition, Animations don't collide, meaning if you run an animation that makes you dance around in big circles, not only do you move straight through AV's and objects, any script trying to get your position or rotation will return where you were/technically are standing in the center of the circle. Make an animation that jumps lunging forward with a sword and it can't colide at all with anything as far as I know. 
|
Vilkacis Mason
Registered User
Join date: 30 Aug 2005
Posts: 49
|
09-21-2005 19:12
From: Keknehv Psaltery I don't mean to crash your party, but you DO know that attachments aren't physical, and don't collide with anything? Right, I'm aware they aren't physical. Hence, why I was thinking of making them use sensors in some way. Only, I'm entirely new to LSL, and have no idea how that works. I'm still in concept stages, I barely know what my limits are. I'd like to do basically the same thing the poster is mentioning as well, I just don't know the best way to achieve it.
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
09-21-2005 19:16
Sensors? I don't believe sensors detect attachments.
To make this work, you would probably have to put in elaborate communication between the two fighting players. You should have a chat with Cubeos Boffin or one of his colleagues, he works on SL boxing.
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
09-22-2005 05:30
I think sensors can work on attached objects, although I believe they need to handshake about their keys - you ping the attached object's key and it works, at least for targetting particles to the object rather than the body of the person. I've never tried it with a sensor that way, but can't see why it shouldn't work.
You might also want to talk to Garth Fairlight, I'm pretty sure he made the swords for Neverland and had some system for making them do damage - a rezzed sword following the actual blade I think.
|
Keknehv Psaltery
Hacker
Join date: 11 Apr 2005
Posts: 1,185
|
09-22-2005 15:31
From: Eloise Pasteur I think sensors can work on attached objects, although I believe they need to handshake about their keys - you ping the attached object's key and it works, at least for targetting particles to the object rather than the body of the person. I've never tried it with a sensor that way, but can't see why it shouldn't work. You've been in SL for more than a year and can't see why it won't work? It doesn't work, trust me. The Lindens are leery of having any definite position or rotation in attachments, which has only changed with 1.7, and it would be moderately painful to map an attachment to a specific sim location. From: Eloise Pasteur You might also want to talk to Garth Fairlight, I'm pretty sure he made the swords for Neverland and had some system for making them do damage - a rezzed sword following the actual blade I think.
Yes, I've seen systems somewhat like that... If you carefully watch some of the models of lightsabers, you notice that they're actually emitting a prim that will push people back and do damage. This might not work very well for complex swordplay, though.
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
09-22-2005 16:48
From: Eloise Pasteur I think sensors can work on attached objects, although I believe they need to handshake about their keys - you ping the attached object's key and it works, at least for targetting particles to the object rather than the body of the person. I've never tried it with a sensor that way, but can't see why it shouldn't work. Last I checked, sensors wouldn't pick up attachments... It would be very difficult for the server's animation to stay in sync with the animation the clients were viewing, due to internet latency. Particles follow attachments with great accuracy because the client is both responsible for rendering the particles and the animation the avatar is playing, so it knows a great deal more in terms of how to get the particles and the attachment's positions in sync. From: Keknehv Psaltery You've been in SL for more than a year and can't see why it won't work? It doesn't work, trust me. You need to get off your high horse. It was half a year before I discovered "Save Object back into Object Contents", and after 2+ years here, I still haven't achieved total proficiancy with the build tools. ==Chris
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
09-22-2005 17:04
You may be able to get away with approximating where and when the sword strikes, if you make each animation yourself. Youll need to compensate for the arm length of the striking avatar. In theory, its possible, though youll have to hardcode some values describing the animations the avatars play - the script would need to know the position of the sword hilt and tip as a function of time. Once the script triggers the animation, have it llResetTime, and then run a fast-repeating sensor that detects any nearby avatars. When the sensor event detects something, get the dimensions & position of the sword at llGetTime() in the animation, and check if it has penitrated the bounds of a detected avatar, if it has, have the sword llPushObject the avatar. It wont be perfect, but its the only alternative to having a communication system.
Then again, this is heavily dependant on the speed at which LSL does its computations... it might not work at all, or you may need to compensate for LSL's speed by having the sword strike not only where it is at llGetTime, but also where it was at llGetTime() +- a small value. ==Chris
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
09-22-2005 23:52
Thank you Christopher for explaining why particles can do it moderately efficiently and sensors probably can't. Put that way it does explain it.
|