Resilient Posted July 21, 2011 Author Share Posted July 21, 2011 actually I wear the object that has the script as a hud, so it does not add my name to the list of detected avatars i think what i said is right because when people are near me , and the second dialog box comes , my name is not shown on the buttons so i think my name is never saved to the list gAvNames secondly, if no one is near me ... my logic says it should tell me that "no one is near me" and the second dialog box will not appear either the second dialog box does not appear but the llOwnerSay function is not carried out Link to comment Share on other sites More sharing options...
Void Singer Posted July 21, 2011 Share Posted July 21, 2011 z is always greater than 0 because sensor event doesn't fire without a detection. for z to be zero you'd be in the no_sensor event... all detection events work this way, if there is nothing detected they don't fire (or fire their no-detection alternates) 2 Link to comment Share on other sites More sharing options...
Resilient Posted July 21, 2011 Author Share Posted July 21, 2011 aha, did not know about the no_sensor event at all, ty so much, got it working Link to comment Share on other sites More sharing options...
Resilient Posted July 21, 2011 Author Share Posted July 21, 2011 I just have one final thing with this script that i am stuck with.. after a partner accepts , how do i make my avatar dance as well with the hud script? instead of manually selecting the animation from my inventory tried a few combinations of llStartAnimation but it's not working for me. Link to comment Share on other sites More sharing options...
Rolig Loon Posted July 21, 2011 Share Posted July 21, 2011 To start (or stop) an animation you need to llRequestPermissions(PERMISSION_TRIGGER_ANIMATION) first. Then, you actually trigger the animation in a run_time_permissions event. See the example at http://wiki.secondlife.com/wiki/LlStartAnimation Link to comment Share on other sites More sharing options...
Resilient Posted July 22, 2011 Author Share Posted July 22, 2011 I did know that but I was wondering since it was my own avatar do I still need to ask for RequestPermissions? Link to comment Share on other sites More sharing options...
Rolig Loon Posted July 22, 2011 Share Posted July 22, 2011 Yes. You always need to, even if permission is automatic. Link to comment Share on other sites More sharing options...
Innula Zenovka Posted July 22, 2011 Share Posted July 22, 2011 Just in case it's not clear, this means you'll need at least two scripts in the hud, since a script can only hold permissions for one avatar at a time. Link to comment Share on other sites More sharing options...
Void Singer Posted July 22, 2011 Share Posted July 22, 2011 sort of.... you can request permissions for one, trigger the dance for that one then immediately request permissions for the next and trigger that one... the only slight problem with that is that it becomes a pain to synch the dances, and to stop it by script you have to re-request permissions from whomever you don't have permissions from. a few dance balls and chimeras work this way, but most go with multiple scripts so you don't have dialogs for permission on ever change. Link to comment Share on other sites More sharing options...
Resilient Posted July 22, 2011 Author Share Posted July 22, 2011 llRequestPermissions(ToucherID, PERMISSION_TRIGGER_ANIMATION); llRequestPermissions(llList2Key(gAvKeys,idx),PERMISSION_TRIGGER_ANIMATION); //llList2Keys(gAvKeys,idx) is the UUID of the chosen partner } } run_time_permissions(integer perm) { if(perm & PERMISSION_TRIGGER_ANIMATION) /// If your partner accepted ....... { llStartAnimation(llList2String(dances,gChoice)); // This is the particular dance you chose, remember? } well it does work with a single script but the problem as rightly mentioned in the previous post is in synchronization. What should be the logic for a second script or how do the scripts communicate with each other? Any clues.. Link to comment Share on other sites More sharing options...
Rolig Loon Posted July 22, 2011 Share Posted July 22, 2011 One solution is to have the triggering script process permissions for one dance and then use llGetUnixTime to get the current time (X). It starts a countdown of, say, 5 seconds and sends a signal to the other script that says "Watch llGetUnix Time and start your animation when it reaches X plus 5 seconds." The triggering script then has 5seconds in which to do whatever it needs to get and process the second permissions. When the countdown in both scripts ends, they start their animations simultaneously. Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted July 22, 2011 Share Posted July 22, 2011 Another way would be to have a third script that dispatches the getting permissions to the two animation scripts, triggers a signal to start the animation as soon as both sub-scripts got their permissions and in a times interval makes sure the animations are in sync by sending a anim re-start trigger. The communication wouuld be done using llMessageLinked and link_messager. Link to comment Share on other sites More sharing options...
Innula Zenovka Posted July 22, 2011 Share Posted July 22, 2011 Quite how you synchronise the two animations depends, I guess, on whether you're intending to start both animations simultaneously or to synchronise them if you're already dancing and then invite someone to join you. Either way, I would have the main script -- the one that handles the sensor and dialog -- also get permission to animate the wearer when it's attached, so that's one less thing to worry about. Then, send a link message to the second script, when you've selected your prospective dance partner, with the uuid of the avatar with whom you want to dance. In the run_time_permissions event of the second script, if the invitation's been accepted, start the animation and send a link message to the first script telling it that the invitation has been accepted, so do stuff to start the wearer dancing/synchronise the two, or, if the invitation's been declined, send a link message to pop up a dialog asking the wearer what to do next. ETA --come to think of it, probably it would be better, when the second script obtains permission to animate your partner, to have it send a link message to LINK_THIS and then start (or try to synchronise) both animations in the link_message event. Link to comment Share on other sites More sharing options...
Resilient Posted August 5, 2011 Author Share Posted August 5, 2011 thank you so much everyone, was a great help .. I finally did it. Link to comment Share on other sites More sharing options...
Recommended Posts
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