Step counters

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
WildWoodsmith
Slime
Posts: 6
Joined: Sun Jun 27, 2021 11:15 pm

Step counters

Post by WildWoodsmith »

couldn't find anything on here about this, but what's the best way to do a step counter? Would it be to use "hero is walking" to add to a variable while true?
User avatar
pjbebi
Slime Knight
Posts: 112
Joined: Mon Jul 31, 2017 7:22 am
Location: Florida
Contact:

Re: Step counters

Post by pjbebi »

I'd use a global in the each step script.

Code: Select all

plotscript,eachstep,begin
increment (steps,1)
end
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Re: Step counters

Post by TMC »

Yes, each-step script is the way to go. Don't use a while loop to check "hero is walking", as that would increment every tick the hero is moving, not every step.
BTW, you can set a global each-step script rather than needing to set it on every map.
Post Reply