Hello everybody !
I've been reading a lot of helpful tips from this forum but i've been looking around for a solution and couldn't find one so i'm asking here for my first thread.
I'm trying to make land vehicles (let's say cars) that are powered by a certain item (fuel), and every 20 steps it consumes of these items.
How can i do something like this with events ?
Thanks !
If you want to do it purely with events, make a parallel process on the map with the following contents:
Control Variables: [varid] = Steps
Control Variables: [varid] %= 20
Conditional Branch: Variable [varid] == 0
Change Items: [Fuel] - 1
: Branch End
Obviously you would want to have a switch activated to make sure the event only runs when in a car, and a check for whether the player has no fuel left and do something with that, but this is your basic event for it.
Essentially you're getting the number of steps, dividing it by 20 and checking the result. If it's 0, we know that the number of steps the player has taken is a multiple of 20, so we need to remove a fuel.
(edited with RPG Maker VX Ace event command syntax)
Ok thank you guys, the fuel system is pretty much functionnal, now i'm still confused how to check if the character is in a vehicle (Considering i'm using Victor Engine Custom Vehicles)
You can use a switch for that.
Is there a script command for it? I can't check the script because my work network blocks Google Drive.
I've read multiple times the script header to make my vehicles but there is no script command and since the vehicles are not controlled by events on the map, i have no idea where to control my switch.
Should i ask the scripter who made it ?
I'm not sure how forthcoming Victor would be in helping with something like this but you could try. Can you paste the script code here so I can read it?
True ! Even with a functionnal step counter, it doesn't count the steps when the player is in a vehicle (normal vehicles or victor custom vehicles)
EDIT: Ok with your script i can count the steps even in a vehicle or custom vehicle but i still have no idea how to check if the player is in a custom vehicle.
Sorry Andar, that's my bad for asking, should have asked for it in a PM. I couldn't use the link because it just goes to Google Drive, which I can't access. I'll keep that in mind next time though.
I tried this condition and it doesn't work with normal or custom vehicles.
Ok it's working now, i did not try using !$game_player.normal_walk? after i installed your script, my bad.
Thanks alot for your help !
EDIT: One last question, how can i block the access to the vehicle if the player doesn't have fuel ?
EDIT 2 : I added a new condition check for the FUEL item and the !$game_player.normal_walk? in the parallel process that makes the player exit the vehicle.
Yeah, no problem. Good luck with your project! 👋