Lua RPM meter

mrsimb - Custom level - from Windows
PlayEdit4 players liked this.Log in to like this level.

For @MARRA92

Returns absolute value of round per minute (no matter in which direction).

Timer delay only affects how often rpm will be calculated.
You can watch rpm of as many objects as you want, by creating new RPMmeters.

Views: 347 Downloads: 141 Unique objects: 1 Total objects: 9

Discuss this level

Log in to comment on this level.
  • MARRA92: @mrsimb: surely yes, actually the reverse going of opponents is baddest issue i have, i though to put absorber to let "crashing" cars to be deleted, but iz funnier with more guys on track , anyway very thanx for the helpp i really appreciate and great chances for me to learn
  • mrsimb: @MARRA92: i think watching waypoints would be more accurate, and will prevent player to ride in wrong direction.
  • MARRA92: @mrsimb: thanx, here the level i made in past i'm tryng replicate its functions since i think they worked good ( but maube can be improved ) http://principiagame.com/level/21386
  • MARRA92: @mrsimb: bout tha track i was lookin for id field to use it to thick and reset a lap timer that golden made for one my old race track level, car passes on it thick, few cm after theres second sensor tha reset timer for curretn lap
  • mrsimb: @MARRA92: ok, i'll make example for you later
  • MARRA92: @mrsimb: i am total noob on LUa, for it i need help from you expert players like bob, golde, doublebad hxctcreations, and many other
  • MARRA92: @mrsimb: okay, i tryed put this on my motor, the reading are correct, max rpm is around 1040-1050, also the total thic counter i setted up to test read total 1040-50 rpm done after 1 minute
  • mrsimb: @MARRA92: you can create waypoints on the track, and calculate when your car is near.
    so each step for each car:
    - you loop trough all waypoints
    - check if car near waypoint
    - if that is next waypoint, increase car loop progress
    - when car reaches last waypoint, increment loops variable

    you can make waypoints by adding wall motors and getting their id's into one array

    then you can compare each car's progress, and determine which is first, second, etc.
  • mrsimb: @MARRA92: i tried that, but it seems like treshold change of ang. vel. meter is not linear. then i came up with that method, which i think is more reasonable.
  • mrsimb: @Golden: i know, i left that choice to user. but i think it's better make that by default.
  • MARRA92: @Golden: Golden can you create ID and Object fields using LUA like they did for the proxsensor? i need one of them to count laps on my racetrack, but trakc too large for default robotics
  • MARRA92: @mrsimb: another idea i got is to find out how many rotations/second is when ang vel meter its at his max reading ( 90.0 threesold), and convert it to a display, where when angvelmeter outputs 1,0 equals to X rpm
  • Golden: game:message("Rounds Per Minute: ".. math.abs(rounds))
  • Golden: @mrsimb: to get positive number, use math.abs()
  • MARRA92: intresting
  • mrsimb: apparently, entity:get_angular_velocity() makes no sense to me.
  • mrsimb: @MARRA92

LEVEL ID: 25134