Page 1 of 1

How to make a beacon

PostPosted: Tue Nov 10, 2009 4:56 pm
by standardtoaster
A beacon is an object that is constantly updating a script such as positions.

Make two boxes, one right next to the other. Make sure that the right box collides with B. Make a circle with a center hinge and place it slightly inside both boxes like so:
Image

To make sure that the beacon can stay together as one object we will make a box behind it and connect everything to it.
Image

In the script of the left box put:
Code: Select all
e.other.collideSet = 2

In the script of the right box put:
Code: Select all
e.other.collideSet = 1


Put your script that you want to be updated constantly in the circle. Now you're done! It's actually very easy to do this. You can also do this with lasers!
Code: Select all
onLaserHit = (e)=>{e.laser.collideSet == 1 ? {e.laser.collideSet = 2} : {e.laser.collideSet == 2 ? {e.laser.collideSet = 1} : {}}}

Make sure that the object that the laser is hitting collides with A and B. You can also use this same laser method to change the collideSet of an object. Just replace all parts that say laser with geom.

Re: How to make a beacon

PostPosted: Sat Nov 21, 2009 3:31 pm
by StephenAlverez
cool, but what kind of script would be updated constantly? oh and i thought this was about making bacon!

Re: How to make a beacon

PostPosted: Sat Nov 21, 2009 5:24 pm
by standardtoaster
:lol: A script that could be updated constantly could be a timer that uses the controllerAcc.
Code: Select all
sim.time - e.this.controllerAcc >= 5 ? {print("true")} : {print("false")}

Get it?

Re: How to make a beacon

PostPosted: Sat Nov 28, 2009 8:16 pm
by StephenAlverez
Thanks again1 :D

Re: How to make a beacon

PostPosted: Sat Nov 28, 2009 8:16 pm
by izacque
or I saw one that constantly updated its angle for some active suspension

Re: How to make a beacon

PostPosted: Wed Dec 16, 2009 7:42 am
by Nait
Hey, what do you thinc
Code: Select all
oncollide=(e)=>{colllideset=3-collideset}

or
Code: Select all
oncollide=(e)=>{colllideset=10-collideset}

Re: How to make a beacon

PostPosted: Wed Dec 16, 2009 8:23 pm
by standardtoaster
The first one is good but I would suggest doing it the way I described above just because it seems easier to read and understand. Which one is easier to understand for you? e.this.collideSet = 2 or e.this.collideSet = 3 - e.this.collideSet? Whichever way is easier for you works. The second one you posted makes it change from A to A and D. :|