Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to make a "Transparent" Vehicle

Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
05-30-2007 09:02
heyas;

no, i dont mean transparent as in wonder woman's invisible jet. i mean transparent as in, you sit on a vehicle and it doesn't LOOK as if you're sitting on a vehicle, and it doesn't behave as if you're sitting on a vehicle. it behaves as if... well, you're not on a vehicle at all.

for example: all those saddle scripts, so one avatar can 'ride' another. or abranimations tiny carrying poses/vehicles/scripts. you 'sit' on it, and for all intents and purposes, you walk around normally. just that someone else can also sit on it and go with you.


i tried cancelling the sitting animation when the avatar sits on it (thought not un-seating the avatar), but that doesnt appear to do anything.

does the entire animation spectrum need to be duplicated by the vehicle script? ie: when velocity is zero and on the ground, run the standing poses. when moving forward, run the walk animation. when going at speed change to running animation...? and if so, what if/when the avatar is using its own ao?

is there some other trick to it? i'd like to make one where my bird avatar can sit on someone's shoulder and such, and the vehicle isn't that hard, but the animations.... i need help. (actually, a vehicle script that imitates non-vehicular movement would be handy, but if you dont want to share, i can probably work something out myself. eventually.)
_____________________
Why Johnny Can't Rotate:
http://forums.secondlife.com/showthread.php?t=94705
Vicky Christensen
Registered User
Join date: 29 Dec 2005
Posts: 47
06-04-2007 16:29
This script is the most guarded secret in all the metaverse.
grumble Loudon
A Little bit a lion
Join date: 30 Nov 2005
Posts: 612
06-04-2007 22:06
One thought would be to have the person wear the vechicle like the "carbon rod" or the "X-Flight".

I also heard that animations have priority levels. So you may be able to lower the priority of the animation you use when sitting.
Polymorphous Projects
Registered User
Join date: 26 Jul 2006
Posts: 86
06-05-2007 07:34
From: Bloodsong Termagant
heyas;


does the entire animation spectrum need to be duplicated by the vehicle script? ie: when velocity is zero and on the ground, run the standing poses. when moving forward, run the walk animation. when going at speed change to running animation...? and if so, what if/when the avatar is using its own ao?



Basically... yes. You can set your animations to priority 4 to help override any other ao's, but best bet is include instructions for users to turn off other ao's. The biggest problem with the whole system is the physics engine and the poor performance of vehicles in general in SL.
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
06-05-2007 12:08
If an Avatar is sitting on something, it cannot walk/fly/etc...it just cannot do it because then it wouldn't be sitting anymore. Regardless of whether the sit animation is stopped or not, the Avatar is still considered to be sitting.


When you sit on something, you are essentially becoming part of the linkset. This is why physical vehicles cannot be more than 30 prims with a driver, and you have to take a way a prim for each passenger you want to be able to sit in it as well.

In order to code this and make it seamless, you would need to poll for almost every single avatar state, run the appropriate animations for each manually, and script the linkset with vehicle coding that can accomodate each of the avatar states. (like walking would be a ground vehicle script, etc)

While by no means impossible, it would take quite a bit of work to code it from scratch.

The saddle scripting that you can see around would be much easier because you can make the vehicle part move however you want and make the animations accomodate that movement.

Regarding custom animations, the priority for these is set only when they get first uploaded, so you cannot take an animation that's already in SL and increase the priority on the fly.
Virrginia Tombola
Equestrienne
Join date: 10 Nov 2006
Posts: 938
06-05-2007 14:20
Well, I'm scripting a saddle for my centaur avi's right now, and I don't mind talking about the technique. Mind you, I'm still groping about in the dark.

Basically, your avatar state is "sitting". So, you need to stop that animation when the avatar gets on (I did it right after the request permissions). Then it's the simple, albeit tedious, matter of setting up the if and if else statements so the appropriate play animations are run. For example, if the "throttle" is set to "walk" in my script, AND the forward arrow is held, then the script calls the walk animation. At the end of all the possible animations, it defaults to a "else" statement which plays the stand animation (I also send a llSay to the centaur attachment to run its various animations and sounds for the various states).

This works well enough for walking, running, flying, and turning, but I can't think of how you might do a sit.

One issue I AM having trouble with is the default stand. Although it works perfectly well off the vehicle, and is the same priority as the rest of the animations, it has been a tad quirky. Specifically, the top half of the avatar (which is NOT part of the animation, as I wanted it to respond to chat, mouse movement, etc) will sometimes revert to odd animations--like the arms frozen in type position or a single frame pose of an AO. I thought this might be because no animation is specified, and the default "stand" is not running either, so SL is randomly picking an animation. Yet, when I turned on a AO to test this idea, it didn't use the top half poses from the AO (which it will if the Avi is just standing around).

Well, would scripting be fun without inexplicable glitches (short answer: yes, as a matter of fact)
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
06-07-2007 07:34
isn't that what an ao does, already?

"poll for almost every single avatar state" and set the overriding animations as appropriate? or does it just read the current animation and override it with another?

but... i dont think that's how its done.

on move_start you could check for velocity and play the walk animation.

OR

you could link your vehicle throttle to just do the animations. tap once forward, you're in first gear, play walk animation. tap forward again, go to second gear, do run animation.

or you could just trap the ctrl-r key command (i think??), to toggle the vehicle's two different speeds, then on move_start do the walk/run animation.

and on move_end, do a standing anim?


then you do the in_air test or whatever to do the hover vs flat-out flying animation.


plus, i dont think you need to poll for EVERY avatar animation scenario. for example, you could skip the turn left and turn right, and i doubt anyone would notice. so you just need:

standing
walking
running
hovering
flying


as for sitting... well, you couldn't sit on a chair, for example, without getting off the vehicle first. but, all right, if im doing a vehicle so my parrot can ride on someone's shoulder, we'll want to sit in a chair someday, without having to get up.
sitting could just be handled by two animations in the vehicle: sit and ground sit. the positioning of the sits would be tricky, though :/ especially since you cant make the vehicle phantom in case it needs to intersect the chair you're trying to sit on.
on the other hand, if the vehicle is small enough, it could 'park' on the chair surface. (that is, if the furniture itself isnt phantom.)


but anyway, that seems to be the only way to work it. not sure exactly how to construct it, but that's the outline. anybody else trying to break into transparent vehicles, good luck :)
Virrginia Tombola
Equestrienne
Join date: 10 Nov 2006
Posts: 938
06-07-2007 09:00
From: Bloodsong Termagant
isn't that what an ao does, already?



The problem is with a transparent vehicle, the avatar is *always* is sit state. So a regular AO won't work, as they are based on polling the avatar state. Instead, you need to look at the vehicle inputs and get them trigger the necessary animations.


Edit: Erm, you said that, didn't you? Sorry! Pre-tea posting is a dangerous thing.
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
06-14-2007 10:15
oh!

no, i think i confused the avatar state and the avatar velocity. which leads me to the next question in this evolution....


does anybody have the proper velocities (and/or engine settings?) for the following speeds:

avatar walking
avatar running
slow flight
full speed flight
flight of an unladen swallow


also handy would be turn speeds/radii? like walking forward and turning right.


to get the vehicle to move the proper way, let alone having the avatar animate right. :)




ps: no, wait.... does the ao poll the STATE or the currently playing ANIMATION? because the notecard looks like it's checking animations: ie stand1, stand2, stand3.... not just the 'standing still' state.
so if i said 'play stand1' and the ao said 'if stand1 is playing, stop that and play customstand80', then the ao would still work.
Virrginia Tombola
Equestrienne
Join date: 10 Nov 2006
Posts: 938
06-14-2007 11:51
From: Bloodsong Termagant

ps: no, wait.... does the ao poll the STATE or the currently playing ANIMATION? because the notecard looks like it's checking animations: ie stand1, stand2, stand3.... not just the 'standing still' state.
so if i said 'play stand1' and the ao said 'if stand1 is playing, stop that and play customstand80', then the ao would still work.


AOs poll the animation. So, yes, if 'stand1' is returned, play 'customstand80'. But that won't work for a transparent vehicle, as you're sitting so it will return 'Sitting'

More about GetAnimation here:
http://rpgstats.com/wiki/index.php?title=LlGetAnimation
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
06-15-2007 08:07
"Sitting This is returned even when the avatar is sitting on something that stopped the generic sit animation and plays its own instead"


ohhhhh.