Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

6 Neutral

About GManB

  • Rank
    Advanced Member
  1. Thanks KT. I've got the model in my head now. Should be able to make faster progress. Code works as expected. Cheers, G
  2. I have not programmed in a completely event driven model as scripting here seems to be. Thus, a newbie question, I am sure. Where do I put a long running loop? It seems from some testing that if I put a loop based on a global conditional in state_entry (in either the default or my own state) as long as the loop is running the event that generated entry into state_entry does not complete. And, no other event in that state, such as touch_start, will be triggered. Is this correct? The model I seem to be building in my head is that there is a single, global event queue per script. When an event comes off the queue it goes to the current state the script is in. There it causes execution of its associated event handler. While that event handler is executing no other event will come off the queue. When, and only when, that event handler completes will the next, if there is one, event come off the queue. Is that model about right? Thanks, G
  3. GManB

    Axes Swapped: Maya-->SL

    Just posting my experience. In addition to setting Z-axis up in preferences I needed to do two additional things: Rotate the object *back* to upright by setting x rotation to 90 setting Z-axis up in prefs caused a 90 degree rotation around x-axis Freeze the transformations so the x rotation was again zero After those three things then exporting to collada and importing to SL everything was okie dokie! G
  4. I'd like pointers to docs or code examples describing the best practices for objects communicating with one another. In my specific case there will be three objects, two of which are linked into a muti-link object. The root prim of the multi-link will be the master that will orchestrate and drive the dialog menus for user interaction. The child prim of the multi-link will hold avsitter 2 and all the anims for this object. Thanks in Advance! G
  5. Ah, I have seen similar in objects I own. There is an automatic section that mostly works and a manual section that always works. As you say then, instruct the user to do the manual operation if things go wrong. Looked through all the events today. It's a shame that the behavior of moving_start and moving_end were defined for moves by the build tool... sighs... G
  6. But, excuse my ignorance, what action correlates to an object being moved by the build tool? I don't see any. Certainly, an agent could rez the swing and move it into position without any av ever sitting on it. (IMHO) A compromise solution is to make the alignment of the swing and frame, post initial rez, completely user controlled. Provide an 'Align' option in the dialog for both the frame and swing. User can then move either the frame or the swing independently and then bring up the dialog from either and select 'Align' to get them properly positioned. In this way there is the least possible likelihood of unexpected, from the pov of the user, behavior. Clunky, yes, but avoids the situation where user moves either frame or swing and scripts fail to notice and no way to align other than via build tool. Thanks, G
  7. I'd suggest both CHANGED_SELECTED_START and CHANGED_SELECTED_END. With these we could start a high frequency polling loop to check for whatever condition and make appropriate adjustments. In my case I could write a haveIMovedorRotated() function which polled pos and rot at subsecond intervals and make the appropriate alignment between swing and frame as the frame or swing moved/rotated. There must be a better way. I simply cannot bring myself to write a polling loop, with a reasonable frequency, that executes continuously and that may not be needed in even the life of an object. Such a waste of compute resources. Puts on thinking cap..... Thanks, G
  8. Is there no event that can execute with an object goes into and out of Edit mode (from the Pie Menu)?
  9. OK, Thanks Kyrah and Wulfie! Good tricks. I am reasonably satisfied with my ability to have the swing frame rez the swing in the proper position. Now, what do I need to do when the owner 'Edits' either the frame (or swing, but let me figure out the simpler case first) and moves and rotates it where he/she wants it? How do I know when the frame is being moved and/or rotated I looked at the 'changed' event and didn't see that it would tell me. should I have the frame continuously reposition/re-rotate the swing as the owner is changing the position/rotation of the frame I have the feeling that would make moving the frame slow and probably result in some missed messages If not 2 then maybe delete the swing when the edit UI opens have the owner move/rotate the frame w/o swing once edit UI is closed re-rez the swing? Thanks, G
  10. Digging deeper: Considering the swing I am building in the frame object I have put from my inventory the swing object. Here is a screenshot of the contents https://gyazo.com/96131d52c2977a0f5604b881079c29aa I had placed the object named "FooSwingFoo" in the contents from *MY* AV's inventory. When I call llOwnerSay("Swing Key: " + (string)llGetInventoryKey("FooSwingFoo")); from a script in the frame object I get a key, say 'KofFooSwingFooInContents'. No matter how many times I make this call the returned key is the same, KofFooSwingFooInContents. If I call llRezObject("FooSwingFoo", llGetPos() + <0.0,0.0,0.0>, <0.0,0.0,0.0>, <0.0,0.0,0.0,1.0>, 0); I get the multilinked object of the root cube and the swing. When I call llSay(0, "My UUID = " + (string)llGetKey() ); from a script in the root cube, I get KofRezzedRootCube-1, and when I call it from a script in the swing I get a key KofRezzedFooSwingFoo-1. If rez another FooSwingFoo I get two new keys KofRezzedRootCube-2 and KofRezzedFooSwingFoo-2. So, all good and making sense at this point. If I DELETE the object FooSwingFoo from *MY* AV's inventory NOTHING CHANGES. The calls and rezzing of FooSwingFoo that is in the contents of the frame object work just the same. I did not test logging out after deleting FooSwingFoo then logging in... What I can infer is that an object placed in the contents of another object from a users inventory has a unique, stable, (maybe immutable) UUID. And it seems like this is NOT a reference to the object in a user's inventory. When I rez an instance of the object from the contents it then gets an instance UUID (one for the root prim and another for each child prim Again, Thanks Rolig, for getting me going on this path. I believe I understand UUIDs well enough to proceed. Cheers, G
  11. I am a little confused by this thread and llGetInventoryKey((string)name). The description from API page for this function is: Returns a key that is the UUID of the inventory name A comment at the bottom of the page states: The UUID returned is that of the asset to which the inventory item points, it is not the UUID of the inventory item itself. The assets themselves are immutable (they never change, they are only ever created and deleted); this allows multiple inventory handles to refer to the same asset without having to duplicate the asset. When it appears an asset is being modified, it is saved as a new asset. The consequence of this is that multiple copies of items in inventory all share the same asset UUID. I have tested llGIK and it seems to work as specified. What am I missing? Also, can I find the UUID of a rezzed object from the UI? Thanks, G
  12. Ha ha... what fun moving the swing parts around! Starting to get the hang of positions and rotations! Finally! Somewhat more complicated with this swing because when I imported it from Maya I didn't sway the y and z axes so I have to mentally do the swap and fiddle with the proper element in the pos vector and the rotation. Once I get things settled I'll swap the axes in Maya before exporting. Cheers, G
  13. A great start! Thanks Rolig! Ah ha.. .just tested the script and I see that the frame aligns itself with the swing... I'll probably want to do the opposite. Have the new owner rez the frame somewhere they want then have the script pull the swing out of the inventory of the frame, rez it, and position it. Thanks, G
  • Create New...