Beamos Detection

I’m starting to work on my scripting, so I figured making a Beamos would be an easy start, since most of the effort will be wondering why I can’t handle basic math.

Logic wise I assume all I need is a function with a while loop for the turning head that picks up from current angle and rotates clockwise until it picks up the player within its defined radius, then activates the function that fires the beam (which would switch back to the search function upon firing).

I’ll post what I come up with for the detection part in a bit so I can get some feedback. I won’t post the whole script on the forums since I don’t want it turning into the Maloria fishing pole of quests. Instead I’ll put it on the temporary OSL for when I reset Vinland in the next week or so and PM the script by request.

You’ll have two angles. The angle of the Beamos head, and the angle of the player in relation to the Beamos.

if (abs((headangle%(pi2)) - (playerangle%(pi2))) < .5) {//HIT}

Or something like that, I imagine. You’ll also want to do checks at a single tile increment for walls, probably with some exclusion tiles that the beams will travel through.