How to make something happen every 500 steps

I'm trying to set it up where every 500 steps my character will trigger a event will do a random roll between 1 and 100 where the player will find an item or nothing

I put the wrong area I meant to put this under VX Ace
People would have an easier time helping you if you showed a screenshot of the event 🙂
Are you asking how to do this, or have you tried and it's not working in some way?

EDIT

On your random roll, are you saying that it will be one chance in 100?  That will be so rare as to effectively mean almost never.  I personally would suggest a lower number, and perhaps have different items.  For example, a 1 in 10 chance that it will be a small healing items, a 1 in 20 chance that it will be a larger healing item, that sort of thing.
I've never uploaded an image on this site before

test.JPG
EDIT

I think this is preferable, though I haven't had time to test it to make sure I've got all the bits and pieces in correctly.  What I have done (I hope) is a common event set to parallel process and triggered by a switch you turn on when you want this feature to begin.

First I set a variable switch to count the number of steps the player takes.

Then, when that count reaches 500 or more, the random roll is carried out.  I have put it to 500 or more just in case the 'wait' means that the player takes 501 steps.

The random roll is set to 1-20.

There are 2 chances to get a small healing drink (= 1 in 10)

There is 1 chance to get a medium healing drink (= 1 in 20)

Therefore there are 17 chances that the player gets nothing.

After the item has been allocated, or not, the step counter is returned to zero.

The 'wait' is because you do not need this to run 60 times a second, and so a wait will reduce the chance of lag.

Image in the spoiler

Spoiler
Item%20common%20event_zpspttxt64e.png
found a new problem the steps will not reset so it keeps doing the role

not really a new problem it the same problem
I don't have Ace open and cannot test, but try adding the reset step counter variable command to the line immediately following each 'change item' command.
didnt read all, but would this help?

Variable1 = Steps

Variable1 / 50 (Its nice that rpg maker just cuts every number behind the komma so 49 / 50  = 0,??? and results in 0. )

if Variable1 more than Variable2

set variable2  = variable1

insert your randome stuff code here

else

nothing

end

Thisway the Command is executed every 50Steps. The / sign is devidition. 6 / 3 = 2
now I'm looking at the scripting side of the game i cannot find anything related to step counter

god this sucks
didnt read all, but would this help?

Variable1 = Steps

Variable1 / 50 (Its nice that rpg maker just cuts every number behind the komma so 49 / 50  = 0,??? and results in 0. )

if Variable1 more than Variable2

set variable2  = variable1

insert your randome stuff code here

else

nothing

end

Thisway the Command is executed every 50Steps. The / sign is devidition. 6 / 3 = 2
sorry for the double post but I didn't see this guys 

I'm just telling you I have tried that already
kitsune121x, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.

If you want to add something simply click the Edit button (bottom right, near the MultiQuote button) and add it to your last post.

Can you confirm:

did you change your event from what you started with to the common event?

did you make the alteration to the reset variable command that I suggested in my last post?

Have you checked all your custom scripts to be sure that none of the variables you have chosen are already in use by one of those scripts?

Can we see a screen shot of your event as it now is.
here you go

I'm not using custom scripts

test.JPG
sorry for the double post but I didn't see this guys 

I'm just telling you I have tried that already
But as Eventcommands the Code i posted should Work. Very Strange.

Edit: Ah a Picture, the Code in it is just executed  when you have 50or more Steps, than its always True and will be executed permanently.

Whats not working at the moment with your code?

Try the Code i posted.
But as Eventcommands the Code i posted should Work. Very Strange.

Edit: Ah a Picture, the Code in it is just executed  when you have 50or more Steps, than its always True and will be executed permanently.

Whats not working at the moment with your code?

Try the Code i posted.
can you give me a screenshot on how that works sorry I'm an idiot
You did not put the command to change the variable for the steps back to zero after each allocation of an item, as I said you should.

I'll post a revised screen shot in a minute or two.

EDIT

Here it is.  the purpose of the repeated command is so that every possible branch of the conditional ends with a command to reset the variable.

Spoiler
Item%20common%20event_zpsg96l72ea.png
I'm sorry if I'm giving you guys a hard time but I still haven't solved the problem

here's the problem in more detail if I add text anywhere spams it back at me

the program is seriously addictive but this problem will have to wait I need to sleep

thank you for trying to help me

test.JPG

test2.JPG
What is variable 2, and what is it doing?  You seem to have complicated things enormously, and I suspect that is where the error has crept in.

Try and describe in words why you think you're doing in that event.
the variable 2 it's for rolling for the item and variable 1  for the steps

I tried resetting both variables individually it didn't work doing both of them at the same time doesn't work I still get the text spam
Resetting variable 1 won't do anything, because the first line of the script changes it to the total number of steps taken.
 
In the command for changing variables, there's that one operator that no one ever talks about because it's so complicated. Well, this is exactly the sort of situation where you need it.

"a %= b" divides a by b and stores the remainder in a. So if 'a' is a multiple of 'b', then 'a' will be set to 0. (Things get more complicated if a or b or both are negative, but we don't need to worry about that here.)
 
This is the event I wrote, and it seems to work the way you want:

Spoiler
foragescript1.png

foragescript2.png
Resetting variable 1 won't do anything, because the first line of the script changes it to the total number of steps taken.

In the command for changing variables, there's that one operator that no one ever talks about because it's so complicated. Well, this is exactly the sort of situation where you need it.

"a %= b" divides a by b and stores the remainder in a. So if 'a' is a multiple of 'b', then 'a' will be set to 0. (Things get more complicated if a or b or both are negative, but we don't need to worry about that here.)

This is the event I wrote, and it seems to work the way you want:

now it doesn't do anything at all

I'm going to give up on the 30th post on this topic

I should have an answer by then if not this is impossible to do 

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-something-happen-every-500-steps.44848/