Vehicles: How they work and how to add a new one

Shiokazu

Warper
Member
Joined
Jun 14, 2014
Messages
4
Reaction score
0
First Language
English
Primarily Uses
i'll keep it short, with a quick intro.

i never scripted anything in my life nor i know anything about ruby, i was trying to figure out alone how vehicles work reading through the code thats default within the rpg maker. /breathes/ I am now stuck with a thing, i need a vehicle, simply because dashing is not quick enough and i want to add a little more immersion. i need a vehicle that works on the land, i can put on the reasons if anyone here want to know but for now i'll try to keep it short.

so, could someone explain to me, how vehicles work in the maker, and how can i add a new vehicle, because eventing wont work on this matter.

thank you so much in advance.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
How interesting!


Vehicles are defined in $data_system. You have $data_system.boat, $data_system.ship and $data_system.airship. Each of these is a RPG::System::Vehicle object, which keeps track of the character name and index of the sprite, the BGM to play while you're in the vehicle, the starting map id and its x and y coordinates. The initial settings for these, obviously, come from the System tab in the editor.


In theory, you could adjust the Game_Vehicle class to add new vehicle types with the appropriate settings, then update Game_Map so it creates the additional vehicles. Then you'd need to adjust the Game_Player class to cater for the new vehicles. If you're after something that just works on land, you wouldn't have to make any adjustments to Game_Player's map_passable? method, as it would default to walking passability if you're not in the boat, ship or airship. You'd also have to check for anywhere else vehicles are referred to, and see what else needs to be modded for the possibility of other vehicle types.


However, if you JUST want to dash faster, it'd be easier to change the dashing speed than to try adding new vehicles.


Game_CharacterBase class


real_move_speed method


change this:

@move_speed + (dash? ? 1 : 0)to this:
Code:
@move_speed + (dash? ? 2 : 0)
Also note ... the default move speed (for walking) is 4, which is the same speed as the boat. Therefore the default dash speed, without changing that script, is 5, which is the same speed as the ship. If you're saying that's not fast enough, then you are saying that neither the boat nor the ship would be fast enough for you, and you'd want to move at the speed of the airship when dashing.


In that case, change the method to this instead:

Code:
dash? ? 6 : @move_speed
 
Last edited by a moderator:

Shiokazu

Warper
Member
Joined
Jun 14, 2014
Messages
4
Reaction score
0
First Language
English
Primarily Uses
thank you for the answer, it helped a lot, and made me understand a little bit more of the code.

currently working on a way to load the vehicle, since i dont see a place to define the graphics and load it into the map. im probably going to work on a small script to work with this.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
How are your scripting skills?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
:) I'll move it and we'll see if someone can do it for you.
 

Shiokazu

Warper
Member
Joined
Jun 14, 2014
Messages
4
Reaction score
0
First Language
English
Primarily Uses
thank you very much, while im at it, i'll try to see what i can do by myself.
 

Xenophic

Warper
Member
Joined
Jun 14, 2014
Messages
1
Reaction score
0
First Language
UK English
Primarily Uses
Same problem here. i'm trying to make a space themed game but the vehicles tracks aren't programmed as water so they don't move.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,309
Reaction score
531
First Language
indonesian
sorry if i'm offending. but if you have 0 skills in scripting. you might better use someone else script. (or see how they do that in that script if your purpose is for education...).

one of the scripts that adds vehicles i know is by victor. you might want to check it out.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top