Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

RC project

SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-22-2009 11:27
Well I'm at it again. Im making a radio controled vehicle. I found a base script that lets me drive it around unfortunatly its very simple. I would like to get the tires rotating while it moves. i would alo like to have it disapear and rez at it start location if someone leaves it alone for a small period of time. We may even want it to be constained to oly be driven in a specific area and if someone leaves that area it will disappear and rez at its start location. and finally i would like it to have physics because as it is now it can be driven through walls. I was hoping someone could point me in the direction i need to go to ocomplish these things.
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
07-22-2009 12:50
Are you going to make the script yourself? Otherwise you should post your specifications in the 'Products Wanted' forum
_____________________
From Studio Dora
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-22-2009 13:54
i plan on making the script myself but i dont really know were to start.i was hoping that i could get some direction as to were to go to learn how to make in depth rc scripts.
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
07-22-2009 14:07
You want to do many things all at the same time. May I suggest you take one thing at a time. Say start with the spinning wheels:)
To spin an attached prim see:
http://wiki.secondlife.com/wiki/LlTargetOmega
_____________________
From Studio Dora
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-22-2009 20:52
I've seen vehicles done with physics... but I would probably suggest you'll have an easier time using the vehicle functions rather than just straight physics.
http://wiki.secondlife.com/wiki/Category:LSL_Vehicle

for limiting it to a specific area, check out some of these functions
http://wiki.secondlife.com/wiki/LlGetRegionName (check vs starting region)
http://wiki.secondlife.com/wiki/LlOverMyLand (limit to land you own)
or just abuse the distance limiting built into llSay from the controller (20m) or a check of the distance from the vehicle to the controller

for automated clean up you'll probably want
http://wiki.secondlife.com/wiki/LlSetTimerEvent
along with
http://wiki.secondlife.com/wiki/LlDie

and of course Dora's suggestion for the rotating wheels
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-23-2009 05:06
From: Dora Gustafson
You want to do many things all at the same time. May I suggest you take one thing at a time. Say start with the spinning wheels:)
To spin an attached prim see:
http://wiki.secondlife.com/wiki/LlTargetOmega

thanks for the information. This seems to tell me that if i want the tires to spin i should put the script into the tire prim itself. what i dont understand is how to get the tire to only spin if i press forward or backward or press the left or right movment keys.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
07-23-2009 05:27
send a link message to the scripts in the tires that are being rotated... send them one to turn on when you moving, and another to turn off when stop getting instructions to move.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-23-2009 09:40
Is there anywere i can get ahold of a simple link message script to look at it and see how its put together? the one on the wiki dont make sence to me.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
07-23-2009 09:53
That one () is about as simple as they get. ;) The script in your controlling prim (the root prim) has a llMessageLinked statement in it that carries four pieces of information ..(a) which link(s) it is talking to, (b) an integer message, (c) a string message, and (d) a key message. Parameters (b), (c), and (d) can be anything you want to send. The script in the link(s) to receive the message has a link_message event in it that says which link it's supposed to listen to, and lets it receive the integer, string, and key messages. You can put anything you like in that event. ..... Say "Hello," spin a wheel, set off fireworks ......
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-23-2009 10:04
thanks this is different then the one that i found on the wiki. So i could really build this thing out of link messages. I read that link messages can here themselves so I could use the link message in the root to move the body around right?
Celty Westwick
Registered User
Join date: 24 Jun 2006
Posts: 145
07-23-2009 12:01
Hmm if you mean by hear themselves as in a script talking to itself that would not really make sense. But if you mean talking to other scripts in the same or other prims in that object then yes.
Celty Westwick
Registered User
Join date: 24 Jun 2006
Posts: 145
07-23-2009 12:20
To clarify, the link message does not necessarily have to be in a root prim, just depends where you want it. In most instances you would not want a script talking to itself but can occur with say a parameter in:

llMessageLinked(LINK_THIS, 0, list_parameter, NULL_KEY)

often you would want to filter your linked messages by what parameter you use, for example:

in sending script -

integer object_num = 3;
string messageSpin = "Spin";

llMessageLinked(LINK_ALL_CHILDREN, object_num, messageSpin, NULL_KEY);

and in receiving script -

integer object_num = 3;
string messageSpin = "Spin";

link_message(integer sender_num, integer num, string str, key id)
{
if ( num == object_num )
{
if ( str == messageSpin )
{
Do whatever you want;
}
}
} // end of link_message
Alisha Matova
Too Old; Do Not Want!
Join date: 8 Mar 2007
Posts: 583
07-23-2009 12:51
=) adding my two cents. with the hopes of not confusing.

I suggest not spinning the wheels. Instead animate the texture(s). You will thank me when you get around to making the wheels turn left and right later.

http://lslwiki.net/lslwiki/wakka.php?wakka=llSetTextureAnim

Sounds like a fun project. =)
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-23-2009 14:11
well thankfully these tires dont turn like a cars front tires do. its a 6 wheeled vehicle that will drive like a tank. so when I press forward all 6 tires will spin forward when I hit left the left tires will spin backward and the right tires will spin forward when I hit right the right tires will spin backward and the left tires will spin forward and when I hit backward all tires will spin backward. I'm confused about how to make the linked message call on the rotation script. Can you really just say spin? also I need to figure out how to link all the tires to button presses. Its probably easier than it seems to me but I'm not a scripter. I'm simply an artist with no scripter on my team.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
07-23-2009 14:26
From: SirFency Blackheart
Can you really just say spin? also I need to figure out how to link all the tires to button presses.

LOL You can say anything you like. ;) It's just a trigger, after all. What counts is the bunch of instructions you put where Celty wrote "Do whatever you want." Alisha's right. Take a look at llSetTextureAnim. It will save you a lot of grief.

As for the control buttons.... study up on .
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-23-2009 15:23
here is a snippet of script to ask if i'm placeing the sending message in the right spot. I'd show the whole script but there are major issues when it comes to posting. It takes forever to go throught the whole thing and figure out whats causing the forum to not let me post it.


control(key name, integer level, integer edge)
{
if (level & CONTROL_FWD)
{
move_by( < 0,.5,0 > );

integer object_num = 3;
string messageSpin = "Spin";

llMessageLinked(LINK_ALL_CHILDREN, object_num, messageSpin, NULL_KEY);

}
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
07-23-2009 16:25
Have you seen this thread;

/54/35/236698/1.html
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-24-2009 06:02
I'm very excited! I was able to get the tire spinning by pressing forward. Now I need to get it spinning on the correct axis and stop when I let go of the key. Thanks for the help so far.
Celty Westwick
Registered User
Join date: 24 Jun 2006
Posts: 145
07-24-2009 07:24
Wtg!
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-24-2009 07:52
I hate posting here. Every time I try and post something it wont let me. I was wondering how to tell the wheel to spin backwards when I press backwards. Because right now I press backwards and it still spins forwards. I don't really understand how the message scripts talk to each other.

WOO! HOO! I figured it out. I simply have three if statements in the tire script that look for strings. one is spin forward one is stop and one is backward.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
07-24-2009 08:34
From: SirFency Blackheart
I hate posting here. Every time I try and post something it wont let me.

Remember? You have to be sure there's a space after each < symbol or the forums spit up.

From: someone
WOO! HOO! I figured it out. I simply have three if statements in the tire script that look for strings. one is spin forward one is stop and one is backward.

Cool. We knew you could do it. :cool:
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
SirFency Blackheart
Registered User
Join date: 6 Jan 2009
Posts: 81
07-24-2009 10:25
OK I have all 6 tires spinning they way I want them to. Now I'm wondering about making this thing drive smooth. Its very choppy almost like I press the button over and over again rather than a smooth drive forward. I also have to build some type of cleanup process so that when a person stops driving it it returns to its start. I have no idea were to begin with the choppy movement so I'll begin with the cleanup process.