object affects avatar
|
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
05-06-2009 08:55
i have been looking at collision scripts
what i want is for an object - pysical - like a football i kick at a friend and when it hits him he triggers an animation like diving save or similar
so
physical object - is hits another avatar - that object is called say football
the avatar has boots on or prims on their feet with a script in that detects the ball hitting it and say to the avatar dive and the avatar dives for the ball then stands up again
i think its going to be a mixture of
in worn prim boots etc /////from the wiki on collisions////
//Will turn phantom when someone bumps into it if on the list list access_list = ["football"]; default { collision(integer num_detected) { if(~llListFindList(access_list, (list)llDetectedName(0))) {
((((((((((((do stuff))))))))) Trigger animations trigger sounds etc
} } }
even though i put in animations into the boot no matter what i do the animations will not happen is this not possible
hope you can all help on this one thanks
|
|
ElQ Homewood
Sleeps Professionally
Join date: 25 Apr 2007
Posts: 280
|
05-06-2009 23:31
It's quite probable the football isn't colliding with the boot, but with the avatar, and so the collision isn't being triggered.
|
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
05-07-2009 00:32
yes but can an external object (ball for example) trigger an animation on another person if that person is wearing boots or a prim on their legs that it hits
i mean without having agreed to be animated first - as the object they are wearing - by definition and by wearing it is the pre agreement surely?
the ball is definitely hitting the avatar as it was tested inside a hollow prim almost the same size as the av so no way could the ball have passed without hitting it
also the audio trigger worked just the animation is the problem
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
05-07-2009 01:21
collisions aren't detected by attachments IIRC. if the ball collides with the av, then sends a message which the 'boots' they are wearing receives, then the 'boots' could trigger an animation without a dialog.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
05-07-2009 01:47
i just seem to get
'Unable to find specified agent to request permissions.'
is there a snippet on how to send that message
|
|
ElQ Homewood
Sleeps Professionally
Join date: 25 Apr 2007
Posts: 280
|
05-07-2009 04:06
llRegionSay(-29854,"Dive"  ; That's actually how I'd expect it to be done, when the ball senses the collision, messages the boots which then would animate the avatar.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
05-07-2009 14:28
you still have to request the permissions in the attachment, it's just that theyonly need to be granted once key gKeyWorn;
default{ attach( key vKeyWorn ){ if (vKeyWorn){ if (!(llGetPermissionsKey() == vKeyWorn || PERMISSION_TRIGGER_ANIMATION & llGetPermissions())){ llRequestPermissions( gKeyWorn = vKeyWorn, PERMISSION_TRIGGER_ANIMATION ); } } }
run_time_permissions( integer vBitPermissions ){ if (PERMISSION_TRIGGER_ANIMATION & vBitPermissions){ llListen( -42, "football", "", gKeyWorn ); }else{ llOwnerSay( "Unable to animate without permissions, rewear to trigger request again" ); } }
listen( integer vIntNull, string vStrNull, key vKeyNull, string vStrHeard ){ llStartAnimation( "dive" ); }
changed( integer vBitChanges ){ if (CHANGED_OWNER & vBitChanges){ llResetScript(); } } }
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
05-08-2009 00:11
THANKS VOID (and others) i will give it/that a try 
|
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
05-08-2009 03:48
gKeyWorn;
syntax error changed to
key gKeyWorn
but then there is error here
PERMISSION_TRIGGER_ANIMATION & llGetPermissions())) between brackets
even with fiddling or removing or increasing brackets or adding; and so on no matter what i try the errors are still there
but i am hopeless at all this anyway
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
05-08-2009 05:19
slight bracketing change in edit, should work now
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
05-08-2009 06:36
wont compile :z
|
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
05-08-2009 06:40
i switched triggeranimation for llStartAnimation("dive"  ; that helped but then it jumped up to a syntax error on this line if (vKeyWorn && !((llGetPermissionsKey() == vKeyWorn) || (PERMISSION_TRIGGER_ANIMATION & llGetPermissions()))){ and no amount of shifting brackets seems to fix it  very odd
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
05-08-2009 14:20
might have helped to know what the compile error was...
type mismatch
it didn't want to test a key and integer returns at the same time (even seperated) which is stupid, but there ya go, the above now compiles
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
05-09-2009 01:28
thanks will give it a try later 
|
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
05-09-2009 01:45
hmmm i tried it but i think maybe my ball is not communicating with the worn prim i tried this in the ball what have i done wrong integer flags; default { collision_start(integer total_number) { if(llDetectedType(0) == 3) { llWhisper(-42,"football"  ; } } } (the prim is called 'football' also) but when i hit the worn prim with the football prim animation script in above the av does not animate so all i can guess is something is not hearing or saying something right :\ Update I even tried a basic collision no frills that actually said on channel 0 when it was hit out loud so i know the ball is saying the command the animation script above simply does not trigger any animations - perhaps its not possible
|
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
05-09-2009 08:54
i think the best way to test this is put the script above you compiled into a prim wear the prim with an animation of any kind renamed to "dive" type out in chat /-42 football and see what happens - nothing  and thats the problem - oh well
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-09-2009 10:31
From: Junglejim Jonson i think the best way to test this is put the script above you compiled into a prim wear the prim with an animation of any kind renamed to "dive" type out in chat /-42 football and see what happens - nothing and thats the problem - oh well Typing a negative channel into chat will NEVER work. A script will only accept instructions on a negative channel from an object. If you want to test your script, change the channel temporarily to a postive integer. ETA: Besides, it isn't listening for the word "football" anyway. Look at the Listen handle >>> llListen( -42, "football", "", gKeyWorn ); It's listening for the object named "football" to say its key (gKeyWorn), to be sure that the correct boot kicks the football.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
05-09-2009 11:43
my version takes a key to activate, namely the key of the av it hit... and only listens to the object named football
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-09-2009 11:53
ooops.... Yeah, what Void said. Anyway, it's listening for a key, not a word.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
05-09-2009 14:10
yeah but it still doesnt work i tried your way copy paste and nothing into a prim wore the prim and hit a prim called football at it nothing happened have you tried it in a prim worn it then walked into a prim called football  the av doesnt animate - is it actually possible to animate and avatar in this way? as that maybe the problem
|
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
05-09-2009 14:22
ETA: Besides, it isn't listening for the word "football" anyway. Look at the Listen handle >>> llListen( -42, "football", "", gKeyWorn ); It's listening for the object named "football" to say its key (gKeyWorn), to be sure that the correct boot kicks the football. how does the football say its key  just naming the object 'football' is not enough?
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
05-09-2009 19:58
From: Junglejim Jonson ETA: Besides, it isn't listening for the word "football" anyway. Look at the Listen handle >>> llListen( -42, "football", "", gKeyWorn ); It's listening for the object named "football" to say its key (gKeyWorn), to be sure that the correct boot kicks the football. how does the football say its key  just naming the object 'football' is not enough? not the key of the football (which would be llGetKey), it's waiting to hear the boot owners key (which would look like... collision_start( integer vIntTotal ){ llSay( -42, (string)llDetectedKey( 0 ) ); }
and for some reason collision start isn't listed in the events or collisions category in the portal... will fix that today (EDIT: or not... =/ I can't see why it's not showing in the listing) ETA: this also may not trigger in time for a fast moving ball... especially the first time. YMMV.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
05-10-2009 04:55
ok to sum up
<<<<<<<<<<<<<<<<PUT THIS IN A PRIM AND WEAR IT and Add a animation to the prim call dive>>>>>>>>>>>>>
key gKeyWorn;
default{ attach( key vKeyWorn ){ if (vKeyWorn){ if (!(llGetPermissionsKey() == vKeyWorn || PERMISSION_TRIGGER_ANIMATION & llGetPermissions())){ llRequestPermissions( gKeyWorn = vKeyWorn, PERMISSION_TRIGGER_ANIMATION ); } } }
run_time_permissions( integer vBitPermissions ){ if (PERMISSION_TRIGGER_ANIMATION & vBitPermissions){ llListen( -42, "football", "", gKeyWorn ); }else{ llOwnerSay( "Unable to animate without permissions, rewear to trigger request again" ); } }
listen( integer vIntNull, string vStrNull, key vKeyNull, string vStrHeard ){ llStartAnimation( "dive" ); }
changed( integer vBitChanges ){ if (CHANGED_OWNER & vBitChanges){ llResetScript(); } } }
<<<<<<<<<<<<<<<<PUT THIS IN A PRIM AND CALL THE PRIM FOOTBALL>>>>>>>>>>>>>
default {
collision_start( integer vIntTotal ){ llSay( -42, (string)llDetectedKey( 0 ) ); } }
RESULT when the ball hits avatar = nothing :)))
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
05-10-2009 16:36
check your animation priority and whter you have an AO on... works fine.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
05-11-2009 00:37
never worn an AO
tried a few animations what priority do you suggest 4?
as i have that - still no go
seriously this doesnt work good try though but it simply will not animate the avatar
which is why i came here in the first place because i think SL have some block on this or something anyone here can try it do what i suggested above and see what happens - nothing happens
i can even video it not working
it compiles but thats not the same as it actually working
|