Jump to content

Touch and pay with action script


WESTCAT
 Share

You are about to reply to a thread that has been inactive for 2295 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi there just looking for a simple [I think] Script that would do the following;

1- it would, when paid a mandatory tip of a fixed amount, cause 

two  rotation scripts to start for a statue.

Basically the pedestal turns while the statue lying horizontally  roles back and forth. 

Basically just two rolling scripts activate for a period of time like 15 seconds for 5$L

I already have the rotation script, everybody has that one.  put how do you pair the tip deal

to a reward action? The statue is parented to the base

 

kinda like a tip script 

Link to comment
Share on other sites

5 minutes ago, WESTCAT said:

kinda like a tip script 

Kinda exactly.

All you have to do is put the statements to start your rotations in the money event of your tip jar script (triggered as the script receives payment).  Start a timer at that point.  When the timer event triggers, turn the rotations off.

  • Thanks 1
Link to comment
Share on other sites

Right just wondering how that would look for SL script, also like I was asking is it possible to rotate an object along a path? 

Something like this guy :D:D  https://www.kohls.com/product/prd-2650422/star-wars-episode-vii-the-force-awakens-deluxe-bb-8-18-big-figs-figure.jsp?ci_mcc=ci&utm_campaign=TOYS&utm_medium=CSE&utm_source=google&utm_product=61555120&CID=shopping15&utm_campaignid=196835972&gclid=EAIaIQobChMIsefno8D-1wIVCTBpCh2PSAnKEAQYAiABEgJBJfD_BwE&gclsrc=aw.ds&dclid=CLW1habA_tcCFVUyaQodyPYBbg

rez a ball start it rotating then have it follow a path?  NO right !? 

 

 

Edited by WESTCAT
Link to comment
Share on other sites

That's not a particularly easy thing to do with a script.  The simplest solution would be to simply make your object physical and give it a shove.  Getting it to follow a specific path while it rolls along is a mathematical challenge, of course. The way around it, again, is to avoid using a script and put it in a trough or a track of some kind instead.  The point is that non-physical objects do not roll, and simulated rolling always looks goofy if the thing is following anything more complicated than a straight line. If you are not an accomplished scripter with a love for the math, I suggest taking the easy route.

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
On 12/11/2017 at 9:21 AM, Rhonda Huntress said:

BB8 is easier to do if you only mimic the ball rolling.  In other words, roll the texture, not the ball.

Is that something like Alpha shifting that they do in some statues to make it look like they are moving?  It is a fake form of animation.  I was warned to stay away from it, as it can gum up the viewer if you have too complicated or too many playing at once?  They are basically to my understanding three or more poses in sequence where the alpha or texture is turned on and off?  

Link to comment
Share on other sites

No, it's not alpha switching at all. It's simply moving a texture across the face(s) of a prim with llSetTextureAnim.  Your texture might be a multi-framed image, in which case you can get a sort of slide show as frames move across the faces, or you can apply a smooth translation, rotation, or scale change to make a continuous movement of a single- or multi-framed texture.  Done carefully, you could indeed make a ball appear to be rolling even if it is stationary.  Texture animation is all client side, so it has no effect on server performance.

In your case, since you do intend to have the ball move, I still think it's most practical to make it physical and give it a shove. The only thing you need to be wary of is creating firm enough barriers to keep the rolling ball on the path you have chosen. If the ball is actually rolling down the pathway, it will look a lot more natural than anything you can simulate by animating a texture or trying to rotate the ball with a script.

Edited by Rolig Loon
  • Like 1
Link to comment
Share on other sites

10 minutes ago, Rolig Loon said:

No, it's not alpha switching at all. It's simply moving a texture across the face(s) of a prim with llSetTextureAnim.  Your texture might be a multi-framed image, in which case you can get a sort of slide show as frames move across the faces, or you can apply a smooth translation, rotation, or scale change to make a continuous movement of a single- or multi-framed texture.  Done carefully, you could indeed make a ball appear to be rolling even if it is stationary.  Texture animation is all client side, so it has no effect on server performance.

In your case, since you do intend to have the ball move, I still think it's most practical to make it physical and give it a shove. The only thing you need to be wary of is creating firm enough barriers to keep the rolling ball on the path you have chosen. If the ball is actually rolling down the pathway, it will look a lot more natural than anything you can simulate by animating a texture or trying to rotate the ball with a script.

So I have a ball say a soccer ball and I give it the basic rubber physics, default right, then I fabricate a long prim trough take two basic block prims make them into a v shaped trough Then put the ball in it, give it a shove then it should roll to the end, where I can put a rubber physics wall right and it should bounce or roll back to the other end of the trough where there is another rubber wall and bingo, depending on the length of the trough this could go back and forth a couple of times? 

Link to comment
Share on other sites

Forget "rubber".  That's merely an attribute that tells the object how "hard" or "soft" any collisions may be. It does moderate how elastic a collision will be, but you shouldn't expect the ball to behave like a RL tennis ball.  Making the ball Physical (with the check box/button on the Object page of your editor) determines whether it responds to gravity and to collisions with other objects.  That's what you want. Unless the ball is physical, it will just sit there instead of rolling downhill.

Now, if you want the ball to roll down the hill or track repeatedly, the way to do it is to kill the ball when it reaches the bottom and then rez a new one at the top when you are ready. Entropy and friction are alive and well in SL, although not always as well-behaved as in RL, so you can't make a physical object keep moving forever without giving it a new push now and then. You could make a pinball machine do that -- giving the ball a little impulse each time it hits a bumper or a flipper -- but if the ball is just hitting a static wall at the bottom of a hill and bouncing off, there's no way that it will have enough energy to bounce back to the top of the hill again.

  • Like 1
Link to comment
Share on other sites

3 minutes ago, Rolig Loon said:

Forget "rubber".  That's merely an attribute that tells the object how "hard" or "soft" any collisions may be. It does moderate how elastic a collision will be, but you shouldn't expect the ball to behave like a RL tennis ball.  Making the ball Physical (with the check box/button on the Object page of your editor) determines whether it responds to gravity and to collisions with other objects.  That's what you want. Unless the ball is physical, it will just sit there instead of rolling downhill.

Now, if you want the ball to roll down the hill or track repeatedly, the way to do it is to kill the ball when it reaches the bottom and then rez a new one at the top when you are ready. Entropy and friction are alive and well in SL, although not always as well-behaved as in RL, so you can't make a physical object keep moving forever without giving it a new push now and then. You could make a pinball machine do that -- giving the ball a little impulse each time it hits a bumper or a flipper -- but if the ball is just hitting a static wall at the bottom of a hill and bouncing off, there's no way that it will have enough energy to bounce back to the top of the hill again.

Thank you again

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2295 days.

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
 Share

×
×
  • Create New...