high elevators
|
Mark Matador
Registered User
Join date: 26 Apr 2005
Posts: 10
|
07-03-2005 00:23
Me again. new to scripting and going at it hammer and tongs.
Managed to make my split tip box - thanx for your help there. My next project - making an elevator that will go to (eg) 200m above rezzing place.
Have been trying all different types of scripts for simple elevators, and know (now) that there is a problem with llmovetotarget going high.
yet, i have seen quite a few elevators that work this high.
I tried "cheating" my putting "move2target" in a loop at moving it 20m a time, but it still refuses to go high. how do you get around this? any hints, or even an example would be great.
btw - got a message with one attempt about not being able to move more than 40ish prims. is this a limitation?
Thanx again.
MM
|
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
|
07-03-2005 00:36
The physical object limit is 31 prims. llMoveToTarget can't move objects that weight more than around 800Kg. Keep your elevator small and simple. llMoveToTarget has a ~60 meter range. If you point it to a vactor more than 60 meters away, the object clamps itself to wherever it is. Easiest way to deal with this is to point it at the target, and set up a llTarget(), and in the not_at_target() event, give the elevator a little kick with llApplyImpulse() Or, if you're good with vector math, divide the distance up into 50 meter increments using another state and looping with llTarget and at_target().
|
Reitsuki Kojima
Witchhunter
Join date: 27 Jan 2004
Posts: 5,328
|
07-03-2005 06:40
Or, make your elevator as an automated vehicle.
_____________________
I am myself indifferent honest; but yet I could accuse me of such things that it were better my mother had not borne me: I am very proud, revengeful, ambitious, with more offenses at my beck than I have thoughts to put them in, imagination to give them shape, or time to act them in. What should such fellows as I do crawling between earth and heaven? We are arrant knaves, all; believe none of us.
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
07-03-2005 14:06
Refer to this thread for a more detailed explanation about this, but here's something to get you started: vector setVectorDistance(vector destination, float distance) { if (llVecDist(llGetPos(), destination) < distance) { return destination; } else { // Argh, we actually have to do math. vector offset = destination - llGetPos(); return llVecNorm(offset) * distance + llGetPos(); } }
You pass llMoveToTarget a vector, specifying the position where you want the object to go. Imagine this vector as an arrow pointing from the current position of the object to the destination point. If this arrow is too long (> approximately 60 meters long), then llMoveToTarget will silently fail, and instead, as was said, clamp your object to its current position. If you "shorten" the arrow so that its less then 60 meters long, llMoveToTarget will obey you, and move towards the destination. If you keep passing llMoveToTarget an arrow pointing towards the target from your current position, but equal to or less then 60 meters long, your object will eventually reach the target. This function allows you to "shorten the arrow" to a specifyed length. Hope this helps!  ==Chris
|
Shack Dougall
self become: Object new
Join date: 9 Aug 2004
Posts: 1,028
|
07-04-2005 11:48
From: Reitsuki Kojima Or, make your elevator as an automated vehicle. What are the advantages/disadvantages of making it a vehicle? I haven't scripted vehicles yet, so I'm just curious.
_____________________
Prim Composer for 3dsMax -- complete offline builder for prims and sculpties in 3ds Max http://liferain.com/downloads/primcomposer/
Hierarchical Prim Archive (HPA) -- HPA is is a fully-documented, platform-independent specification for storing and transferring builds between Second Life-compatible platforms and tools. https://liferain.com/projects/hpa
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
07-04-2005 17:20
From: Shack Dougall What are the advantages/disadvantages of making it a vehicle?
I haven't scripted vehicles yet, so I'm just curious. Advantages: You dont have to deal with limits on functions that allow you to move an object to a specific point in space (llSetPos and llMoveToTarget). You have precise control over the friction and speed of the elevator's movement. Disadvantages: Your object can be "bumped" by other physical objects, possibly causing it to veer off its course. You have to account for this possibilty in your movement script, since an avatar is a physical object that "bumps" the elevator in the direction opposite its movement at odd undefined intervals. There is no way to say exactly, "go to this point in space" and know that your object is near, or very near that point. When you use vehicle functions (or llApplyImpulse/llSetBuoyancy) to control movement, your basically saying "go in this direction, at this speed" and relying on things like llTarget or physics math (computing the time it will take you to get from point A to point B when traveling along the vector AB at speed x) to tell you when you get close to a particular point in space. IMO, llTarget is a better solution then the physics math, since the SL physics engine doesnt handle two physical objects in contact with one another for long periods of time (physical avatar standing on moving physical elevator) very well. Either that, or it uses some wierd algorythim to define what's happening that I have yet to figure out  When you use llMoveToTarget, you have more control over where the object will end up. When you use vehicle functions or llApplyImpulse, you have more control of what happens during the object's movement. Its really all up to you, elevators can be done with both (I say this from experience.) ==Chris
|
Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
|
07-05-2005 09:49
Does it have to be physical? Why not have the avie sit and just use llSetPos() ?
_____________________
---------------------------------------------------------- --The mind's eye is limited only by its focus--
|
Lit Noir
Arrant Knave
Join date: 3 Jan 2004
Posts: 260
|
07-05-2005 12:00
ETA: Deleted post, misread earlier post.
|