Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[XP] Heretic's Vehicles (Boat and Magic Carpet)

Heretic's Vehicles XP
Version: 1.0
By: Heretic


Introduction

Uh, Vehicles! Duh! Okay, there is a Boat, and a Magic Carpet, which floats! I lacked the appropriate graphics to create an Airboat, but it is possible to create an Airboat without modifying any of the code! This script also contains a crapton of features to simulate Water and Floating Effects, such as Sprite Offsets and code to simulate a Floating Animation!

Features

  • RPG Maker XP Style Vehicles
  • Boat and Magic Carpet
  • Magic Carpet graphic can be swapped out for an Airboat Graphic, if one were available...
  • Vehicles can be Oversized so they collide from several tiles away!
  • Who am I kidding? Just grab the Demo already!

Screenshots

BoatAtSea.jpg

Boat at Sea

BoatBoarding.jpg

Caterpillar boarding the Boat

MagicCarpet.jpg

Magic Carpet

Demo

http://downloads.chaos-project.com/here ... hicles.exe

NOTE: There are TWO Versions of the Vehicles Demo. One provides Eventing for having a Caterpillar board a Vehicle, which is provided in Heretic's Collection, and this one, which does not include Eventing for having a Caterpillar board a Vehicle. It is a very minor difference between the Two Demos.

This Demo also contains quite a few scripts, not all of which are Vehicle related. The Caterpillar was included purely for Framerate Optimization Code due to the high number of Events on the Map. Most scripts are there to enhance the Gameplay Experience while trying out the Demo.

Script

Script available in Demo

Instructions

Place below Modular Passable (Required)
Place below Collision Optimizer (Optional)
Place below Loop Maps (Optional)
Place below Heretic's Caterpillar 2.0+ (Optional)

Required: Heretic's Restrict Tile Passages 1.0+

Recommended: Heretic's Restrict Bush Passages 1.0+ (For Bush Effects simulating Water)

FAQ

Q: How do I put the Player on a Boat?
A: Just run a script: enable_vehicle

Q: How do I get the Player off of a Boat?
A: Just run a script: disable_vehicle

Q: How do I change from Boat to Magic Carpet?
A: Run a Script: $game_system.vehicle_type = N
Set N to 0 for Boats and 1 for Magic Carpet

Q: How do I Animate boarding a Boat or Carpet?
A: That is ALL done with Eventing! You can use the Vehicles in the Demo as Templates for your game!

Q: How do I only let the Player move on Water?
A: That is a feature controlled by Restrict Tile Passages script. In the Demo, I use Simple Tile IDs 2, 3, and 4 for Water tiles that the Player is allowed to move on. To Restrict the Player to only these tiles, run a Move Route Script on the Player that reads: @tile_only_move = [2, 3, 4] so the Player can now ONLY move on Water Tiles, or Tiles with these Simple Tile IDs. Yes, those are Autotiles by the way.

Q: How do I let the Player move on Land again?
A: This is also controlled by Restrict Tile Passages script. Just clear out the Tile Only Move property by running a Move Route Script that reads: @tile_only_move = nil

Q: Can I use Restrict Tile Passages to control other Events?
A: You sure can. Put a Coment on the Event that you want to move on a specific tile, lets say Water, and 2, 3, and 4 again, Just make the comment read: \tile_only_move[2,3,4] and that Event can now only move on those specific Simple Tile IDs.

Q: Can you please make me a Starship Vehicle?
A: I wouldn't know where to begin, but I do suspect the real world physics has some things about Spacetime incorrect, such as Magentism actually being a Dimension in Spacetime in an Eleven Dimensional Universe. Most people call me crazy, but it certainly explains a couple of things, such as why Iron is Magnetic, as well as Quantum Entanglement. They also have the concept of Spacetime wrong too. If you think about Spacetime as a Substance, E=MC2 only describes the Viscosity of Spacetime, but they have at least figured out that Spacetime itself can move much faster than light, which explains why the universe is 13.7 billion years old and the universe is 93 billion light years across. Space itself is the thing that is moving. Of course, that is beyond the scope of this Vehicles script. Just find the appropriate graphics and the Labels of Boat and Magic Carpet really don't matter that much.

Q: How do I Disembark anywhere?
A: This one is a bit tricky. Use what is called a "trigger_id". A Trigger ID is the ID of a Map Event that will run every time the Player presses Enter. Set the Trigger ID with a Script: set_vehicle_trigger_id(event_id) when boarding a Vehicle or changing maps. Trigger ID is cleared when you change maps, so every Map that vehicles are to be allowed on will need an Event hidden somewhere that will control the Player's Disembark Animation. This was done so you don't have to use a Parallel Event to Disembark.

Q: How can I keep the Player from Disembarking where they shouldn't?
A: Use a Conditional Branch and run a Script: can_disembark_here? for Crpets and can_disembark_there? for Boats. This will typically be done with a Disembark Controller Event, set by your Trigger ID. Alter the Passages by using the features of the Restrict Tile Passages script on your Disembark Controller (set by your Trigger ID) if you need to in order to control where the Player is allowed to Disembark. This allows you to let the Player Disembark at Beach Tiles, but not other types of land tiles. To do that, simply give your Disembark Controller Event (again, set by your Trigger ID) a Comment that reads: \tile_only_move[2, 3] where Simple Tile IDs are your Shore Tiles.

Q: How do I make the Player Float?
A: Run a Move Route Script that reads: @float_anime = true

Q: Can I make the Float Animation bigger?
A: Run a Move Route Script that reads: @float_max = 8

Q: Can I change the Speed of the Float Animation?
A: Run a Move Route Script that reads: @float_speed = 6

Q: How do I prevent "snapping" when I set @float_anime = false?
A: Run a Move Route Script that reads: @float_smooth = true before setting @float_anime to false.

Q: How do I make the Player Float higher or lower than their actual position?
A: Make changes to @float_base = N. Use Negative Numbers to float Higher and Positive Numbers to float Lower. Carpets will look better when given a Negative Number like 10, and Boats seem to look best with a minimal @float_base, roughly 4. Float Base adjustments are per pixel. So setting @float_base = -11, the Player's Sprite will be shifted UP by 11 pixels.

Q: How do I make the Player look like they are IN the Boat and not just ON the boat?
A: There are two possible answers here, both use Clip Sprite. Run a Move Route Script that reads clip_sprite_to(4, 4) which clips off the bottom four pixels of the Player's Sprite over 4 Frames. Clip Sprite To provides a Transition, which means the first argument is the Target, and the second argument is the Duration. Using clip_sprite_to(target_clip, duration) will Animate the Transition and cause the Sprite to "sink" into the boat. The other way to do it causes a "snap", but is simply @clip_base = 4. This will clip the bottom four pixels off of the sprite.

Q: I have more Questions than you posted answers for! What's up with that?
A: I spent a lot of time putting together a very comprehensive demo that shows you all of the necessary features within the demo itself. That is the purpose of a Demo, which is to Demonstrate how to do many of the questions that you have.

If you have additional questions that are not covered, feel free to post a question and I'll do my best to explain thoroughly.

Compatibility

Works with the SDK. May not work with Pixel Movement Scripts.

Credits and Thanks

Thank you to Wecoc on chaos-project.com for both the Boat and Magic Carpet graphics!

Author's Notes

This is a highly compex script that is recommended for advanced users only! If you only started using RPG Maker a week ago, most of this stuff will sail right over your heads!

Terms and Conditions

You may use this script in Commercial and Non Commercial projects without compensation, provided that you credit me as the original author of any of the Scripts that have been used. You may redistribute this Demo and Script on other websites. You may alter the code to suit your needs, provided you credit me as the original author. Don't forget to credit yourself for any changes you make.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top