SwireD Posted October 4, 2019 Share Posted October 4, 2019 hi! how to make a script for a linkset of two objects (poseballs) that will hide them only when both people sat on them? Link to comment Share on other sites More sharing options...
Rolig Loon Posted October 4, 2019 Share Posted October 4, 2019 if (llAvatarOnLinkSitTarget(1) != NULL_KEY && llAvatarOnLinkSitTarget(2) != NULL_KEY) { llSetLinkAlpha(LINK_SET,0.0,ALL_SIDES) } else { llSetLinkAlpha(LINK_SET,1.0,ALL_SIDES) } assuming that you have defined llLinkSitTarget for both poseballs. 1 Link to comment Share on other sites More sharing options...
SwireD Posted October 4, 2019 Author Share Posted October 4, 2019 54 minutes ago, Rolig Loon said: if (llAvatarOnLinkSitTarget(1) != NULL_KEY && llAvatarOnLinkSitTarget(2) != NULL_KEY) { llSetLinkAlpha(LINK_SET,0.0,ALL_SIDES) } else { llSetLinkAlpha(LINK_SET,1.0,ALL_SIDES) } assuming that you have defined llLinkSitTarget for both poseballs. Thank you! I forgot to mention that I do not need the animation itself in this script, it will be a separate scripts AVsitter2. Does this change anything? and I could not find anything about llLinkSitTarget in web. can I have some kind of example please? Link to comment Share on other sites More sharing options...
SwireD Posted October 4, 2019 Author Share Posted October 4, 2019 I found your script on the forum and inserted what you provided. but for some reason it doesn’t work. default { state_entry() { llSetMemoryLimit(0x4000); llLinkSitTarget(1, < -0.5, 0.32, 0.1 > , llEuler2Rot( < 0.0, 0.0, PI / 2 > )); // Sit on the "seat" prim llLinkSitTarget(2, < 0.2, 0.35, 0.4 > , llEuler2Rot( < 0.0, 0.0, PI / 2 > )); //Sit on the "leg" prim if (llAvatarOnLinkSitTarget(1) != NULL_KEY && llAvatarOnLinkSitTarget(2) != NULL_KEY) { llSetLinkAlpha(LINK_SET, 0.0, ALL_SIDES); } else { llSetLinkAlpha(LINK_SET, 1.0, ALL_SIDES); } } } Link to comment Share on other sites More sharing options...
Rolig Loon Posted October 4, 2019 Share Posted October 4, 2019 Your reference for any LSL functions is always the LSL wiki. In this case, look at http://wiki.secondlife.com/wiki/LlAvatarOnLinkSitTarget and related functions. Study the examples for that function to get an idea of how it might be used. Also, when you are about to use an unfamiliar function, take a look through any Caveats to see what limitations there my be on its use. For something as simple as a couple of linked poseballs, I would not recommend using AvSitter. Just write your own script and include any animation code in it. I certainly would avoid trying to combine AvSitter with another script in the poseballs. You're likely to get all sorts of conflicts between them. 1 Link to comment Share on other sites More sharing options...
Rolig Loon Posted October 4, 2019 Share Posted October 4, 2019 5 minutes ago, SwireD said: I found your script on the forum and inserted what you provided. but for some reason it doesn’t work. Bits of code in this forum are very rarely complete scripts. This is a forum for scripters to trade ideas and curse at the things that go wrong in our scripts, so we tend to post snippets of code as illustrations or as puzzles. In this case, you should be expecting to detect when both avatars are sitting by watching for the execution of a changed event, not in the state_entry event, which is only executed when the script is reset. 1 Link to comment Share on other sites More sharing options...
SwireD Posted October 4, 2019 Author Share Posted October 4, 2019 (edited) 29 minutes ago, Rolig Loon said: Bits of code in this forum are very rarely complete scripts. This is a forum for scripters to trade ideas and curse at the things that go wrong in our scripts, so we tend to post snippets of code as illustrations or as puzzles. In this case, you should be expecting to detect when both avatars are sitting by watching for the execution of a changed event, not in the state_entry event, which is only executed when the script is reset. Thank you so much! I managed to make it work, added changed event. However, I have not tested it yet with the AVsitter. default { state_entry() { llSetMemoryLimit(0x4000); llLinkSitTarget(1, <0.0,0.0,0.5>, ZERO_ROTATION); llLinkSitTarget(2, <0.0,0.0,0.1>, ZERO_ROTATION); } changed(integer change) { if (llAvatarOnLinkSitTarget(1) != NULL_KEY && llAvatarOnLinkSitTarget(2) != NULL_KEY) { llSetLinkAlpha(LINK_SET, 0.0, ALL_SIDES); } else { llSetLinkAlpha(LINK_SET, 1.0, ALL_SIDES); } } } Edited October 4, 2019 by SwireD 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