Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Clock Position Help

Dmitriy Gausman
Registered User
Join date: 16 May 2007
Posts: 132
10-03-2007 14:12
I am making my first grandfather clock, and despite the probablly impracticle scripting techniques I used to make it, so far I am happy with the results. But the way I designed it, I have encountered some obstacles in moving the clock once it is rezzed.

There are four components to the clock:
1. The body (1 object, 8 prims)
2. The clock hands and reset box (1 object, 3 prims)
3. The pendulum (1 object, 3 prims)
4. The door - to access the pendulum (1 object, 1 prim)

I have added a follower script to the linked "clock hands and reset box", so by moving the clock to a new position, the hands re-align themselves to the clock face.

I don't think I can add a follower script to the door because upon opening the door, the follower script will attempt to re-align itself. The same thing happens with the pendulum. In it's off mode, the follower would work fine. But in the swing mode, the follower script also attempts to re-align to it's original position, making it even worse if the pendulum is then stopped in any position other than it's original.

Going into edit mode and using the Shift key to highlight the entire clock works fine, but I am sure other users not familiar with this, will miss one item and it will remain apart from the clock. Then I would be relying on them to move these misplaced objects on their own, and that is not so appealing to me (not I am sure to them).

The reason I don't link the clock hands to the clock body was that the script I used for setting the time and moving the clock hands uses the prim that links the hands for its rotation offset. When I tried to link the entire clock body to this, the clock itself rotated to positions reflecting the angle of the time position. Not good!!! So by keeping them separate and using a follower, I was able to have them function independently, yet stay connected.

Would it make any sense to include a "setup box" that they can rez and touch and it would locate the clock, locate the door and pendulum, and put them in their appropriate places?

I started to write a very detailed instruction notecard, but for those who simply want to buy a clock and not have to read complex instructions for moving it would not be practical. And I also have to take into account that all people in SL have varying knowledge of my native language, so I don't want to further complicate this process with terms they might not be familiar with.

Any ideas on how to approach this would be greatly appreciated.

Dmitriy
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
10-03-2007 14:59
If you don't mind setting the perms on your clock to copy/no transfer, what about having the housing of the clock itself rez the assorted moving parts into the correct positions? The advantage is that it would allow the customer to visually place the clock where it looks best before committing to a certain position and rezzing the other bits. Also, you could probably then eliminate the follower scripts entirely - just have the customer delete the old parts and rez a new set if it's necessary to move the clock.
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
10-03-2007 15:28
Or have the door and pendulum keep track of their status--moving or not, closed or not. Then, if the door is open, close it automatically before calling the follower script. If the pendulum is moving, stop it before calling the follower script.

The way you describe things, this doesn't seem like it would be too hard to incorporate.
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
10-04-2007 05:16
Your two main options are:
1 - Rebuild the clock, paying particular attention to making it link into one complete object to overcome the above problems and also paying attention to making it scriptable.
2 - Develop your scripts until your clock is user-friendly/intuitive/manageable using your own suggestions and the two above (which sounds like a good plan).

Adv. of 1 -
* Easy to use, your customers won't be struck with a book to read on how to set up, maintain and move your clock.
* Reliability, your customers won't be calling on you too often to fix their clock/show them how to move it.

Dis-Adv. of 1 -
* Restrictions on build style, e.g. one prim hands. Your scripts determine the look of some of the components of your clock.
* Scripts may be complicated in order to make certain aspects work (such as calculating the offset position for the hand instead of simply rotating it about the centre of a prim).
* Complete re-design of parts of your clock.

Note on 1 -
Where I said you might be limited to one prim hands, you could look into making a sculpted hand for the clock. This could be more ornate than a hand made of several prims and has the advantage that you could position the centre of the sculpted prim so that it is rotating about it's centre.

Adv. of 2 -
* Keep the work you've already done, simply adding to the scripts or making modifications.
* Easier perhaps. See above when mentioning the calculations involved in offsets and rotations.

Dis-Adv. of 2 -
* As mentioned above, might not be the most reliable solution. Certain aspects such as rezzing from the objects contents could be a problem if used on a parcel where the clock owner is not allowed to rez.
* Not necessarily best practice, when you hit the same problems on a future project you may be tempted to use the same approach. (this point is my opinion and open to discussion, others may see this as the best approach)
* More complicated scripts and/or larger script count resulting in a larger load on the sim (lag).


-- not a complete list, just what I could think of. I have no real conclusion as it's up to you which path you choose. You might be happier with either option for any number of reasons. Please add to the adv and dis-adv if you think of any.
_____________________
www.nandnerd.info
http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum
Dmitriy Gausman
Registered User
Join date: 16 May 2007
Posts: 132
10-04-2007 10:37
Thank you for the replies.

Unfortunately, my knowledge of what I want to script is far below my ability to translate that into the LSL environment, so I have limitiations.

If I give copy permissions, and allow the clock to be fully rezzed after placement, almost like a rez box, I guess that would solve one part of the problem. But unlike a house or rug or something that would most likely stay stationary in it's set position, things on the wall or decorative objects would be far more likely to be adjusted, even by a fraction of a meter, so deleting and e-rezzing might not be as convenient. The more times I allow someone the chance to delete simply to re-position, I fear it will make them fed up to keep the piece on display.

I tried to script a box that can be placed inside the clock that finds the door and pendulum and repositions them all to the clock on touch, but my scripting skills were just not sufficient and was only able to get llSensor to find one thing. I figure I always would know the offset positions of the door and pendulum. It would just be a matter of adapting the follow script to be manual and only target the orphaned unlinked pieces. That is still my ideal resolution.

For now, I might focus on the follow script for the door and pendulum, issuing a stop swing or close door command before the script runs. In my head I am wondering if all that auto sensing and checking the door and swing is not efficient as there is nothing to follow when the clock is in the fixed position most of the time.

I am simply suffering from the lack of knowledge lagging behind my idea. And it is the cause of my lack of sleep :-)))))


Dmitriy
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
10-04-2007 12:43
it is possible to easily script prim clock hands by rotation, no messy math involved... the same for the pendullum....

create shape: sphere, dimple start .49 end .51
change shape to box, path cut begin, .125, end .625

flat shape, perfect for texture, rotates from end...
also good for armature

you can even reuse the shape for the weights, as this can keep a steady attachment point, and still grow/shrink on the other end (to simulate rising falling weights) but will change the size of the texture slightly unless you correct for it
Dmitriy Gausman
Registered User
Join date: 16 May 2007
Posts: 132
10-16-2007 20:00
Well, still stumped on this one. The clock and hands all move and rotate together perfectly. But the door and the pendulum - no such luck.

The door is one prim so my thoughts were to get some follower language into the door script itself. But that doesn't seem to want to cooperate as the door on touch gets rotated out of alignment on a normal open and close.

The pendulum is more compicated. It is a linked 3 prim object, with the swing script inside the root prim. Here again, it's not easy to get a follower script embedded due to the significant rotation.

It seems like too many parts have to have different followers just for the clock to stay together.

I thought maybe I would make a little box that the customer can rez upon moving, and by clicking on that, it would find all the pieces and move them into proper place. But that too becomes complicated, requiring a rezz each time they move the clock.

While I could replace the door with a fixed prim, that would require a different way to turn the pendulum on and also moving the clock time set box.

I could go with a 1 prim pendulum (not nearly as nice looking) and have that temp rezz.

Are these efforts too complicated just to make the clock parts move? Or, this being beyond my capabilities, maybe it is time to find someone else to script those parts.

Ready to throw in the towel.....:-)
Dmitriy
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-16-2007 20:15
From: Dmitriy Gausman

Are these efforts too complicated just to make the clock parts move? Or, this being beyond my capabilities, maybe it is time to find someone else to script those parts.

Ready to throw in the towel.....:-)
Dmitriy


Dmitriy,Dmitriy,Dmitriy......... You are doing great. Due to limitations of LSL, clock making is right up there with weapons as far as difficulty.

Try physically rotating the door using edit, 90 degrees at a time and try it, without it being mounted on the clock. Once it is right then mount it or look here:

/54/1c/215026/1.html

The same goes for the pendulum, don't worry about mounting it yet. Just get it working correctly 1st. I wouldn't be the first person to ask on getting it to swing by scripting. An alternative could be making 2 identicle pendulums, one for each extreme of the swing and making them alternately show/hide on a timer?
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Dmitriy Gausman
Registered User
Join date: 16 May 2007
Posts: 132
10-16-2007 22:21
Thank you Jesse. The door and pendulum work fine. The problem I am having is that the door and pendulum assembly are not linked to the clock. Couldn't use the standard follower script I am using for the clock hands because the constant swinging and door opening/closing conflicts with the follower script.

I can select the entire clock by opening an edit window, then holding the Shft key and dragging to highlight the clock. But I don't feel comfortable asking the customer to do this. It's not always easy to grab all the pieces.

I think for now I will simply have them open the door, stop the pendulum, select the clock, the door and the pendulum - and move the whole thing. Once it's in a good position, turn on the pendulum and close the door.

Ideally I would love to have everything move without asking them to highlight parts, but its not so unusual to do in SL, especially with houses, so for now it can work like this. Version 2 can be scripted differently.

I feel better now making a decision. :-))))

Dmitriy