How to make a beacon

Post your tutorials here.

How to make a beacon

Postby standardtoaster » Tue Nov 10, 2009 4:56 pm

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.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: How to make a beacon

Postby StephenAlverez » Sat Nov 21, 2009 3:31 pm

cool, but what kind of script would be updated constantly? oh and i thought this was about making bacon!
I am Alpha and Omega, the beggining and the end.

Image
User avatar
StephenAlverez
 
Posts: 164
Joined: Wed Sep 30, 2009 2:46 am
Location: Vermont

Re: How to make a beacon

Postby standardtoaster » Sat Nov 21, 2009 5:24 pm

: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?
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: How to make a beacon

Postby StephenAlverez » Sat Nov 28, 2009 8:16 pm

Thanks again1 :D
I am Alpha and Omega, the beggining and the end.

Image
User avatar
StephenAlverez
 
Posts: 164
Joined: Wed Sep 30, 2009 2:46 am
Location: Vermont

Re: How to make a beacon

Postby izacque » Sat Nov 28, 2009 8:16 pm

or I saw one that constantly updated its angle for some active suspension
[/post]
Paradigm 29 wrote:I've been trying to figure out why people even buy hummers ever since I found out that they don't have machine guns.
User avatar
izacque
 
Posts: 483
Joined: Mon Sep 14, 2009 11:14 am

Re: How to make a beacon

Postby Nait » Wed Dec 16, 2009 7:42 am

Hey, what do you thinc
Code: Select all
oncollide=(e)=>{colllideset=3-collideset}

or
Code: Select all
oncollide=(e)=>{colllideset=10-collideset}
User avatar
Nait
 
Posts: 224
Joined: Fri Oct 30, 2009 1:56 am
Location: Eastern Russia, Vladivostok

Re: How to make a beacon

Postby standardtoaster » Wed Dec 16, 2009 8:23 pm

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. :|
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron