Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

I'm utterly lost...

Anatoly Poliatevska
Registered User
Join date: 3 Jul 2008
Posts: 1
07-11-2008 16:48
I think at this point I feel like I have searched the entire internet and all of the SLwiki resources and tutorials to no avail. I am interested in creating my own weapons for RP combat purposes. Just 2 daggers. I learned all the basics of creating prims, linking them, texturing them, making them all pretty and perfect looking with scripts to tell me "yup, its attached to your hand". I've learned how to create and upload animations, apply gestures to the F keys with sounds and all.

All I want to do now is learn how to script it to use my 4 attack animations with CCS...or if nothing else just attack with those 4 animations using the directionals and the left mouse click like every other weapon I've bought...and use my draw and sheath animations. I know it's in the ballpark of changing the alpha of an object and messing with the attachment but I'm not sure how to specify what object and where. Trying to figure out what other people have done I see commands like "chat:/9 draw" in the gesture which leads me to believe its some sort of sub-routine in the scripts for the weapons that I can't look at because they're all write and copy protected.

Forgive the bad grammar and punctuation, I'm at my wits end with this. Can anyone help tutor me on this? I'm sure this is a very daunting task, more than I anticipated.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
07-11-2008 21:48
Generally you will have two attachments (or three/four I guess if you have one for each hand, but let's ignore that for a moment as I'm sure you can extend the idea to two weapons instead of one). The one on the hand will make itself opaque (alpha = 1.0 or thereabouts) when you "draw" the weapon while the one in the sheath (attached to some other place on the body) will make the prims of the weapon in the sheath transparent (alpha = 0.0). When you sheath the weapon, they do the opposite. Whether you hardcode two different scripts in each attachment or test where the attachment is on the body using llGetAttached() is up to you. See http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGetAttached

As for the attacking, you'll generally play the animations and perform whatever logic/communication the roleplaying system in question requires when you get a certain (set of) control input(s). You'll want to take some of the user's controls to receive those inputs probably at the point the weapon is "drawn". See http://www.lslwiki.net/lslwiki/wakka.php?wakka=llTakeControls

As for the requirements of any particular roleplaying system, you'll have to find someone who knows about the one you are interested in, or some kind of documentation for it. I've scripted all kinds of things in SL myself without learning much about them, and I could probably develop a whole new combat system as soon as figuring out how to plug into the others out there. Good luck!