Jump to content

Clearing camera params on unsits issue


Poltergeist Azarov
 Share

You are about to reply to a thread that has been inactive for 3443 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

As I realized today, whenever a passenger unsits from my vehicle, driver's scripted camera params are totally resetting to its default. So then driver keeps driving by default camera view...  To avoid this issue, I decided to check link changes, so when a passenger unsits, I re-enter camera params for the driver. This seemed to be fine so far but camera moves to its default position and moves back to the desired position which is not really fine. Any better ideas? Thanks...

Link to comment
Share on other sites

How are the sittings organized? Is it one script for all sitters or one per sitter?

Anyway you must realize that any person sitting or getting up will trigger the changed link event
The same event handling you do when the driver sits down will be repeated(the driver is sitting om the same SitTarget) when someone else sits or gets up and that should include requesting permissions for animation and camera control

It sounds to me as if the camera control is revoked possibly because a new permission is requested without requesting the camera control at the same time

:smileysurprised::):smileyvery-happy:

Link to comment
Share on other sites

Its totally a different script just coded for driver camera. Theres not even a sit target exists inside this script. Exact problem only occurs on 'unsits'...

 

Cam Permission is not revoked when this happens but the camera params. What i understand so far is, server is forcing unsitters camera params to be resetted. I can understand that but why not only the unsitter. Why also sitting avatars forced their camera params to be resetted?

Link to comment
Share on other sites

Thank you for explaining.
The matter is so complex and deeply rooted in the way the viewer is programmed that I don't think it can be repaired by scripting:(
I myself loose the set CameraParams and switch to default sometimes on sim crossing
My solution was to give the driver the opportunity to switch between CameraParams and default by clicking the boat

:smileysurprised::):smileyvery-happy:

Link to comment
Share on other sites

There is a bug - an old one - so old that I don't think that LL will ever fix it since I assume they can't. :D

If one avatar unsits - this avatar will loose the camera controls - that's intentional. But all other avatars sitting on the same object will loose their camera controls as well.

What I do is: my script detects if an other avatar unsits - then it restores the camera controls for the avatar it has permissions. That is not smooth - just better than nothing.

There is no direct way to detect when camera controls get lost and if an avatar unsits it takes a little time until the other avatars loose controls. So I see no way for a super quick and smooth restoration. If someone finds one - post it.

 

Link to comment
Share on other sites

region change is a real pain

where it gets broken is when the script tries to execute a permissions-required task and the agent and vehicle [script] are not yet in the same sim. Is a server race condition this

LL done a whole heap of serverside work in recent years to help ameliorate vehicle/agent sim crossings so goes way better now. But if get a big timelag in the handoff (which can happen to anyone on any occasion) then can still be a problem. race-wise

+

most solutions to this start with sleeping the script on region change

however calculating how much time to sleep is still a problem. bc is no way of knowing how long the timelag is going to be. But a 1 or 2 second sleep can help smooth things in most cases

+

eta: vehicle script 

Link to comment
Share on other sites

a more involved way is to poll for the agent and ensure its presence before allowing the script to continue

example:

 

integer pollAgent(key id, float wait){   float t = llGetTime();   while (1)   {      // return true when agent found      if (llGetAgentSize(id) != ZERO_VECTOR)          return TRUE;            // return false when not found in wait time       if (llGetTime() - t > wait)           return FALSE;   }}// example usekey agent;killEngine(){  ... kill engine power so vehicle dont go      zooming off while waiting for agent ...}...changed (integer change) {   if (change & CHANGED_REGION)   {	killEngine();        if ( pollAgent(agent, 2.0) )          ... continue script with agent              restore engine ...        else          ... agent is lost               abandon agent              kill vehicle ...   }}

 

eta: script tpyo

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3443 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...