First, set up the script's constants:
- CMB_MINECART: First of the combos for the minecart. 16 in total in groups of 4 directions: Stationary, Moving, Front Layer, Link riding. See the example combo page for a visual example.
- CS_MINECART: CSet of the minecart.
- CMB_MINECART_TRACK: First of the minecart track combos. These are 7 combos in total going in the order of: Vertical, Horizontal, Corner DR, Corner DL, Corner UR, Corner UL, Exit Pad. See the example combo page for a visual example. These are the only combos the minecart can move on, but you can layer other combos over them with no issue.
- SFX_MINECART: Sound the minecart makes
- MINECART_SFX_FREQ: Frequency of the sound in frames (60ths of a second)
- MINECART_LINKYOFFSET: Link's draw offset from the cart. Should work by default in EZGBZ.
- DAMAGE_MINECART_COLLISION: How much damage the minecart does to enemies it hits.
- LW_MINECART_DAMAGE: The weapon type the minecart uses. LW_BEAM by default. See std_constants.zh under LW_ for more options.
Next you want to combine the minecart global script and scrollingDraws.zh global script with your own. The example global script included already has the scrollingDraws.zh one combined. Then you can start placing down minecart FFCs. Don't forget to set the fast scrolling constant in scrollingDraws.zh if you're using it.
If you're using my pit script, do a search in the script for a line that says:
//MooshPit_ResetEntry();
Remove the // at the start and it will update the pit script to drop Link off where he got off the when the minecart stopped and not inside the shutters. Of course the pit script will also have to be up to date to a version that includes this function for it to work.
GBMinecart_FFC
This is the main FFC script of the bunch. Place it down on a track combo and set its combo to one of the ones in the CMB_MINECART group. Set the Run Script At Screen Init flag on the FFC as well.
Arguments:
- D0: The minecart's starting direction. This tells it which way to start moving when Link hops in. 0 = Up, 1 = Down, 2 = Left, 3 = Right
- D1: The minecart's ID. If this is higher than 0, it will remember which screen it was on when you leave and come back. Otherwise any screen you place a minecart will automatically have one.
- D2: Set this to 1 if this is the starting screen for the minecart.
- D3: This is set by the global script to keep track of if it's an editor placed script or a global placed one. Be sure it's set to 0.
GBMinecart_Shutter
This FFC creates a shutter that opens when Link in a minecart passes through it. Place it over tracks on the edge of the screen and give it the first of two combos. The first combo is of a solid closed shutter. The second is a halfway open shutter. Set the Run Script At Screen Init flag on the FFC.
Arguments: None
GBMinecart_ResetID
This FFC is meant to be placed at your dungeon entrances for resetting minecarts. Put it over the blue entrance square.
Arguments:
- D0-D7: If >0, the minecart at that ID will have its position reset.
Disabling Items:
In order to disable items while in the cart, you'll have to modify the Minecart_DisableItems() function. It's set up by default to disable the Roc's Feather. Add more copies of the function below that with your other disabled items in it as needed.
This script requires std.zh, ffcscript.zh, and scrollingDraws.zh.