|
Sra Echegaray
Registered User
Join date: 18 Nov 2005
Posts: 11
|
05-15-2006 09:42
I'd like to start out by saying this forum's search function is possibly the worst I've ever had the misfortune of using. By that, I apologise if there's a previous thread buriedin the depths of search-dom with the answer to my problem.
So, here's the problem:
I have a boat (vehicle) with two levels, you "drive" from the upper deck and passengers can sit on the lower deck. Simple. However, anytime you sit, even if it's on the benches below, the camera aligns with the driver's seat.
That is, it seems like the primary script is overriding most of the information coming from the child script. Even the arrow/awsd controls are overridden so that you can only adjust your camera view using the camer HUD.
What I want:
Passengers should to able to control where they look as if they were sitting on a chair/prim on land rather than on a vehicle. I'm defining 'passengers' here as any AV that has chosen 'Sit' from a specific seat pie menu other than the driver's seat up top. A passenger isn't someone who has randomly touched the boat object and selected 'sit.' I fully expect that case to result in the AV becoming the driver.
Ideas? Do you need to see the scripts?
Thanks in advance.
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
05-15-2006 09:55
I'm pretty sure what's happening is you've got a camera offset in the drivers seat, and it applies to all avies sitting on a sit-target.
I'm not sure if that's intended behaviour, but it is behaviour that I've seen enough before that I expect it.
Since 1.9 you should be able to at least partially override it - request permissions to take control of the camera as well as trigger animations and let them move the camera around that way.
That said I honestly don't ever remember it blocking the arrow keys moving the camera, have you left a PERMISSION_TAKE_CONTROLS in the other seats, so the arrow key presses aren't being passed through?
|
|
Sra Echegaray
Registered User
Join date: 18 Nov 2005
Posts: 11
|
05-15-2006 11:28
That's pretty much it in a nutshell. The main script is the one that came with the boat (Freebie: RR Yacht 1, script: Motor Yacht v0.82, "Fixit Galatea generic boat script"  and it's loaded in the driver's seat/master link. In the bench seats on the lower deck, I have a simple seat script I wrote myself: default { state_entry() { vector eul = <0,0,180>; eul *= DEG_TO_RAD; rotation quat = llEuler2Rot(eul); llSitTarget(<-0.3,0,0.5>, quat); llSetSitText("Sit here"); } changed(integer change) { if (CHANGED_LINK) { key agent = llAvatarOnSitTarget(); if (agent) { llRequestPermissions(agent, PERMISSION_CONTROL_CAMERA); llClearCameraParams(); llSetCameraAtOffset(ZERO_VECTOR); } else { llUnSit(agent); } } } }
The problem is, even with the camera settings like this, as soon as you sit, the camera jumps to the settings in the main script for the driver. Since I'm still very new to LSL, I'm not sure I understand the priorities set for parent vs. child scripts especially as applies like this. Do I need to maybe move the master script somewhere else like a hidden prim with some sort of seating checking, then put another sit script into the driver's seat with the special drive commands? Really, I just want to be able to stop the boat in the middle of the ocean, which is a no create zone, and be able to sit on the deck and relax, rather than have to find a port where I can rez a chair to sit on.
|
|
Merlin Alphabeta
Registered User
Join date: 12 Feb 2006
Posts: 83
|
05-17-2006 10:32
From: Sra Echegaray That's pretty much it in a nutshell. The main script is the one that came with the boat (Freebie: RR Yacht 1, script: Motor Yacht v0.82, "Fixit Galatea generic boat script"  and it's loaded in the driver's seat/master link. I've had this problem myself - see my anime theater at Merlin's Tower in Bowfin if you want to see a working solution. Unfortunately, you'll need modify access to the root script to fix this. Or switch to the 1.9-style camera controls The problem is basically that llSetCameraAtOffset and it's brother (whatever its called) are object-level settings, not prim-level settings. So any seat in the entire link set will use the last camera offset that was set anywhere in the link set. What the theater does is every time you sit on a seat, that seat removes it's camera overrides after that until you unsit - the camera overrides are only applied to the av at the time of sitting, you can change all you want after that. There's other subtleties in getting this to work - come see me at the theater in game and I'll copy some code for you...
|