Minecart Plugin!
Actually managed to piece together a plugin for a minecart! Checkout my plugin thread for playable demo and download.
Original Post
I've thrown together a simple "Mine cart" mini-game and wanted to share with the forums for suggestions/feedback and possibly some help in creating a plugin for it.
Here is a demo video:
https://drive.google.com/open?id=0B8xGgxim_gkbcUZPSUg2ZlQ1bmc
In the video I've thrown the switch at the start turning off battles. If I leave the switch alone the enemies moving onto the track will result in a battle if I run into them.
At first I ran off the track because I didn't press the correct key. In the second pass I made it to the finish.
This game currently uses only events and some inline scripting. I would love to offload some code into a plugin but my biggest challenge is I have no idea how to perform a setMoveRoute in js. Using $gamePlayer.moveForward() and the like is no good as I'm running a loop and it will just cause the player to immediately appear at the end location of the loop instead of animating it.
A brief explanation of what I've done:
Entering the mine cart will trigger the "Minecart Ride" common event which runs a big loop forcing my player to always be moving (with the appearance of a mine cart).
To appear as a mine cart I've simply removed the characters from my party and added 4 mine cart actors.I have an exit and enter mine cart common event for this function.
Whenever the mine cart encounters a corner the player has to already be pressing the directional keys in the correct direction or it will crash (game over).
When the mine cart hits a branch (two paths) the player has to pick one direction or the other, no direction will result in a crash.I modified the base game dungeon tileset to create a branching left/right track.
The enemies on the side will step onto the track and off. If the player runs over the enemy tile it will detect and process a battle event. To do this I've added an event handler to the Minecart Ride which checks if an event is in the way. If the Orc event gets in the way then the Minecart Ride process will end, the party will exit the cart and a battle will occur (Orc common event). After the battle the player gets back in the cart and continues the Minecart Ride event. This all happens without visibly witnessing the player exit the cart but is necessary to ensure the battle occurs with the correct actors.
To ensure the cart doesn't go off the track I've set the passage 4-way options on the tileset to reflect the track direction.
When track is branching I've used a terrain tag of 1 to identify the track and 0 is anything else. I run a "Check Sides" common event to determine which way I can go (only options are left/right for branching track currently).
There is very little scripting going on in this game at the moment. I have no plans to turn it into a full game as it is just meant to be a tech demo.
If anyone would like to help me convert it to a plugin I would appreciate the help.
I'd like to hold off sharing the game until it is in plugin format (except with those who'd like to help make it into a plugin), as I want it to be easy to implement.
As mentioned earlier, I know how to make a plugin but I don't know how to implement a setMoveRoute which I think is required to ensure proper movement during the loop. I'd like to offload as much functionality as possible into a plugin to create an easy to use API for others to implement a mine cart mini-game.
One idea I had to make the mini-game more interesting would be to utilize the space key as a brake to slow down. This would allow players to 'time' passage between enemies and hopefully avoid battle as right now there isn't much control over whether you encounter an enemy or not.
Anyways, hit me up if you wanna help out with the mini-game!
I'd also be interested in hearing suggestions for features to add.
Update:
Update: Worked on it all night. Figured out how to extend the game code to include a proper 'minecart' vehicle. This offloaded a ton of code because now it uses the built-in features. I basically copied 'boat' but changed the bgm, image and passability settings.
I offloaded most of the event code into a plugin. I couldn't figure out how to do moveroute in code so I set it to check the direction and inputs and 'turn' instead of move. In the editor event code I run a loop with step forward to always keep the cart moving. This actually gives the user more control since they can throw extra code into the loop.
I provide an event checker function to see if the cart runs over an event and the plugin sets a switch to tell the user if it hit it or not. The switch id is passed to the plugin so you can set it up to use any switch. The user can run whatever process they want if the event is hit by checking the switch. I used it to setup battles with moving events (Orcs).
Lastly, I implemented the brake so players can try to dodge enemies by slowing down.
Actually managed to piece together a plugin for a minecart! Checkout my plugin thread for playable demo and download.
Original Post
I've thrown together a simple "Mine cart" mini-game and wanted to share with the forums for suggestions/feedback and possibly some help in creating a plugin for it.
Here is a demo video:
https://drive.google.com/open?id=0B8xGgxim_gkbcUZPSUg2ZlQ1bmc
In the video I've thrown the switch at the start turning off battles. If I leave the switch alone the enemies moving onto the track will result in a battle if I run into them.
At first I ran off the track because I didn't press the correct key. In the second pass I made it to the finish.
This game currently uses only events and some inline scripting. I would love to offload some code into a plugin but my biggest challenge is I have no idea how to perform a setMoveRoute in js. Using $gamePlayer.moveForward() and the like is no good as I'm running a loop and it will just cause the player to immediately appear at the end location of the loop instead of animating it.
A brief explanation of what I've done:
Entering the mine cart will trigger the "Minecart Ride" common event which runs a big loop forcing my player to always be moving (with the appearance of a mine cart).
To appear as a mine cart I've simply removed the characters from my party and added 4 mine cart actors.I have an exit and enter mine cart common event for this function.
Whenever the mine cart encounters a corner the player has to already be pressing the directional keys in the correct direction or it will crash (game over).
When the mine cart hits a branch (two paths) the player has to pick one direction or the other, no direction will result in a crash.I modified the base game dungeon tileset to create a branching left/right track.
The enemies on the side will step onto the track and off. If the player runs over the enemy tile it will detect and process a battle event. To do this I've added an event handler to the Minecart Ride which checks if an event is in the way. If the Orc event gets in the way then the Minecart Ride process will end, the party will exit the cart and a battle will occur (Orc common event). After the battle the player gets back in the cart and continues the Minecart Ride event. This all happens without visibly witnessing the player exit the cart but is necessary to ensure the battle occurs with the correct actors.
To ensure the cart doesn't go off the track I've set the passage 4-way options on the tileset to reflect the track direction.
When track is branching I've used a terrain tag of 1 to identify the track and 0 is anything else. I run a "Check Sides" common event to determine which way I can go (only options are left/right for branching track currently).
There is very little scripting going on in this game at the moment. I have no plans to turn it into a full game as it is just meant to be a tech demo.
If anyone would like to help me convert it to a plugin I would appreciate the help.
I'd like to hold off sharing the game until it is in plugin format (except with those who'd like to help make it into a plugin), as I want it to be easy to implement.
As mentioned earlier, I know how to make a plugin but I don't know how to implement a setMoveRoute which I think is required to ensure proper movement during the loop. I'd like to offload as much functionality as possible into a plugin to create an easy to use API for others to implement a mine cart mini-game.
One idea I had to make the mini-game more interesting would be to utilize the space key as a brake to slow down. This would allow players to 'time' passage between enemies and hopefully avoid battle as right now there isn't much control over whether you encounter an enemy or not.
Anyways, hit me up if you wanna help out with the mini-game!
I'd also be interested in hearing suggestions for features to add.
Update:
Update: Worked on it all night. Figured out how to extend the game code to include a proper 'minecart' vehicle. This offloaded a ton of code because now it uses the built-in features. I basically copied 'boat' but changed the bgm, image and passability settings.
I offloaded most of the event code into a plugin. I couldn't figure out how to do moveroute in code so I set it to check the direction and inputs and 'turn' instead of move. In the editor event code I run a loop with step forward to always keep the cart moving. This actually gives the user more control since they can throw extra code into the loop.
I provide an event checker function to see if the cart runs over an event and the plugin sets a switch to tell the user if it hit it or not. The switch id is passed to the plugin so you can set it up to use any switch. The user can run whatever process they want if the event is hit by checking the switch. I used it to setup battles with moving events (Orcs).
Lastly, I implemented the brake so players can try to dodge enemies by slowing down.