Battles inside vehicles.

I wanna a script that works this way: when you enter a vehicle (and only when you enter), the entire party is replaced by an actor who represents the vehicle they are driving. If this actor-vehicle dies, it's game over. The non-vehicle actors in the party must receive exp instead of the vehicle-actor.

If this is possible by eventing, tell me how to do, it because I suck at event programming haha.
Mmm I think this could be doable with an existing script.
You could use Tsukihime Summon script and the summon would be the vehicle. This script allow you to replace the summon by the team, but still, the characters receive the exp when the battle is won. The problem I think would be that if the summon is killed the party is summoned back, so maybe you could solve this by making a event call when this summon is summoned to instantly call for the game over.

The only problem I find with this is that you need to find a method to start the battle with the summon while you're on the vehicle. I should experiment a little, but I think its possible.
I wanna a script that works this way: when you enter a vehicle (and only when you enter), the entire party is replaced by an actor who represents the vehicle they are driving. If this actor-vehicle dies, it's game over. The non-vehicle actors in the party must receive exp instead of the vehicle-actor.

If this is possible by eventing, tell me how to do, it because I suck at event programming haha.
Does entering a vehicle prevent you from entering a town or cave?
(it also would probably not be a vehicle anyways, just a party that is a vehicle)
Does it need to be a vehicle or just a party with a vehicle sprite?
Do you prevent access to the menu while as a vehicle?
Are battles done as a vehicle or the main party?

Is this all just for battles or is it to be for the map as well?
Does entering a vehicle prevent you from entering a town or cave?
(it also would probably not be a vehicle anyways, just a party that is a vehicle)
Does it need to be a vehicle or just a party with a vehicle sprite?
Do you prevent access to the menu while as a vehicle?
Are battles done as a vehicle or the main party?

Is this all just for battles or is it to be for the map as well?
1-The vehicle cannot enter in towns and caves, they are for world maps only.

2-It must be a vehicle.

3-No, the menu must still be accessible.

4-The battles are done as a vehicle, but this vehicle must be an actor who isn't in the party and will never be added to it, if it is impossible to do, so you can temporarily add the actor-vehicle in the party when driving a vehicle, and automatically remove it if the player gets off the vehicle.

5-It is just for battles.

Just saying for compatibility reasons, I'm using the scripts Yanfly's Party System, Yanfly Command Party and Victor basic Module and Actors Battlers.
1-The vehicle cannot enter in towns and caves, they are for world maps only.

2-It must be a vehicle.

3-No, the menu must still be accessible.

4-The battles are done as a vehicle, but this vehicle must be an actor who isn't in the party and will never be added to it, if it is impossible to do, so you can temporarily add the actor-vehicle in the party when driving a vehicle, and automatically remove it if the player gets off the vehicle.

5-It is just for battles.
1. Created land vehicle script. cannot move over tiles with events. Done
2. Vehicle is a Game_Vehicle. Done
3. Menu is not blocked. Done
4. Actor added to party that represents a vehicle, original party members saved to variable. Switches to original members when exiting. Done
5. Battles occur when driving the vehicle. Done

Issues
1. When fighting as a vehicle, the original party does not gain exp. working on it. Fixed
2. Evented battles will not work for player touch. If that is required then the script for the land vehicle can be changed but then you can drive over towns and maybe go into them. However I may be able to modify it so that if the enemy event has a comment for vehicle battles, then it will run.
It will work when pressing the action key, even if it is player touch.
Fixed except for touch, you must use the action button to run an event like you normally interact with it.

That's all I found so far.

Do you want what I've come up with or alter something?
I'm already have a script that makes a land vehicle, the Modern Algebra Terrain Features, but anyway thanks for the script, despite I yet don't understand how it can make the actor vehicle, because the default human party is still participating in battle.
Just make an actor that resembles the vehicle. When entering the vehicle, remove all party member and add only the actor representing the vehicle.

You can easily hide the event that represents the vehicle at the exact moment the vehicle actor is added to the party.

Now the whole party is just the vehicle. When the vehicle dies, it is automatically game over.

And to leave the vehicle, remove the actor that represents the vehicle and add the original party member to the party.
if it's only for land tiles, just replace the actor sprite with that of the vehicle.
the engine's airship and boat are for special cases of having to ignore passability, but if we're talking land, the same rules apply to actors than vehicles.

the only consideration should be whether or not the vehicle can get any stats or ailments after battle.
Just make an actor that resembles the vehicle. When entering the vehicle, remove all party member and add only the actor representing the vehicle.

You can easily hide the event that represents the vehicle at the exact moment the vehicle actor is added to the party.

Now the whole party is just the vehicle. When the vehicle dies, it is automatically game over.

And to leave the vehicle, remove the actor that represents the vehicle and add the original party member to the party.
But this will make the human party not gain EXP, this is why what I'm requesting is only possible by scripting. And also it would be very complicated adding and removing party members because my game have a lot of characters and the player choose what characters will be in the party.
So, you want the battle be only the car actor, but have all other actors gain XP?
Here is how you can do that:

Do what I said before, but now, when entering the vehicle, you make a variable, and you store the current XP of the car in it.

When leaving the vehicle, you make another variable, and store the new current XP in there, then do that variable minus the previous variable, and you get the XP that was earnd while in the car.

Now when you switch your party back in and your car out, do: "change XP" for whole party and use the second variable we made for the amount XP gained.

Now the actors will gain the full amount of XP, it only when they leave the car, if that is acceptable to you.

This also levels the car, though. But that could be a fun thing.
I'm already have a script that makes a land vehicle, the Modern Algebra Terrain Features, but anyway thanks for the script, despite I yet don't understand how it can make the actor vehicle, because the default human party is still participating in battle.
You didn't say you had something that makes a land vehicle. Yet I'm pretty sure it's different from what I made. I know of no scripts that make a land vehicle like I did. But if it works for you then great, however I based the other two scripts I made for the swapping actors and the vehicle battle based on my land vehicle script.
I'm also confused, do you want the actor party to fight in battle or the vehicle? I thought it was the vehicle. This is what I did. The land vehicle script I posted simply because it can stand on it's own.

Just make an actor that resembles the vehicle. When entering the vehicle, remove all party member and add only the actor representing the vehicle.
My land vehicle script does require an actor that is used as a vehicle so yes that is the same. However I have not provided the other parts of my scripts yet as I was waiting for confirmation / answers before posting.

And to leave the vehicle, remove the actor that represents the vehicle and add the original party member to the party.
This is also what my script does, but I do not believe just adding the original actors back would work as they would likely start at level one and battles as the vehicle would not let the actors gain experience.

the only consideration should be whether or not the vehicle can get any stats or ailments after battle.
Good point, I didn't consider this. If the OP wants that then I can add it in to clear the states inflicted in battle.

This also levels the car, though. But that could be a fun thing.
That's an option I thought of but didn't include it as the OP said to only have the original party gain exp.

when you enter a vehicle (and only when you enter), the entire party is replaced by an actor who represents the vehicle they are driving. If this actor-vehicle dies, it's game over. The non-vehicle actors in the party must receive exp instead of the vehicle-actor.
So since you never really answered my question here is the other scripts.
You must use my land vehicle script for it to work. Each is based off the previous (in a way).

Spoiler: Party Swap
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Party Swap for Vehicle                 ║  Version: 1.00     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║   Save the party in order to swap             ╠════════════════════╣
# ║   for a land vehicle for the party            ║    21 Jul 2023     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: Roninator2 Land Vehicle Script                           ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║       Switch party for vehicle                                     ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║   Change the values below for the vehicle actor                    ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 21 Jul 2023 - Script finished                               ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║ Free for all uses in RPG Maker except nudity                       ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║ No part of this code can be used with AI programs or tools         ║
# ╚════════════════════════════════════════════════════════════════════╝

#==============================================================================
# ** Edit Settings
#==============================================================================
module R2_LAND_VEHICLE
  VEHICLE_ACTOR = 11    # Actor that is used as the land vehicle
  LEADER_LEVEL = true   # If true will make the vehicle actor the 
                        # same level as the party leader
end
#==============================================================================
# ** End of Editable code
#==============================================================================

#==============================================================================
# ** BattleManager
#==============================================================================

module BattleManager
  #--------------------------------------------------------------------------
  # * EXP Acquisition and Level Up Display
  #--------------------------------------------------------------------------
  def self.gain_exp
    if $game_player.in_land?
      $game_party.vehicle_party.each do |actor|
        actor.gain_vehicle_exp($game_troop.exp_total)
      end
    else
      $game_party.all_members.each do |actor|
        actor.gain_exp($game_troop.exp_total)
      end
    end
    wait_for_message
  end
end # BattleManager

#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Get EXP (Account for Experience Rate)
  #--------------------------------------------------------------------------
  def gain_vehicle_exp(exp)
    change_exp(self.exp + (exp * vehicle_exp_rate).to_i, false)
  end
  #--------------------------------------------------------------------------
  # * Calculate Final EXP Rate
  #--------------------------------------------------------------------------
  def vehicle_exp_rate
    exr * (vehicle_battle_member? ? 1 : reserve_members_exp_rate)
  end
  #--------------------------------------------------------------------------
  # * Determine Battle Members
  #--------------------------------------------------------------------------
  def vehicle_battle_member?
    $game_party.vehicle_members.include?(self)
  end
end # Game_Actor

#==============================================================================
# ** Game_Party
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :vehicle_party            # Land Vehicle Party saved
  #--------------------------------------------------------------------------
  # * Get All Members
  #--------------------------------------------------------------------------
  def driving_members
    @vehicle_party.collect {|act| $game_actors[act.id] }
  end
  #--------------------------------------------------------------------------
  # * Get Battle Members
  #--------------------------------------------------------------------------
  def vehicle_members
    driving_members[0, max_battle_members].select {|actor| actor.exist? }
  end
end # Game_Party

#==============================================================================
# ** Game_Player
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Board Vehicle
  #    Assumes that the player is not currently in a vehicle.
  #--------------------------------------------------------------------------
  def get_on_vehicle
    front_x = $game_map.round_x_with_direction(@x, @direction)
    front_y = $game_map.round_y_with_direction(@y, @direction)
    @vehicle_type = :boat    if $game_map.boat.pos?(front_x, front_y)
    @vehicle_type = :ship    if $game_map.ship.pos?(front_x, front_y)
    @vehicle_type = :airship if $game_map.airship.pos?(@x, @y)
    @vehicle_type = :land    if $game_map.land.pos?(@x, @y)
    if vehicle
      @vehicle_getting_on = true
      force_move_forward unless in_airship? or in_land?
      @followers.gather
    end
    if in_land?
      $game_party.vehicle_party = $game_party.members
      $game_party.members.each do |actor|
        $game_party.remove_actor(actor.id)
      end
      $game_party.add_actor(R2_LAND_VEHICLE::VEHICLE_ACTOR)
      if R2_LAND_VEHICLE::LEADER_LEVEL
        lvl = $game_party.vehicle_party[0].level.to_i
        $game_party.members[0].change_level(lvl, false)
      end
    end
    @vehicle_getting_on
  end
  #--------------------------------------------------------------------------
  # * Get Off Vehicle
  #    Assumes that the player is currently riding in a vehicle.
  #--------------------------------------------------------------------------
  def get_off_vehicle
    if vehicle.land_ok?(@x, @y, @direction)
      set_direction(2) if in_airship?
      @followers.synchronize(@x, @y, @direction)
      if in_land?
        $game_party.remove_actor(R2_LAND_VEHICLE::VEHICLE_ACTOR)
        $game_party.vehicle_party.each do |actor|
          $game_party.add_actor(actor.id)
        end
        $game_party.vehicle_party = nil
      end
      vehicle.get_off
      unless in_airship? || in_land?
        force_move_forward
        @transparent = false
      end
      @vehicle_getting_off = true
      @move_speed = 4
      @through = false
      make_encounter_count
      @followers.gather
    end
    @vehicle_getting_off
  end
end # Game_Player
Spoiler: Vehicle Battle
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Vehicle Battles                        ║  Version: 1.00     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║                                               ╠════════════════════╣
# ║   Do battles in Land Vehicle                  ║    21 Jul 2023     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: Roninator2 - Land Vehicle                                ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║       Gives Exp to the party not the vehicle                       ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║   Plug and play                                                    ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 21 Jul 2023 - Script finished                               ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║  Free for all uses in RPG Maker except nudity                      ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║  No part of this code can be used with AI programs or tools        ║
# ║  Credit must be given                                              ║
# ╚════════════════════════════════════════════════════════════════════╝

#==============================================================================
# ** BattleManager
#==============================================================================

module BattleManager
  #--------------------------------------------------------------------------
  # * EXP Acquisition and Level Up Display
  #--------------------------------------------------------------------------
  def self.gain_exp
    if $game_player.in_land?
      $game_party.vehicle_party.each do |actor|
        actor.gain_vehicle_exp($game_troop.exp_total)
      end
    else
      $game_party.all_members.each do |actor|
        actor.gain_exp($game_troop.exp_total)
      end
    end
    wait_for_message
  end
end # BattleManager

#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Get EXP (Account for Experience Rate)
  #--------------------------------------------------------------------------
  def gain_vehicle_exp(exp)
    change_exp(self.exp + (exp * vehicle_exp_rate).to_i, false)
  end
  #--------------------------------------------------------------------------
  # * Calculate Final EXP Rate
  #--------------------------------------------------------------------------
  def vehicle_exp_rate
    exr * (vehicle_battle_member? ? 1 : reserve_members_exp_rate)
  end
  #--------------------------------------------------------------------------
  # * Determine Battle Members
  #--------------------------------------------------------------------------
  def vehicle_battle_member?
    $game_party.vehicle_members.include?(self)
  end
end # Game_Actor

#==============================================================================
# ** Game_Party
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * Get All Members
  #--------------------------------------------------------------------------
  def driving_members
    @vehicle_party.collect {|act| $game_actors[act.id] }
  end
  #--------------------------------------------------------------------------
  # * Get Battle Members
  #--------------------------------------------------------------------------
  def vehicle_members
    driving_members[0, max_battle_members].select {|actor| actor.exist? }
  end
end # Game_Party
You didn't say you had something that makes a land vehicle. Yet I'm pretty sure it's different from what I made. I know of no scripts that make a land vehicle like I did. But if it works for you then great, however I based the other two scripts I made for the swapping actors and the vehicle battle based on my land vehicle script.
I'm also confused, do you want the actor party to fight in battle or the vehicle? I thought it was the vehicle. This is what I did. The land vehicle script I posted simply because it can stand on it's own.


My land vehicle script does require an actor that is used as a vehicle so yes that is the same. However I have not provided the other parts of my scripts yet as I was waiting for confirmation / answers before posting.


This is also what my script does, but I do not believe just adding the original actors back would work as they would likely start at level one and battles as the vehicle would not let the actors gain experience.


Good point, I didn't consider this. If the OP wants that then I can add it in to clear the states inflicted in battle.


That's an option I thought of but didn't include it as the OP said to only have the original party gain exp.


So since you never really answered my question here is the other scripts.
You must use my land vehicle script for it to work. Each is based off the previous (in a way).

Spoiler: Party Swap
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Party Swap for Vehicle       ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║   Save the party in order to swap   ╠════════════════════╣
# ║   for a land vehicle for the party  ║    21 Jul 2023     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Change the values below for the vehicle actor          ║
# ║                                                          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use:                                            ║
# ║ Free for all uses in RPG Maker - Except Nudity           ║
# ╚══════════════════════════════════════════════════════════╝

#==============================================================================
# ** Edit Settings
#==============================================================================
module R2_LAND_VEHICLE
  VEHICLE_ACTOR = 11    # Actor that is used as the land vehicle
  LEADER_LEVEL = true   # If true will make the vehicle actor the
                        # same level as the party leader
end
#==============================================================================
# ** End of Editable code
#==============================================================================

#==============================================================================
# ** Game_Party
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :vehicle_party            # Land Vehicle Party saved
end # Game_Party

#==============================================================================
# ** Game_Player
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Board Vehicle
  #    Assumes that the player is not currently in a vehicle.
  #--------------------------------------------------------------------------
  def get_on_vehicle
    front_x = $game_map.round_x_with_direction(@x, @direction)
    front_y = $game_map.round_y_with_direction(@y, @direction)
    @vehicle_type = :boat    if $game_map.boat.pos?(front_x, front_y)
    @vehicle_type = :ship    if $game_map.ship.pos?(front_x, front_y)
    @vehicle_type = :airship if $game_map.airship.pos?(@x, @y)
    @vehicle_type = :land    if $game_map.land.pos?(@x, @y)
    if vehicle
      @vehicle_getting_on = true
      force_move_forward unless in_airship? or in_land?
      @followers.gather
    end
    if in_land?
      $game_party.vehicle_party = $game_party.members
      $game_party.members.each do |actor|
        $game_party.remove_actor(actor.id)
      end
      $game_party.add_actor(R2_LAND_VEHICLE::VEHICLE_ACTOR)
      if R2_LAND_VEHICLE::LEADER_LEVEL
        lvl = $game_party.vehicle_party[0].level.to_i
        $game_party.members[0].change_level(lvl, false)
      end
    end
    @vehicle_getting_on
  end
  #--------------------------------------------------------------------------
  # * Get Off Vehicle
  #    Assumes that the player is currently riding in a vehicle.
  #--------------------------------------------------------------------------
  def get_off_vehicle
    if vehicle.land_ok?(@x, @y, @direction)
      set_direction(2) if in_airship?
      @followers.synchronize(@x, @y, @direction)
      if in_land?
        $game_party.remove_actor(R2_LAND_VEHICLE::VEHICLE_ACTOR)
        $game_party.vehicle_party.each do |actor|
          $game_party.add_actor(actor.id)
        end
        $game_party.vehicle_party = nil
      end
      vehicle.get_off
      unless in_airship? || in_land?
        force_move_forward
        @transparent = false
      end
      @vehicle_getting_off = true
      @move_speed = 4
      @through = false
      make_encounter_count
      @followers.gather
    end
    @vehicle_getting_off
  end
end # Game_Player
Spoiler: Vehicle Battle
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Vehicle Battles              ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║                                     ╠════════════════════╣
# ║   Do battles in Land Vehicle        ║    21 Jul 2023     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Change the values below for the vehicle actor          ║
# ║                                                          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use:                                            ║
# ║ Free for all uses in RPG Maker - Except Nudity           ║
# ╚══════════════════════════════════════════════════════════╝

#==============================================================================
# ** BattleManager
#==============================================================================

module BattleManager
  #--------------------------------------------------------------------------
  # * EXP Acquisition and Level Up Display
  #--------------------------------------------------------------------------
  def self.gain_exp
    if $game_player.in_land?
      $game_party.vehicle_party.each do |actor|
        actor.gain_vehicle_exp($game_troop.exp_total)
      end
    else
      $game_party.all_members.each do |actor|
        actor.gain_exp($game_troop.exp_total)
      end
    end
    wait_for_message
  end
end # BattleManager

#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Get EXP (Account for Experience Rate)
  #--------------------------------------------------------------------------
  def gain_vehicle_exp(exp)
    change_exp(self.exp + (exp * vehicle_exp_rate).to_i, false)
  end
  #--------------------------------------------------------------------------
  # * Calculate Final EXP Rate
  #--------------------------------------------------------------------------
  def vehicle_exp_rate
    exr * (vehicle_battle_member? ? 1 : reserve_members_exp_rate)
  end
  #--------------------------------------------------------------------------
  # * Determine Battle Members
  #--------------------------------------------------------------------------
  def vehicle_battle_member?
    $game_party.vehicle_members.include?(self)
  end
end # Game_Actor

#==============================================================================
# ** Game_Party
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * Get All Members
  #--------------------------------------------------------------------------
  def driving_members
    @vehicle_party.collect {|act| $game_actors[act.id] }
  end
  #--------------------------------------------------------------------------
  # * Get Battle Members
  #--------------------------------------------------------------------------
  def vehicle_members
    driving_members[0, max_battle_members].select {|actor| actor.exist? }
  end
end # Game_Party


@Roninator2 "I'm also confused, do you want the actor party to fight in battle or the vehicle?"
The vehicle fights, and only the vehicle, but this vehicle must be an actor and only it will appear in battle. This system I'm requesting is like in Phantasy Star IV. Look:

"Good point, I didn't consider this. If the OP wants that then I can add it in to clear the states inflicted in battle.". Do as you wish, but In my game, the vehicle is immune to ALL states ailments, and by default, you can give an actor immunity to state changes. So I just take the actor representing the vehicle and give it immunities.

And about these scripts, they will really be only for land vehicles? Because I'm using all three types of vehicles (boat, ship and airship) and I wanna fight inside all of then, so will be 3 actors-vehicles. I'm so sorry if I dont said this before, but as I said in other posts, I'm a sucker with words and I'm have trouble in giving details, especially in English, so, sorry for any possible inconvenience, you are putting effort in helping me but I'll wasn't put efforting in explaining what I want, but I'll improve myself, sorry.
The vehicle fights, and only the vehicle, but this vehicle must be an actor and only it will appear in battle. This system I'm requesting is like in Phantasy Star IV.
Then I suggest you try my scripts.
The only difference from my scripts to the Phantasy Star image is the graphics layout.
That's an entirely separate request. From what I can see it will require quite a bit of changes.
You should look for scripts that alter the battle hud and we can go from there.
Luna engine can do it, but that is a complicated venue if all you want is this battle setup.
Then I suggest you try my scripts.
The only difference from my scripts to the Phantasy Star image is the graphics layout.
That's an entirely separate request. From what I can see it will require quite a bit of changes.
You should look for scripts that alter the battle hud and we can go from there.
Luna engine can do it, but that is a complicated venue if all you want is this battle setup.
I updated my last post to avoid double-posting, can you please read it again?

And I don't need the layout, I'm using sideview system anyway, so I have all the graphic part planned.
And about these scripts, they will really be only for land vehicles? Because I'm using all three types of vehicles (boat, ship and airship) and I wanna fight inside all of then, so will be 3 actors-vehicles. I'm so sorry if I dont said this before, but as I said in other posts, I'm a sucker with words and I'm have trouble in giving details, especially in English, so, sorry for any possible inconvenience, you are putting effort in helping me but I'll wasn't put efforting in explaining what I want, but I'll improve myself, sorry.
Yes this does not affect any of the default vehicles built in.
My land vehicle script just makes a new vehicle. Whatever it is you are doing for the other default vehicles you can keep doing.
So if you need 3 actor vehicles, we need to talk more.

By default the boat, ship and airship are just transportation vehicles.
Airship does not do battles unless you added a script to do them.
My script adds in land as a vehicle, so now you have land, ship, boat, airship.
I did not do anything to the others, so the party would not change to the boat if you were to get on board a boat.
Since you said 3 actor vehicles, which vehicles, land, ship and boat?
If you need me to make the default boat and ship work the same as the land vehicle I made then there will need to be a lot more changes.
Yes this does not affect any of the default vehicles built in.
My land vehicle script just makes a new vehicle. Whatever it is you are doing for the other default vehicles you can keep doing.
So if you need 3 actor vehicles, we need to talk more.

By default the boat, ship and airship are just transportation vehicles.
Airship does not do battles unless you added a script to do them.
My script adds in land as a vehicle, so now you have land, ship, boat, airship.
I did not do anything to the others, so the party would not change to the boat if you were to get on board a boat.
Since you said 3 actor vehicles, which vehicles, land, ship and boat?
If you need me to make the default boat and ship work the same as the land vehicle I made then there will need to be a lot more changes.
"So if you need 3 actor vehicles, we need to talk more."
"Since you said 3 actor vehicles, which vehicles, land, ship and boat?"

The 3 vehicles in my game are boat, ship and AIRSHIP, any of then with their respective actor-vehicles. I need the real transportation boat, ship and airship vehicles being the ones used because I'm using a script called "terrain features", by modern algebra, and one of its effects is choosing in what kind of tile the vehicle can walk. One of my three vehicles is amphibian i.e. it can walk in land and in swallow water, like the hovercraft from final fantasy iv, so the modern algebra script gives this effect, but as your script create new vehicles, these new vehicles will be unnafected by modern algebra script.

But if you can't do compatibility with modern algebra script, can at least make the land vehicle able to walk in swallow water i.e. the tile localized in the area surrounded by the yellow square?
Screenshot_3.png

And you can create the ship and airship battling vehicles (using the same technique to create the land vehicle in your scrip) with the same functionalty of the default ship and airship?
The 3 vehicles in my game are boat, ship and AIRSHIP, any of then with their respective actor-vehicles
Then that's a completely different script.
I should be able to use most of what I've done so far, but will have to work on it more to get the default vehicles working as actors for the battles.

Casper Gaming has a script that does battles for vehicles. (vehicle encounters) You can try that.
If you do then I just need to make the party swap for the vehicles and the exp for the actors.
So not too much to change.
@Roninator2 I'll use this casper script.
@Koudelka
Spoiler: Roninator2 - Party Swap Vehicle
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Party Swap for Vehicle                 ║  Version: 1.01     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║   Save the party in order to swap             ╠════════════════════╣
# ║   for a land vehicle for the party            ║    21 Jul 2023     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: Roninator2 - Land Vehicle                                ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║       Allow swapping party for land vehicle                        ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║   Change the values below for the vehicle actor                    ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 22 Nov 2024 - Script finished                               ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║ Free for all uses in RPG Maker except nudity                       ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║ No part of this code can be used with AI programs or tools         ║
# ╚════════════════════════════════════════════════════════════════════╝

#==============================================================================
# ** Edit Settings
#==============================================================================
module R2_LAND_VEHICLE
  BOAT_ACTOR = 11       # Actor that is used as the boat vehicle
  SHIP_ACTOR = 11       # Actor that is used as the ship vehicle
  AIRSHIP_ACTOR = 11    # Actor that is used as the airship vehicle
  LEADER_LEVEL = true   # If true will make the vehicle actor the 
                        # same level as the party leader
end
#==============================================================================
# ** End of Editable code
#==============================================================================

#==============================================================================
# ** BattleManager
#==============================================================================

module BattleManager
  #--------------------------------------------------------------------------
  # * EXP Acquisition and Level Up Display
  #--------------------------------------------------------------------------
  def self.gain_exp
    if $game_player.in_boat? || $game_player.in_ship? || $game_player.in_airship?
      $game_party.vehicle_party.each do |actor|
        actor.gain_vehicle_exp($game_troop.exp_total)
      end
    else
      $game_party.all_members.each do |actor|
        actor.gain_exp($game_troop.exp_total)
      end
    end
    wait_for_message
  end
end # BattleManager

#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Get EXP (Account for Experience Rate)
  #--------------------------------------------------------------------------
  def gain_vehicle_exp(exp)
    change_exp(self.exp + (exp * vehicle_exp_rate).to_i, false)
  end
  #--------------------------------------------------------------------------
  # * Calculate Final EXP Rate
  #--------------------------------------------------------------------------
  def vehicle_exp_rate
    exr * (vehicle_battle_member? ? 1 : reserve_members_exp_rate)
  end
  #--------------------------------------------------------------------------
  # * Determine Battle Members
  #--------------------------------------------------------------------------
  def vehicle_battle_member?
    $game_party.vehicle_members.include?(self)
  end
end # Game_Actor

#==============================================================================
# ** Game_Party
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :vehicle_party            # Land Vehicle Party saved
  #--------------------------------------------------------------------------
  # * Get All Members
  #--------------------------------------------------------------------------
  def driving_members
    @vehicle_party.collect {|act| $game_actors[act.id] }
  end
  #--------------------------------------------------------------------------
  # * Get Battle Members
  #--------------------------------------------------------------------------
  def vehicle_members
    driving_members[0, max_battle_members].select {|actor| actor.exist? }
  end
end # Game_Party

#==============================================================================
# ** Game_Player
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Update Boarding onto Vehicle 
  #--------------------------------------------------------------------------
  def update_vehicle_get_on
    if [email protected]? && !moving?
      @direction = vehicle.direction
      @move_speed = vehicle.speed
      @vehicle_getting_on = false
      @transparent = true
      @through = true if in_airship?
      vehicle.get_on
      $game_party.vehicle_party = $game_party.members
      $game_party.members.each do |actor|
        $game_party.remove_actor(actor.id)
      end
      case @vehicle_type
      when :boat ; $game_party.add_actor(R2_LAND_VEHICLE::BOAT_ACTOR)
      when :ship ; $game_party.add_actor(R2_LAND_VEHICLE::SHIP_ACTOR)
      when :airship ; $game_party.add_actor(R2_LAND_VEHICLE::AIRSHIP_ACTOR)
      end
      if R2_LAND_VEHICLE::LEADER_LEVEL
        lvl = $game_party.vehicle_party[0].level.to_i
        $game_party.members[0].change_level(lvl, false)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Get Off Vehicle
  #    Assumes that the player is currently riding in a vehicle.
  #--------------------------------------------------------------------------
  def get_off_vehicle
    if vehicle.land_ok?(@x, @y, @direction)
      RPG::BGM.stop
      set_direction(2) if in_airship?
      @followers.synchronize(@x, @y, @direction)
      case @vehicle_type
      when :boat ; $game_party.remove_actor(R2_LAND_VEHICLE::BOAT_ACTOR)
      when :ship ; $game_party.remove_actor(R2_LAND_VEHICLE::SHIP_ACTOR)
      when :airship ; $game_party.remove_actor(R2_LAND_VEHICLE::AIRSHIP_ACTOR)
      end
      $game_party.vehicle_party.each do |actor|
        $game_party.add_actor(actor.id)
      end
      $game_party.vehicle_party = nil
      vehicle.get_off
      unless in_airship?
        force_move_forward
        @transparent = false
      end
      @vehicle_getting_off = true
      @move_speed = 4
      @through = false
      make_encounter_count
      @followers.gather
    end
    @vehicle_getting_off
  end
end # Game_Player
@Koudelka
Spoiler: Roninator2 - Party Swap Vehicle
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Party Swap for Vehicle       ║  Version: 1.01     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║   Save the party in order to swap   ╠════════════════════╣
# ║   for a land vehicle for the party  ║    21 Jul 2023     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Change the values below for the vehicle actor          ║
# ║                                                          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use:                                            ║
# ║ Free for all uses in RPG Maker - Except Nudity           ║
# ╚══════════════════════════════════════════════════════════╝

#==============================================================================
# ** Edit Settings
#==============================================================================
module R2_LAND_VEHICLE
  BOAT_ACTOR = 11       # Actor that is used as the boat vehicle
  SHIP_ACTOR = 11       # Actor that is used as the boat vehicle
  AIRSHIP_ACTOR = 11       # Actor that is used as the boat vehicle
  LEADER_LEVEL = true   # If true will make the vehicle actor the
                        # same level as the party leader
end
#==============================================================================
# ** End of Editable code
#==============================================================================

#==============================================================================
# ** Game_Party
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :vehicle_party            # Land Vehicle Party saved
end # Game_Party

#==============================================================================
# ** Game_Player
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Update Boarding onto Vehicle
  #--------------------------------------------------------------------------
  def update_vehicle_get_on
    if [email protected]? && !moving?
      @direction = vehicle.direction
      @move_speed = vehicle.speed
      @vehicle_getting_on = false
      @transparent = true
      @through = true if in_airship?
      vehicle.get_on
      $game_party.vehicle_party = $game_party.members
      $game_party.members.each do |actor|
        $game_party.remove_actor(actor.id)
      end
      case @vehicle_type
      when :boat ; $game_party.add_actor(R2_LAND_VEHICLE::BOAT_ACTOR)
      when :ship ; $game_party.add_actor(R2_LAND_VEHICLE::SHIP_ACTOR)
      when :airship ; $game_party.add_actor(R2_LAND_VEHICLE::AIRSHIP_ACTOR)
      end
      if R2_LAND_VEHICLE::LEADER_LEVEL
        lvl = $game_party.vehicle_party[0].level.to_i
        $game_party.members[0].change_level(lvl, false)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Get Off Vehicle
  #    Assumes that the player is currently riding in a vehicle.
  #--------------------------------------------------------------------------
  def get_off_vehicle
    if vehicle.land_ok?(@x, @y, @direction)
      RPG::BGM.stop
      set_direction(2) if in_airship?
      @followers.synchronize(@x, @y, @direction)
      case @vehicle_type
      when :boat ; $game_party.remove_actor(R2_LAND_VEHICLE::BOAT_ACTOR)
      when :ship ; $game_party.remove_actor(R2_LAND_VEHICLE::SHIP_ACTOR)
      when :airship ; $game_party.remove_actor(R2_LAND_VEHICLE::AIRSHIP_ACTOR)
      end
      $game_party.vehicle_party.each do |actor|
        $game_party.add_actor(actor.id)
      end
      $game_party.vehicle_party = nil
      vehicle.get_off
      unless in_airship?
        force_move_forward
        @transparent = false
      end
      @vehicle_getting_off = true
      @move_speed = 4
      @through = false
      make_encounter_count
      @followers.gather
    end
    @vehicle_getting_off
  end
end # Game_Player

#==============================================================================
# ** BattleManager
#==============================================================================

module BattleManager
  #--------------------------------------------------------------------------
  # * EXP Acquisition and Level Up Display
  #--------------------------------------------------------------------------
  def self.gain_exp
    if $game_player.in_boat? || $game_player.in_ship? || $game_player.in_airship?
      $game_party.vehicle_party.each do |actor|
        actor.gain_vehicle_exp($game_troop.exp_total)
      end
    else
      $game_party.all_members.each do |actor|
        actor.gain_exp($game_troop.exp_total)
      end
    end
    wait_for_message
  end
end # BattleManager

#==============================================================================
# ** Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Get EXP (Account for Experience Rate)
  #--------------------------------------------------------------------------
  def gain_vehicle_exp(exp)
    change_exp(self.exp + (exp * vehicle_exp_rate).to_i, false)
  end
  #--------------------------------------------------------------------------
  # * Calculate Final EXP Rate
  #--------------------------------------------------------------------------
  def vehicle_exp_rate
    exr * (vehicle_battle_member? ? 1 : reserve_members_exp_rate)
  end
  #--------------------------------------------------------------------------
  # * Determine Battle Members
  #--------------------------------------------------------------------------
  def vehicle_battle_member?
    $game_party.vehicle_members.include?(self)
  end
end # Game_Actor

#==============================================================================
# ** Game_Party
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * Get All Members
  #--------------------------------------------------------------------------
  def driving_members
    @vehicle_party.collect {|act| $game_actors[act.id] }
  end
  #--------------------------------------------------------------------------
  # * Get Battle Members
  #--------------------------------------------------------------------------
  def vehicle_members
    driving_members[0, max_battle_members].select {|actor| actor.exist? }
  end
end # Game_Party
OMG you saved my life again! Thank you very much! It works perfectly.

Original thread: https://forums.rpgmakerweb.com/threads/battles-inside-vehicles.159181/