How to require crank turns 360 before firing an event?

Hey folks!

I am working on my first Pulp game, and have a mechanic that requires the player to use the crank to repair broken objects; once the player has collected the items they need, they return to the object and use the crank to repair it. So far so good, but here's the rub:

The the repair event fires as soon as the crank moves! Ideally, I'd like to require the player turns the crank 360 before the repair is made.

I read in the PulpScript documentation that event.aa and event.ra can be used to output the absolute and relative positions of the crank, but am struggling to conceptualize how to get that actually working in my code. Anyone know how to make this happen? Thanks y'all!!

I use this (and don’t remember who made it):

on crank do
crank_angle += event.ra
if crank_angle>=360 then
crank_angle = 0
call “your_event”
end
end

Hope it helps!

1 Like