Script Compatibility Issue?

Good Morning / Day / Afternoon / Evening everyone.

I once again have a request

I have been trying to use two different scripts to achieve something but there seems to be some sort of compatibility issue.

http://rmrk.net/index.php?topic=47620.0

Terrain Features by modern algebra

and

VE's Custom Vehicles



when I use these scripts in unison

I always get this error


xaaaaci.png


Is there a way to fix this?
Where does the scipt open up to after getting the error? If you open up scripts in the editor after getting the error it should open up to the script and line
First thing is to name your slots to get the full error message.

The regular message is Script '<slotname>' line ...
So the fact that there is a name missing shows that the script causing this problem is in an unnamed slot.
Please name all slots to be able to really tell which script has the problem.

That said, argument errors like those mean that a function has been changed in the argument definition, and that is rather unlikely unless the programmer replaced a lot of the engine.
we would need to find out which function did this to evn guess, and that needs the script name...
You could try another vehicle script. I use Shenwolf Multi Vehicles.
I'm also confused about which vehicle script you are using?
You have another post for Tsukihime Vehicle Extend
Shenwolf is good, but it won't allow me to transport vehicles with script calls like Tsuki's script does.
I always get this error
Looking at the scripts, I can't tell which one has the issue.
attr_reader :vehicle_type
or
$data_ma_terrains[terrain_tag].walk_speed
(line 350)
Isn't there an easier way to code vehicle restrictions?

For example... here is a basic thing I coded myself
zaaaaaaaaaaaaaaaa.png


can't I put basic terrain restrictions here??
You're specifying different options under each condition, so no in that case.
Also your coding for game_player. Making it specific to the player character not a vehicle.

I was wondering where that came from, I don't remember it, but it has my little tag in it. lol
What if you set a move route for the veichle and had it jump to a location?
I am just so frustrated this, all because I wanted to have multiple vehicles and the ability to set terrain features... there has to be a way around this somehow... I wish I understood it better....
I am just so frustrated this, all because I wanted to have multiple vehicles and the ability to set terrain features... there has to be a way around this somehow... I wish I understood it better....

Did you ever do what Andar said so we can identify the compatibility issue?
I am not sure I understood, but when I use these two scripts in unison.

I get this error

XAAAAA.png


!000 LINE 384.png


When I use each one seperately, they work just fine....

I hope I'm relaying this information as well as possible...
I'm confused; the Victor one you linked is a js plugin for MV.
My mistake, I really apologise.


Here is the VX ACE script.
Got it. Custom Vehicles rewrites the terrain_tag method for the Game_Custom_Vehicle class, which becomes:

Code:
def terrain_tag(x, y)
    $game_map.terrain_tag(x, y)
  end

Terrain Features rewrites Game_Map's terrain_tag method:

Code:
alias matf_terrtag_5io7 terrain_tag
  def terrain_tag(*args)
    @matf_sub_terrains[matf_terrtag_5io7(*args)] # Call original method
  end

So it looks like there's some confusion in the engine about the parameters. Still trying to figure out exactly where it's breaking.

Okay...so the terrain_speed_modifier method in Game_CharacterBase calls the terrain_tag method, which calls $game_map.terrain_tag passing in the CharacterBase's own X and Y coordinates. But a custom vehicle adds an x and y parameter to its terrain_tag method, meaning there's a signature conflict between custom vehicles and other Game_CharacterBase instances.

Changing the terrain_speed_modifier method in Terrain Features to this should fix it:

Code:
def terrain_speed_modifier
    if self.is_a?(Game_Custom_Vehicle)
      $data_ma_terrains[terrain_tag(@x, @y)].walk_speed
    else
      $data_ma_terrains[terrain_tag].walk_speed
    end
  end
Is it supposed to be in Game_Player or Game_Characterbase? Or both? should I change the code to this in both methods?
The one in Game_CharacterBase; that's the one causing the issue. The one in Game_Player is fine because a custom vehicle is not an instance of that.

Basically, both the player and vehicles are instances of Game_CharacterBase. Anything that's written in there and not overridden in their own class will be inherited and affect both. At the moment, having both scripts means you have two different kinds of Game_CharacterBase that are trying to do different things with terrain_tag, which is where the conflict comes from. Changing the one in Terrain Features to check first whether itself is an instance of Game_Custom_Vehicle and if so pass in the x and y arguments it's expecting should resolve the conflict.
ZAAAAAA3.png


It isn't working...

it gives me this error


ZAAAAAA4.png


This coding stuff must be frustrating isn't it?
Have you accidentally deleted the "end" that finishes the class definition?
I think I did, I tried this again

Part 1 - finding the source

Z21.png


Part 2: Changing the code

Z22.png


Part 3 - Configuring the Terrain Features I customized

Z23.png


Results:

No errors, The custom vehicle works... no errors, but the terrain features themselves are not functioning.

Original thread: https://forums.rpgmakerweb.com/threads/script-compatibility-issue.124508/