|
Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
|
10-25-2007 03:28
ok i am trying to make a avatar wearing this hud move to a preset postion but it seems that everything i try only moves the prim and not the avatar. i even tried having it open the world map but it keeps saying that you cannot TP closer to the location. any help please
|
|
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
|
10-25-2007 06:33
Perhaps you could have a flight assist prim attached to you and control it with llSay from your hud?
|
|
Aniam Ingmann
llOwnage(float pwnage);
Join date: 22 Oct 2005
Posts: 206
|
10-25-2007 14:54
maybe post the script so we can help? =p
_____________________
From: someone Don't worry, Aniam is here! - Noob
|
|
Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
|
10-25-2007 18:11
ok if i use a attachment to the avatar the following functions just move the attachment and not the avatar llSetPos llSetPrimitiveParamsllSetPrimitiveParams i have tried using llMoveToTarget(vector target, float tau) and i use it like such llMoveToTarget(<100, 100, 30>, 1.0); but for some reason it does nothing when i call the function. are there other movement functions that i am not aware of. I am thinking the only other alternative is to have the device ress a prim with preset coords in a llSetPos(<coords here>  ; and a click sit. i belive this is how carniage island does it. as for posting the script it is in i have just been doing it on a touch event to call the function. i dont think it would help much to post it thou when i get home i will dig it out and post it if that will help. again any help or advice would be wonderful.
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
10-25-2007 18:33
There is actually a fair amount involved in what you are trying to do. This should give you a clue as to what you have to do. It's just a much simplified demo of another script I use all the time and shouldn't really be used as anything but to learn with. To test it, just drop it in a prim attach to your hud and then type the elevation you want into channel 88.
float zSpeed; float target_height; vector x; float ground; integer targetID ; vector pos; integer listen_on;
default { state_entry(){ pos = llGetPos(); float ground = llGround(ZERO_VECTOR); if(pos.z > (ground + 50))llSetBuoyancy(1.0); else llSetBuoyancy(0.0); listen_on = llListen( 88, "", llGetOwner(), "" ); }
listen(integer channel, string name, key id, string message){ if( message == "reset")llResetScript(); else if(message != ""){ target_height = (float)message; x = llGetPos(); ground = llGround(ZERO_VECTOR); if(target_height < ground)target_height = ground; if(target_height > x.z){ target_height += 1; zSpeed = (float)(target_height - x.z); if(zSpeed > 10000)zSpeed = 10000; } else if(target_height <= x.z){ zSpeed = (float)(target_height - x.z); if(zSpeed < -10000)zSpeed = -10000; } x.z = target_height; targetID = llTarget(x,70); } }
not_at_target(){ llApplyImpulse(llGetMass()*<0,0,zSpeed>,FALSE); }
at_target(integer move, vector target, vector cPos){ pos = llGetPos(); llTargetRemove(targetID); llTargetRemove(move); llMoveToTarget(target, 0.5); llSetTimerEvent(5.0); }
timer(){ vector vel = llGetVel(); pos = llGetPos(); ground = llGround(ZERO_VECTOR); if(vel.z < 5.0 && vel.z > 0.1){ llStopMoveToTarget(); llApplyImpulse(-llGetMass()*llGetVel(),FALSE); if(pos.z > ground + 50)llSetBuoyancy(1.0); else llSetBuoyancy(0.0); llSetTimerEvent(1.0); } else{ llResetScript(); } } }
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Bizcut Vanbrugh
Registered User
Join date: 23 Jul 2006
Posts: 99
|
10-26-2007 08:53
thanks that is nice and i think i will need to add some more functions to it but the big question i have is will it move you thru solid objects into your destination. i will play wroun with it but i dont that that will be the case. man i wish the things i want to do would be simple.
|
|
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
|
10-27-2007 03:15
k, this is very simple. Much simpler than that long chunk of code someone else posted.
have a prim as an attachment, whether HUD or body. Set the prim to physical(yes, even if its an attachment.)
Use llMoveToTarget(destination_vector, time);
That's it.
P.S. no, you cannot move through solid objects. There used to be a bug that would turn the avatar phantom if the prim was phantom, but Linden Lab has a specific policy that they do *not* want avatars to be phantom. Very old subject. Numerous bugs have been found over the last couple years that let this happen, then LL closes them all up.
Now, having said that, there is 1 method to pseudo-move through objects. You use llMove2Target and set the time to a very, very low number. This only really works if A) the destination vector is at least 10 or more meters away(though less sometimes, have to experiment) and B) if the objects in between aren't too thick or numerous. Again, this is not full proof and you *will* run into instances where you get stuck at walls and such.
|