Casey Conundrum Posted January 8, 2023 Share Posted January 8, 2023 (edited) wrong section I moved it Edited January 8, 2023 by Casey Conundrum moved it! Link to comment Share on other sites More sharing options...
Casey Conundrum Posted January 8, 2023 Author Share Posted January 8, 2023 About to pull my hair our rofl. A) I can get the pose to start, but when its time to stop it, it fails to stop and sometimes gives us "Script trying to trigger animations but PERMISSION_TRIGGER_ANIMATION permission not set". B) under take control how would I take control where the said person can not move till time releases controls? just not sure what to add in the control event string animation = "Pose"; trigger() { //-- Removed not a problem -- //little hidden code //-- end of Removed not a problem -- llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION); } default { state_entry() { } run_time_permissions(integer perm) { if(PERMISSION_TAKE_CONTROLS & perm) { llTakeControls(CONTROL_FWD |CONTROL_BACK |CONTROL_LEFT |CONTROL_RIGHT |CONTROL_ROT_LEFT |CONTROL_ROT_RIGHT |CONTROL_UP |CONTROL_DOWN |CONTROL_LBUTTON |CONTROL_ML_LBUTTON ,TRUE, TRUE); } if (perm & PERMISSION_TRIGGER_ANIMATION) { list anims = llGetAnimationList(llGetOwner()); if(llListFindList(anims, [llGetInventoryKey(animation)]) == -1) { llStartAnimation(animation); } } } timer() { //-- Removed not a problem -- //little hidden code //-- end of Removed not a problem -- if (amounta == amountb) { // Stop the timer. llSetTimerEvent(0.0); llStopAnimation(animation); llReleaseControls( ); } } } Link to comment Share on other sites More sharing options...
Qie Niangao Posted January 8, 2023 Share Posted January 8, 2023 7 minutes ago, Casey Conundrum said: A) I can get the pose to start, but when its time to stop it, it fails to stop and sometimes gives us "Script trying to trigger animations but PERMISSION_TRIGGER_ANIMATION permission not set". B) under take control how would I take control where the said person can not move till time releases controls? just not sure what to add in the control event For A, try protecting that llStopAnimation() call with some conditionals, at least checking if PERMISSION_TRIGGER_ANIMATION is in the bit vector returned by llGetPermissions(). Might also want to check that the agent key returned by llGetPermissionsKey() is in the region (e.g., their llGetAgentSize() isn't the ZERO_VECTOR, or their llGetMass() isn't 0.0, or something like that). For B, try changing the last argument ("pass_on") to FALSE—but bearing in mind that there are other ways for an avatar to move that don't involve controls at all. Link to comment Share on other sites More sharing options...
Quistess Alpha Posted January 8, 2023 Share Posted January 8, 2023 10 minutes ago, Qie Niangao said: there are other ways for an avatar to move that don't involve controls at all Teleporting and sitting on something are the only ones I know of that wouldn't be affected by 'locked controls'. Camera focusing can also lead to turning without control input. I'm fairly certain the viewer's autonav functionality (which is bad and hopefully nobody uses seriously) goes through the same control system as regular movement input. Link to comment Share on other sites More sharing options...
Casey Conundrum Posted January 8, 2023 Author Share Posted January 8, 2023 This pose & script are both in a hud that a user will wear. so sitting to stop movement will not work in the system. the idea is I have fence that sends a message to the hud, you have touched the fence. So the hud will send a zap to the hud user zapping them for a amount of time. during that time frame I don't want them to be able to move while being zapped. IE while the pose is being played. Link to comment Share on other sites More sharing options...
Bugs Larnia Posted January 8, 2023 Share Posted January 8, 2023 (edited) For question A: I often see two approaches being used: global variable or llGetPermissions. The global variable method sets a global variable (gasp!) to TRUE or FALSE. In your case: integer giAnimPerms; if (perm & PERMISSION_TRIGGER_ANIMATION) { giAnimPerms = TRUE; //Set to TRUE list anims = llGetAnimationList(llGetOwner()); if(llListFindList(anims, [llGetInventoryKey(animation)]) == -1) { llStartAnimation(animation); } } And in your timer if (amounta == amountb) { // Stop the timer. llSetTimerEvent(0.0); if (giAnimPerms) //Check perms { llStopAnimation(animation); giAnimPerms = FALSE; //Set to FALSE } llReleaseControls(); } The same can be done with llGetPermissions. In that case, you can leave the first section untouched, but you need to adjust the timer section: if (amounta == amountb) { // Stop the timer. llSetTimerEvent(0.0); integer iGrantedPermissions = llGetPermissions(); //Get the granted permissions if (iGrantedPermissions & PERMISSION_TRIGGER_ANIMATION) //Make sure you use a single & { llStopAnimation(animation); } llReleaseControls( ); } I'm not sure what the trade-off is, memory-wise, so I cannot tell you what the most efficient method is. As for question B: I'm not entirely understand your question, but I would take a look at the examples of https://wiki.secondlife.com/wiki/LlTakeControls. It's a pretty straightforward snippet on how to implement it. Edited January 8, 2023 by Bugs Larnia Added question B response Link to comment Share on other sites More sharing options...
Bugs Larnia Posted January 8, 2023 Share Posted January 8, 2023 I understand the question you posed here was not what you wanted, but please don't remove the original questions. I might not be relevant to you (any more), but might be the exact answer someone else is looking for and now the answers no longer have context. 1 Link to comment Share on other sites More sharing options...
Love Zhaoying Posted January 8, 2023 Share Posted January 8, 2023 26 minutes ago, Bugs Larnia said: As for question B: I'm not entirely understand your question, but I would take a look at the examples of https://wiki.secondlife.com/wiki/LlTakeControls. It's a pretty straightforward snippet on how to implement it. I agree on this. I was studying it recently and finally saw that there are options to take controls and basically "pass through" - the avatar controls do the normal things but you also intercept the controls. If you use llTakeControls() with the wrong bit flags, then the "pass through" happens instead of the actual "TAKE" controls (override normal control usage). 1 Link to comment Share on other sites More sharing options...
Casey Conundrum Posted January 8, 2023 Author Share Posted January 8, 2023 the better idea would to say use move to target to keep them in place while its posing to stop them from moving? Link to comment Share on other sites More sharing options...
Love Zhaoying Posted January 8, 2023 Share Posted January 8, 2023 Hmm....if you had a way to "force-sit" them, they could not move until "unsit" or "stand", and you could still override the animations with whatever you want. Sorry, not sure if that came up in the original post before you moved it. Link to comment Share on other sites More sharing options...
Casey Conundrum Posted January 8, 2023 Author Share Posted January 8, 2023 I was thinking about a force sit, but force-sit would apply if there in rlv, while some of the items we are making have the force sit command being used, this is on a gated area and only applies if they bump into the fence. Link to comment Share on other sites More sharing options...
Quistess Alpha Posted January 8, 2023 Share Posted January 8, 2023 1 hour ago, Casey Conundrum said: force-sit would apply if there in rlv You can also 'force-sit' someone who has accepted your experience, while on land with your experience enabled. llSitOnLink() Link to comment Share on other sites More sharing options...
Qie Niangao Posted January 9, 2023 Share Posted January 9, 2023 15 hours ago, Quistess Alpha said: Teleporting and sitting on something are the only ones I know of that wouldn't be affected by 'locked controls'. My initial thought was of a physics HUD, analogous a swim HUD but setting buoyancy independent of water level and using HUD buttons in place of control inputs. But… 15 hours ago, Casey Conundrum said: This pose & script are both in a hud that a user will wear. so sitting to stop movement will not work in the system. so maybe we're only concerned with avatar movement that's "in the system", not worrying about any sneaky adversarial devices the captured user may deploy. And if the whole thing lasts only a few seconds, it's pretty unlikely they'll have time to find and activate such a device anyway. (I also realize, on re-reading my response, that I didn't make clear that "the last argument ('pass_on')" I was mentioned was to llTakeControls but that's clear now. Sorry I omitted that the first time.) 1 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