Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Car traffic simulation / automatic object movement

Dora Weatherwax
Registered User
Join date: 21 Dec 2007
Posts: 7
04-30-2009 21:01
Hi all,
I'm very new to Second Life scripting (but I understand programming basics in general). I've been tasked with creating a simulation of car traffic for a SL-based project, and I'm having lots of problems getting objects to move where I want them to!

I built a basic car and now ideally I want to make it move along a path that I specify. (The end goal is to have a bunch of these cars travelling on the same road, and each of their paths/speeds is the same but staggered so it looks like the road has a lot of cars on it at once - traffic).
Is it possible to make an object move along a path that is preset somehow? Is it somehow possible to draw a line on the road and make the object follow it, or something similar? or do I need to apply a variety of impulses to the car? I am confused about how I would even figure out what impulses to apply and how I would script that sort of thing, since the road I am trying to follow has turns and does not follow along a single particular axis (it runs kind of diagonally mostly).
I'm looking to make the car "drive" on its own without an avatar and run along the road continuously. Is what I'm trying to do at all possible?

Thanks so much, clearly I have absolutely no clue what i'm doing!
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
04-30-2009 22:11
Yep, I've already done what you're suggesting
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Dora Weatherwax
Registered User
Join date: 21 Dec 2007
Posts: 7
05-01-2009 07:08
What method did you use?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
05-01-2009 09:04
take a look at the various train script for examples of following a prim delineated path, and the various 'tour' type scripts for examples of basing it on position.
_____________________
|
| . "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...
| -