|
Hg Beeks
llGetElement(80);
Join date: 13 Apr 2006
Posts: 134
|
06-30-2007 13:55
I've been working on a balloon-type vehicle recently. Everything seems to work pretty well; The only thing I had to do a little odd was the hover height, since I couldn't see a way to merely update it. I ended up with a float set to a default altitude when the script starts, and is then increased or decreased via the up and down buttons.
if(held & (CONTROL_UP)) { alt += 0.2; } if(held & (CONTROL_DOWN)) { alt -= 0.2; } llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, alt );
This works just fine; Maybe a little slow at times, but that's not a programming issue. However, the major issue I'm having with it is that if I run into a slope or curve that pushes me up or down, I can no longer go in the opposite direction (Pushes me up, I can't go down). I can't seem to figure out what could cause this from the script I've got set up. Any ideas, or solutions? Getting stuck way up in the air (Or right along the ground plane) kind of hinders flight.
|
|
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
|
06-30-2007 18:52
From: Hg Beeks I've been working on a balloon-type vehicle recently. Everything seems to work pretty well; The only thing I had to do a little odd was the hover height, since I couldn't see a way to merely update it. I ended up with a float set to a default altitude when the script starts, and is then increased or decreased via the up and down buttons.
if(held & (CONTROL_UP)) { alt += 0.2; } if(held & (CONTROL_DOWN)) { alt -= 0.2; } llSetVehicleFloatParam( VEHICLE_HOVER_HEIGHT, alt );
This works just fine; Maybe a little slow at times, but that's not a programming issue. However, the major issue I'm having with it is that if I run into a slope or curve that pushes me up or down, I can no longer go in the opposite direction (Pushes me up, I can't go down). I can't seem to figure out what could cause this from the script I've got set up. Any ideas, or solutions? Getting stuck way up in the air (Or right along the ground plane) kind of hinders flight. I can't help you with your problem, but if you can reliably get your vehicle to halt movement along the Z axis, I'd love to know how it's done, as there are several concepts in my idea bin that just aren't doable without being able to prevent movement along 1 or 2 axis.
_____________________
My SLExchange shopTypos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not. The function is working perfectly fine. It's just not working the way you wanted it to work.
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
07-01-2007 01:55
I can't see why being pushed up or down would affect you changing the hover height by control. Hm. Perhaps it is something to do with it tilting and the linear engine controls moving you? What does it say if you put an llOwnerSay("hoverheight " + (string)alt) in there?
Incidentally, if you want the balloon to behave more like a real balloon or other floating vehicle, it's best to just turn hovering off (set VEHICLE_HOVER_TIMESCALE to 1000.0). You keep the buoyancy but altitude does not change with ground level. Hover is nice for automatic and cruising vehicles but in most cases I find it a bit confusing for the pilot, and it also has a maximum of 100m altitude.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
07-01-2007 01:59
From: Senuka Harbinger I can't help you with your problem, but if you can reliably get your vehicle to halt movement along the Z axis, I'd love to know how it's done, as there are several concepts in my idea bin that just aren't doable without being able to prevent movement along 1 or 2 axis. You can't really prevent movement along the Z-axis with a physical object, it could always be bumped up or down, but depending on exactly what you're trying to build you might want to take a look at VEHICLE_FLAG_NO_DEFLECTION_UP and VEHICLE_FLAG_LIMIT_MOTOR_UP for ground vehicles, or for a hover/air vehicle, use VEHICLE_VERTICAL_ATTRACTION_* to constantly keep the vehicle upright (I use this quite a bit).
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Hg Beeks
llGetElement(80);
Join date: 13 Apr 2006
Posts: 134
|
07-01-2007 10:33
From: Ordinal Malaprop I can't see why being pushed up or down would affect you changing the hover height by control. Hm. Perhaps it is something to do with it tilting and the linear engine controls moving you? What does it say if you put an llOwnerSay("hoverheight " + (string)alt) in there?
Incidentally, if you want the balloon to behave more like a real balloon or other floating vehicle, it's best to just turn hovering off (set VEHICLE_HOVER_TIMESCALE to 1000.0). You keep the buoyancy but altitude does not change with ground level. Hover is nice for automatic and cruising vehicles but in most cases I find it a bit confusing for the pilot, and it also has a maximum of 100m altitude. It's just a balloon type; I needed something that would hover like that. The vehicle I've made works just the way I wanted it to with a timescale of 0.25. The other problem I found when I tried the high timescale was that even a relatively high Z push was still very slow on it, and I wanted the vehicle to be rather quick to respond. As for the reason the up direction gets locked, it was simple a matter of where I had hit the ramp. I had accidentally run into one close to the ground, and apparently hit down at the moment; The altitude value was -8. Once I got it back above 0, the vehicle popped back into working order. I haven't been able to get it to stop working going the opposite (Getting pushed down), so that may have been my imagination. Simply adding a line to prevent the alt from going below 0 fixed that. However, now that I've experimented with the vehicle over non-smooth terrain, I'm aware of the altitude changing with the ground level, and I'm not sure how to combat that, if I even can using the hover timescale.
|