Author Topic: Event BrickDetection V1.2  (Read 3398 times)

Have you ever wanted to activate an event based on whether there is a brick next to another brick?
Now you can!

Introducing Brick detection:
works a like onRelay but fires based on whether there is a brick in that direction.

Overview:

input events:
onDetect:
occurs when this brick fires detectDirection and a brick is found

onNotDetect:
same as above except no brick was found

onDetected:
fires when another brick hits this one with a detect event

output events:
detectDirection [direction] [(new)distance]
fires a ray in that direction and can fire the input events above.



v1.1
minor bug fixed where if the center of an adjecent brick were not directly in the direction requested of the center of the brick firing the detectDirection event.

v1.2
distance option added by request.
every brick between distance and the brick firing the detect even have the onDetected event fired.

now for the file...

https://sites.google.com/site/zmasterfun/event_Brickdetect.zip?attredirects=0&d=1
« Last Edit: May 12, 2012, 07:49:54 PM by zmaster »

« Last Edit: May 12, 2012, 05:57:01 PM by MARBLE MAN »

You should add an integer box for range.


seems like it would be useful for large starship builds....for things like sensors.
Warning - while you were typing a new reply has been posted. You may wish to review your post.
>:O

Would work well with the creeper mod.
creeper gets to a certain point, an alarm goes off.

You should add an integer box for range.

Oh the irony, I had copied a function from another script I made and removed the range option.
If you want it i'll just put it back

Oh the irony, I had copied a function from another script I made and removed the range option.
If you want it i'll just put it back

Its your mod, so it's your choice of course.

For the input event, is there like DetectedBrick or something?

i.e. onDetect > DetectedBrick > setColor

For the input event, is there like DetectedBrick or something?

i.e. onDetect > DetectedBrick > setColor
i was coming in here to suggest this and also a target on onDetected for the brick that detected it

For the input event, is there like DetectedBrick or something?

i.e. onDetect > DetectedBrick > setColor
Ok, this could be quite useful, I'll put that in V1.3


hm
seems useful
I just don't know how I could use it

For the input event, is there like DetectedBrick or something?

i.e. onDetect > DetectedBrick > setColor
I told him that while he was making V1.2 :P

I told him that while he was making V1.2 :P

Congratulations