Jump to content

Hawthorne Gray

Resident
  • Posts

    50
  • Joined

  • Last visited

Everything posted by Hawthorne Gray

  1. Firstly, I got rid of the child triggering object and put the experience "animate on_collision" script in the root of the pendulum. Also, I added a debugging llOwnerSay() to the script: collision_start(integer num) { llOwnerSay("You been hit"); if(ready) { key collider = llDetectedKey(0); if(llGetAgentSize(collider) != ZERO_VECTOR) { llRequestExperiencePermissions(collider, ""); } } } and I kept an older script that I originally had used to detect a collision in the pendulum: default { state_entry() { llSetStatus(STATUS_PHANTOM, FALSE); llOwnerSay("Pendulum collision detection script active. Ready to detect collisions."); } collision_start(integer total_number) { integer i; for (i = 0; i < total_number; ++i) { key collided = llDetectedKey(i); if (llDetectedType(i) & AGENT) { llOwnerSay("Collision detected with avatar: " + llKey2Name(collided)); } } } } The results are as follows: (First Try) I set my avatar in the path of the pendulum and hit restart: https://gyazo.com/0fc35d1be5543c5b9eab3f676a998925. As you can see my avatar is animated and the chat windows displays 2 messages indicating I've been struck. (Second Try) I set up everything the same as the first try but ground-sit my avatar to be out of the way of the pendulum before hitting restart then waited until the pendulum made two full swings before I stood up: https://gyazo.com/946b3754c798abbfff9ec836b235ac7c. As you can see, my the pendulum does not register a collision when it hits my avatar. It would seem to me that maybe the speed at which the pendulum is moving has something to do with the success of triggering a collision, yes? Or is this dillusionary on my part? What are the ways I could surmount this problem? I ask this because my next step is to write out my own pendulum script to make the pendulum swing and lower itself at 1 cm per second along with the dialog menus to control the pendulum but, sheesh, what an endeavor that might prove useless in any case.
  2. I have a pendulum swinging across a path that people must get by without being hit by it because, it has a large blade and would cause them harm. Or that’s the idea. But, It’s a third party object and I do not have access to the animating script so I tried creating a separate script to detect collisions with avatars then trigger some sort of reaction. But the script would not get triggered on collision with an avatar. So, I wrote an animate on collision script for a prim using parcel experience (which users will have already accepted prior to coming across the pendulm). I placed the trigger prim across the path a user would need to cross in order to get past the pendulum and which, on their collision with this trigger prim, would animate their avatar as if they had been stuck by it. But this took some of the fun out of having users trying to dodge the pendulum as they walked past it as the trigger prim was stationary, invisible and unavoidable, so everyone would necessarily collide with it trying to get past the pendulum. The following image shows the pendulum as it slices through the white block (normally invisible) that is the trigger prim which everyone has to pass through as the come down the stairs: https://gyazo.com/6225039bc3ed1110bbe65e4600cffd46 - image Then I had the brilliant idea of attaching the trigger prim to the pendulum so that any avatar actually colliding with the pendulum (non-phantom) as it swings back and forth would also collide with the trigger and be animated falling down. Only it didn’t work, my avatar just walked through the pendulum and the trigger prim and… nothing. But, I never give up, and taking @animats’s reply to my earlier query on this matter: “If it [the pendulum] can push an avatar around, it can get collision events. Non-phantom objects moved with keyframe motion or llSetPos do get collision events” , so I tried to make the pendulum collide with me and Voilà that worked: https://gyazo.com/f867aabeab56de0f4e35525539b102c0 - video But only for a few seconds, once the pendulum got up to speed it ceased being triggered on collision with my avatar: https://gyazo.com/0bebf65bc01c3199729d48779aafd409 - video My question is “Why?” Here's the script" integer ready; string anim; default { state_entry() { llVolumeDetect(TRUE); anim = llGetInventoryName(INVENTORY_ANIMATION,0); integer exists = llGetInventoryType(anim); if(exists == INVENTORY_ANIMATION) { ready = TRUE; } } on_rez(integer num) { llResetScript(); } collision_start(integer num) { if(ready) { key collider = llDetectedKey(0); if(llGetAgentSize(collider) != ZERO_VECTOR) { llRequestExperiencePermissions(collider, ""); } } } experience_permissions(key target_id) { llStartAnimation(anim); llSetTimerEvent(8.0); } changed(integer change) { if(change & CHANGED_INVENTORY) { llResetScript(); } } timer() { llStopAnimation(anim); llSetTimerEvent(0.0); } }
  3. So, no, I could not get the pendulum to react on collision, whether i ran into it or stood there and let it collide with me. The pendulum in not physical and non-phantom and does not push me around at all when it strikes me while i can walk through it as if it were phantom. I sort of found a solution, see my next post.
  4. Is it possible for an animated non-physical object (let's say a pendulum swinging back and forth) to detect a collision between itself and a stationary avatar? Or, do collisions only get detected when an avatar collides with an object? And must that object be stationary?
  5. @animats I would agree if that was the only use of experience within the parcel but I use it to TP people from place to place, set the shared environment and a few odd things here and there. So it makes sense to add the drink service to the list - I just have to figure the scripting out first.
  6. First, thank you @elleevelyn for your commenting the permissions process - although I don't get the purpose of '!llGetAttached()' used in the example. So, with that help from @elleevelyn and going back over the wiki page examples and some old scripts I've used in the past I did the following: 1) removed everything from the attach() function except the permissions request with both PERMISSION_ATTACH & PERMISSION_TRIGGER_ANIMATION arguments. 2) put everything else that I had taken out of the attach() function and put it under 'run_time_permissions(integer perm)', still using both arguments PERMISSION_ATTACH & PERMISSION_TRIGGER_ANIMATION. And voilà, everything works (with me at least, will need to test it with other users), the drink object is rezzed onto the top of the bar and the user ordering the drink clicks on it to attach it. The drinker can rid himself of the drink object by saying 'done' in local chat, or, after 5 minutes, the drink object is automatically detached into the void. This is a change from my original script where, with @Qie Niangao's help, the altbot bartender would rezz the drink and it would be automatically attached to the customer. Just seemed more realistic to have the drink set down on the bar first. Ummm, the script allows the user to delete the drink by chatting the word 'done' in local or it will auto-delete after 5 mins. I DO need to add an auto-delete that will take effect if the drink is never picked up off the bar, but that should be easy to implement. Interestingly, @animats I hope to make this action an experience but wow! if I'm buffaloed by regular permission issues, I have found it double as hard with getting it right in experiences. Someday.
  7. I don't mean to be daft but I only understand 1/2 of it - I get that the permissions are lost on attachment and Ineed to now reuqest permissions again, but where? Do I take out the llStartAnimation("hold") line and put it into its own 'if' clause with a permission request? You say "next step is to request permissions - again, permissions are granted silently(as opposed to loudly?)" then you say "now you can do animations" - wait, what? Like I said earlier, I can't wrap my head around the whole permission routine although I understand their purpose. Just not how it's implemented, and the Wiki pages leave so many questions unanswered and their examples meagre and obscure. So, I dunno. Its frustrating to know a script is so close to being done but might as well be written in pig latin for all the good it does.
  8. But the object does not attach in the first place. It rezzes on the top of the bar but when users click on it it throws the error: As I read the article linked to in the reply above the reset of owner permissions only becomes problematic when you want to detach the object: I find this whole process of permissions thoroughly confusing no matter how many times I read the Wiki pages on permissions. If i 'change attach(key id)' from: attach(key id) { if ((id == NULL_KEY)) { // Object is now attached to the avatar // Adjust position and rotation when attached llSetLinkPrimitiveParamsFast(LINK_THIS, [ PRIM_POS_LOCAL, attachPos, PRIM_ROT_LOCAL, attachRot ]); // Start the hold animation llStartAnimation("hold"); to: attach(key id) { if ((id == NULL_KEY) && (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) { // Object is now attached to the avatar // Adjust position and rotation when attached llSetLinkPrimitiveParamsFast(LINK_THIS, [ PRIM_POS_LOCAL, attachPos, PRIM_ROT_LOCAL, attachRot ]); // Start the hold animation llStartAnimation("hold"); then the object attaches when I click on it but I lose the animation (I have not tested it with a different user, no one is up yet). This is so frustrating!
  9. I'm back with an attachment/permissions issue and a similar script as before: a drink object is rezzed then attached to the user on touch. It works great when i use it but other users receive this error: and this dialog menu: Instead of repairing this script @Qie Niangao suggested on an earlier version of this script I set up an Experience to handle permissions, so I have created the experience on my parcel but lack the expertise to implement the correct changes to the script, even with chatGPT o1-preview's help. Here is the script: integer counter = 0; // Counter to track time intervals integer listenHandle; // Handle for the listen event default { state_entry() { llSetText("", <1.0, 1.0, 1.0>, 0.0); } touch_start(integer total_number) { key toucher = llDetectedKey(0); llRequestPermissions(toucher, PERMISSION_ATTACH | PERMISSION_TRIGGER_ANIMATION); } run_time_permissions(integer perm) { if ((perm & PERMISSION_ATTACH) && (perm & PERMISSION_TRIGGER_ANIMATION)) { llAttachToAvatarTemp(ATTACH_RHAND); } else { llSay(0, "Permission to attach and animate denied."); llDie(); // Remove the object if permissions are not granted } } attach(key id) { vector attachPos; vector attachEulerAngles; rotation attachRot; attachPos = <0.0532018, -0.0266000, -0.0113673>; attachEulerAngles = <0.0000000, 90.0000000, 270.0000000>; if (id != NULL_KEY) { attachRot = llEuler2Rot(attachEulerAngles * 0.0174532925); llSetLinkPrimitiveParamsFast(LINK_THIS, [ PRIM_POS_LOCAL, attachPos, PRIM_ROT_LOCAL, attachRot ]); llStartAnimation("holdplus"); llOwnerSay(". ᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓ When you’re done with your drink, Say ‘done’! ᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓ ."); listenHandle = llListen(0, "", id, "done"); llSetTimerEvent(1.0); // Trigger timer every second counter = 0; } else { llStopAnimation("holdplus"); llStopAnimation("sip"); llSetTimerEvent(0.0); llListenRemove(listenHandle); llDie(); } } listen(integer channel, string name, key id, string message) { if (llToLower(message) == "done") { llDetachFromAvatar(); llOwnerSay(". ᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓ Your drink has been collected by the bartender. ᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓ ."); llListenRemove(listenHandle); // Stop listening after detaching llSetTimerEvent(0.0); counter = 0; } } timer() { counter++; if (counter % 15 == 0) { llStartAnimation("sip"); llSleep(7.0); // Duration of the sip animation llStopAnimation("sip"); } if (counter >= 300) { // After 5 minutes (300 seconds), auto-detach the object llDetachFromAvatar(); llOwnerSay(". ᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓ Your drink has been collected by the bartender. ᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓᚓ ."); llListenRemove(listenHandle); // Stop listening after auto-detach llSetTimerEvent(0.0); counter = 0; } } } I'd be happy either resolving the permissions problem with this current version of the script or implementing the Experience model with it.
  10. So yeh. Speedlight was exactly what I was looking for, thanks Clem and Phil! I logged my alt in and his AI connected controller worked perfectly. The only caveat is with his sense of surroundings, he no longers faces the direction of who he is chatting with nor seems able to move to people when asked. Those problems are easy to work around using RLV or keeping him stationary. And Speedlight has RLV which was unexpected. This coulddn't be a btter solotion really.
  11. well ok, some very helpful suggestions for me to investigate, thanks people. Corrade is Linix/Win only I believe, but Speedlight sounds interesting. And thanks for he link to mysmartbots.
  12. Well it does work on a Mac, that was my concern in the prior post. OK, I'll admit, LUA is an unknown to me. I saw some posts recently discussing its use in SL and I was like, Wha? So LUA is new to me but following the link Henri mentions I see that it can be used as an automation tool, so I will need to investigate that. My first question off the top of my head is, "does LUA offer any functionalities not found in LSL"?
  13. OK, thanks for the clarification. I've used the term more broadly to include autonomously operated avatars for lack of a better word. An 'alt' is, generally speaking, just a secondary account, yes? Whether or not it operates with a human controller or not. So if a 'bot' is more of a scripted utility, along the lines of web crawlers etc, then is there a more appropriate term for an avatar that operates independently? In any case, I did check out at Radegast , but a Mac version is not available. I'll check out CoolVL, but I bet I'll run into the same problem. Thanks.
  14. Well, it is a bot, actually, so the object is being worn by an avatar. The object processes the avatar's conversations through an LLM - I'm guessing that's still not sufficient.
  15. Is it possible to script an object to monitor and Owner's Group Notices?
  16. What are the options if you want to run an alt without using a viewer? My alt is stationary and converses using an LLM so there's really little need to use a viewer except to log in or make an occasional outfit adjustment. I read an off-hand remark somewhere where a developer mentioned being able to start up an alt from a web page? I've scoured google but am probably using the wrong terminology for search terms - I really haven't run across any helpful information anyway. I have a Mac, if that makes any difference to what's available.
  17. Thanks, Quistess. The thing is, I find permission events confusing so with the help of your tip I turned to chatGPT and got the following script (along with the addition of an auto-detach object action): default { state_entry() { llSay(0, "STATE"); } on_rez(integer start_param) { llSay(0, "REZ"); // Retrieve the owner key from the description field // Find out which object rezzed us: key rezzer = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_REZZER_KEY]), 0); // Retrieve the target avatar key from the rezzer's description field: key owner_id = (key)llList2Key(llGetObjectDetails(rezzer, [OBJECT_DESC]), 0); llRequestPermissions(owner_id, PERMISSION_TRIGGER_ANIMATION | PERMISSION_ATTACH); llSay(0, (string)owner_id); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION && perm & PERMISSION_ATTACH) { // Play the "hold" animation llStartAnimation("hold"); // Attach to the avatar at the desired attachment point llAttachToAvatarTemp(ATTACH_RHAND); // Start a timer for 300 seconds (5 minutes) llSetTimerEvent(300.0); } else { llSay(0, "RUNTIME"); } } attach(key id) { if (id != NULL_KEY) { // Re-request permissions when attached llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION | PERMISSION_ATTACH); // Start a timer for 300 seconds (5 minutes) llSetTimerEvent(300.0); } else if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { // Stop the animation when the object is detached llStopAnimation("hold"); // Stop the timer when detached llSetTimerEvent(0.0); } } touch_start(integer total_number) { key toucher = llDetectedKey(0); if ((llGetPermissionsKey() == toucher) && (llGetPermissions() & PERMISSION_ATTACH)) { llDetachFromAvatar(); } else { llSay(0, "NOPE"); } } timer() { // Auto-detach the object llDetachFromAvatar(); // Notify the owner llOwnerSay("Your drink was collected by the bartender."); // Stop the timer llSetTimerEvent(0.0); } }
  18. This script, which Qie Niangao helped me write along with ChatPGT, works remarkably well with the exception of the de-attach function, which fails: default { state_entry() { llSay(0, "STATE"); } on_rez(integer start_param) { llSay(0, "REZ"); // Retrieve the owner key from the description field // Find out which object rezzed us: key rezzer = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_REZZER_KEY]), 0); // Retrieve the target avatar key from the rezzer's description field: key owner_id = (key)llList2Key(llGetObjectDetails(rezzer, [OBJECT_DESC]), 0); llRequestPermissions(owner_id, PERMISSION_TRIGGER_ANIMATION|PERMISSION_ATTACH); llSay(0, (string)owner_id); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION && perm & PERMISSION_ATTACH) { // Play the "hold" animation llStartAnimation("hold"); // Attach to the avatar at the desired attachment point llAttachToAvatarTemp(ATTACH_RHAND); } else { llSay(0, "RUNTIME");} } attach(key id) { if ((id == NULL_KEY) && (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) { // Stop the animation when the object is detached llStopAnimation("hold"); } } touch_start(integer total_number) { key toucher = llDetectedKey(0); if ((llGetPermissionsKey() == toucher) && (llGetPermissions() & PERMISSION_ATTACH)) { llDetachFromAvatar(); } else { llSay(0, "NOPE");} } } Not sure where I've gone wrong. Also, if possible, I'd like to add a llGetachFromAvatar() that automatically detaches the item after 300 seconds. Any ideas?
  19. Ah, as it turns out, the attach script does function correctly. It was the inventory item, for some reason unknown, which was causing the problem. So everything is. now operating as it should. YAY!
  20. YOu are right Frionil Fang, the script was misssing something every important. I made the correction, but still, no go. default { state_entry() { // Do nothing here initially } on_rez(integer start_param) { // Retrieve the owner key from the description field // Find out which object rezzed us: key rezzer = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_REZZER_KEY]), 0); // Retrieve the target avatar key from the rezzer's description field: key owner_id = (key)llList2Key(llGetObjectDetails(rezzer, [OBJECT_DESC]), 0); llRequestPermissions(owner_id, PERMISSION_TRIGGER_ANIMATION|PERMISSION_ATTACH); llSay(0, (string)owner_id); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION && perm & PERMISSION_ATTACH) { // Play the "hold" animation llStartAnimation("hold"); // Attach to the avatar at the desired attachment point llAttachToAvatarTemp(ATTACH_RHAND); } } attach(key id) { if ((id == NULL_KEY) && (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) { // Stop the animation when the object is detached llStopAnimation("hold"); } } touch_start(integer total_number) { key toucher = llDetectedKey(0); if ((llGetPermissionsKey() == toucher) && (llGetPermissions() & PERMISSION_ATTACH)) { llDetachFromAvatar(); } // else we'll just ignore the touch } } Th item rezzes but does not attach.
  21. I have a dispensing device attached to an altbot that takes drink orders by chat then, originally, sent the drink to an avatar's inventory. With help from Die Niango we worked to change the action from sending the drink item to an avatar's inventory to attaching the item to the avatar. The re-written dispenser script seems to function as it should: default { state_entry() { } link_message(integer sender_num, integer num, string str, key id) { if (num != -2000) return; if (llSubStringIndex(str, "giveinv ") == 0) { llSay(0, "One shot coming up!"); string item_name = llStringTrim(llGetSubString(str, 7, -1), STRING_TRIM); integer item_type = llGetInventoryType(item_name); if (item_type == INVENTORY_OBJECT) { // Rez the object near the avatar vector rez_pos = llGetPos() + <0, 0, 1>; // Rez 1 meter above the prim rotation rez_rot = llGetRot(); // Set the owner key in a global variable in the rezzed object // string previous_desc = llGetObjectDesc(); llSetObjectDesc((string)id); // Temporarily set the description to the user key llRezObject(item_name, rez_pos, ZERO_VECTOR, rez_rot, 0); // llSetObjectDesc(previous_desc); // Restore the original description } else { llSay(0, "The item is not an object and cannot be attached."); } } } } An attach() script in the inventory item being transfered to the avatar, however, is not working, leaving the item razzed above the dispenser and unattached to the avatar: default { state_entry() { // Do nothing here initially } on_rez(integer start_param) { // Find out which object rezzed us: key rezzer = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_REZZER_KEY]), 0); // Retrieve the target avatar key from the rezzer's description field: key owner_id = (key)llList2Key(llGetObjectDetails(rezzer, [OBJECT_DESC]), 0); llRequestPermissions(owner_id, PERMISSION_TRIGGER_ANIMATION); llSay(0, (string)owner_id); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION && perm & PERMISSION_ATTACH) { // Play the "hold" animation llStartAnimation("hold"); // Attach to the avatar at the desired attachment point llAttachToAvatarTemp(ATTACH_RHAND); } } attach(key id) { if ((id == NULL_KEY) && (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) { // Stop the animation when the object is detached llStopAnimation("hold"); } } touch_start(integer total_number) { key toucher = llDetectedKey(0); if ((llGetPermissionsKey() == toucher) && (llGetPermissions() & PERMISSION_ATTACH)) { llDetachFromAvatar(); } // else we'll just ignore the touch } } The key of the avatar who placed the order does get pasted into the dispenser's description text field. I can't see where or why the above script should fail. Any ideas?
  22. So, this is the attach() script I came up with and it only will razz object but will not attach it. default { state_entry() { } on_rez(integer start_param) { // Retrieve the owner key from the description field // Find out which object rezzed us: key rezzer = llList2Key(llGetObjectDetails(llGetKey(), [OBJECT_REZZER_KEY]), 0); // Retrieve the target avatar key from the rezzer's description field: key owner_id = (key)llList2Key(llGetObjectDetails(rezzer, [OBJECT_DESC]), 0); llRequestPermissions(owner_id, PERMISSION_TRIGGER_ANIMATION); } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION && perm & PERMISSION_ATTACH) { // Play the "hold" animation llStartAnimation("hold"); // Attach to the avatar at the desired attachment point llAttachToAvatarTemp(ATTACH_RHAND); } } attach(key id) { if ((id == NULL_KEY) && (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION)) { // Stop the animation when the object is detached llStopAnimation("hold"); } } touch_start(integer total_number) { key toucher = llDetectedKey(0); if ((llGetPermissionsKey() == toucher) && (llGetPermissions() & PERMISSION_ATTACH)) { llDetachFromAvatar(); } else { llSay(0, "nope");} // else we'll just ignore the touch } } I also inserted the llDetachFromAvatar() action into the script. I will note: the key of the avatar to whom the inventory is suppposed to be transfered to, does get filled properly with that avatar's key.
  23. wow ok you have handed me a whole lot to work with and also noted a problem about rezzing and changing the description correctly - which you are right, doesn't work correctly presently . I will play aorund with this and get back to you @Qie Niangao - thank you.
  24. Just because, I separated the two permission requests into two attach() scripts and, of course, get two dialogues requesting permissions to either animate pose or attach the item and NO error message. Yay! Except the animation does not play. The animation is full perm. So now I'm utterly confused and wonder how anyone gets anything scripted in SL without getting high blood pressure.
×
×
  • Create New...