These forums are CLOSED. Please visit the new forums HERE
How do i script specific caommands? |
|
Raistlin Lioncourt
Registered User
Join date: 31 Jan 2005
Posts: 8
|
02-01-2005 07:43
ive seen people say things like Bomb, or mine and bombs or mines appear (and most of the time throw me about 1000 feet away) and ive been thinking that i would really like to be able to do this. Does anyone have any idea how i could do this myself, without paying any L$?
|
Taun Patel
Geothermal Madman
![]() Join date: 5 Mar 2004
Posts: 222
|
02-01-2005 07:54
You need to set up a Listen in your script. See this page on the LSL Wiki for more: LSL page on Listens .
However, use of objects such as bombs and such to hurl other residents 304.8 meters away without their consent is a violation of the Community Standards and can land you in a bit of trouble. If someone is bombing you without your consent (eg: you're not engaged in mutual combat) you should report them for abuse. To do that, go to the Help menu and choose PVP Abuse. Any scripted object that bumps you or any avatar that bumps you is reported in that box. From there you can see who hit you with a scripted object and file an abuse report. Usually I ask them to stop first, and if they don't, I'll file the report. Remember kids, it doesn't matter who started it -- fighting back can land you in the big house! |
Walker Spaight
Raving Correspondent
Join date: 2 Jan 2005
Posts: 281
|
02-01-2005 08:30
|
Raistlin Lioncourt
Registered User
Join date: 31 Jan 2005
Posts: 8
|
02-01-2005 09:09
thanks for the help! i realise i can et into lots of trouble if i do that without the one i want to fire ons consent, and im just planning on using it for visuals, like fireworks or speacial fx for my ship im working on... i just checked out the LSL listens page and is all i need to do just type in something like this?(im new to SL so i dont know many of the different forum commands):
listen( integer channel, string name, key id, string message ) { if ( message == "open sesame" ) { llWhisper( 0, "Welcome!" ); // open door } else { llWhisper( 0, "That's not the magic word." ); // etc. } } do i need to script it remotely like this? |
Walker Spaight
Raving Correspondent
Join date: 2 Jan 2005
Posts: 281
|
02-01-2005 09:24
you're close, Raistlin
the "listen" event that appears in your post is triggered by the llListen function, so you need to add an llListen to catch the chat, as appears on the listen page Taun cited. you could also look on this page http://secondlife.com/badgeo/wakka.php?wakka=Communications at llListen and at listen. there are also several scripting libraries in-world that should appear in Find |
Ace Cassidy
Resident Bohemian
![]() Join date: 5 Apr 2004
Posts: 1,228
|
02-01-2005 09:27
Creating a script that listens for everything on channel 0 is not sim-friendly.
- Ace _____________________
"Free your mind, and your ass will follow" - George Clinton
|
Bob Bauhaus
Fictional being
Join date: 22 Sep 2004
Posts: 24
|
02-01-2005 11:06
Listening to channel 0 for the owner is bad. Listening to channel 0 for everyone is evil, unless done in very short bursts or for a very specific reason. Like YadNi's answering machine in the junkyard, or maybe an Eliza implementation. A command word isn't one of them. Especially when there's an easier, better way. I've been playing around with this, to see if I can pass values, but in the mean time, I've got a useful trick. Gestures.
I've been making a blink script that takes the owner's spoken stuff and use smilies to change the eye expression. (I'm making it public domain, so lemme know if you want a copy. Right now, I'm trying to tackle the llSetAnim problem--currently it only uses llOffsetTexture) Point being is that the actual command handling can be very simple and stupid if you have it listen on a non-0 channel. The cool part is that it has a sample set of 6 gestures that listen in for the specific emoticon, echo it through so others see it, and then in the instruction listing, has the owner 'say' "/303 COMMAND1 ARG1 COMMAND2..." This is transmitted to the script, which can simply parse it, knowing full well that this is valid commands. Pros: * Gesture is done at the client side, making script and server effort to find the keyword 0. * The script can be simple in parsing and have a 1:1 correlation of command and action, reducing your work. * Users can extend and modify behaviors by making their own gestures or de-activating or re-naming included ones, without touching your code. * You don't have to use channel 0. * You can still say commands aloud. * You can have the commands be muted. (See /clap) Cons: * 1 gesture per keyword * Keywords triggered with no context, IE, passed arguments. Possible solutions to context issue: * Make numeric values (For a small range) be their own keywords, such that the parser will get a command one pass, then the value the next. * Make the keywords that need arguments turn on listen on channel 0 for the owner. Like the previous option, the command is one pass, the value is the next. After getting the value we want, we turn off listen for channel 0, so we aren't wasting cycles for when we're talking to prims. * Request that gestures have grep-like abilities, so we can listen for command ([0-9]+), and pass on /303 DOCOMMAND $1. Something for LL to do in their copious free time. ![]() Yeah. I'm spammy. Hope this helps. |
Raistlin Lioncourt
Registered User
Join date: 31 Jan 2005
Posts: 8
|
02-01-2005 12:12
it helps if your a pro.... which im not, ive never scripted before SecondLife and i just want to figure out basic scripting, (for example: a special new vehicle scrpt, or a sword script for my new battle arena im working on)
|