Retain Speed Setting on Airship Exit

akoniti

Veteran
Veteran
Joined
Mar 4, 2020
Messages
85
Reaction score
64
First Language
English
Primarily Uses
RMMV
I was wondering if it is possible to modify the airship exit behavior?

I've created an item that modifies player speed for a short time, and all is working well except in relation to the airship.

It seems that the airship logic must set the player speed to 4 on exit, and I'm a bit out of my depth on how to modify the behavior with a conditional branch such that the speed will be set to 5 if the item Switch is active.

Any ideas would be much appreciated!
 

AdeptusUK

Veteran
Veteran
Joined
May 27, 2020
Messages
63
Reaction score
15
First Language
English
Primarily Uses
RMMV
You could set up a parallel common event with the item switch as the trigger that sets movement route --> movement speed = 5... I don't love it, but it would work.

You could also comment out the this.setMoveSpeed(4); at line 7967 of rpg_objects.js.
Or better pull it out into a plugin, alias the function and then add:

if (this.isInAirship() && $gameSwitches.value(YOUR_SWITCH_ID)==true){
this.setMoveSpeed(5);
}

This would retain the natural function of returning the player's move speed to 4, increasing it to 5 if the item switch is on.
 

akoniti

Veteran
Veteran
Joined
Mar 4, 2020
Messages
85
Reaction score
64
First Language
English
Primarily Uses
RMMV
Thanks @AdeptusUK ! Line 7967 in rpg_objects.js is exactly what I was looking for.

It looks like it's at line 7953 in my build (maybe it's an MV version thing? I'm running 1.6.2)

I gave commenting it out a shot, but that results in the Speed remaining at airship speed after exit (woooooo!), so I replaced it with this:

if ($gameSwitches.value(53)==true) {
this.setMoveSpeed(5);
} else {
this.setMoveSpeed(4);

It seems to be working great!

Can you think of any potential problems with adding the logic directly to the getOffVehicle function in rpg_objects? You'd mentioned pulling it into a plugin and aliasing the function, but I wasn't sure how to do that so opted to fiddle with it directly.
 

AdeptusUK

Veteran
Veteran
Joined
May 27, 2020
Messages
63
Reaction score
15
First Language
English
Primarily Uses
RMMV
Oh yeah, of course it leaves your speed at airship speed, haha!

I don't think that there is any issue with doing it directly in the code, I think it's just better practice to pull it into a plugin (there are loads of places in my project where I haven't done this either though, which is also probably why our line numbers don't match). Also, I'm not an expert and I am just learning js as I go in my project - my standard caveat!
 

akoniti

Veteran
Veteran
Joined
Mar 4, 2020
Messages
85
Reaction score
64
First Language
English
Primarily Uses
RMMV
Also, I'm not an expert and I am just learning js as I go in my project - my standard caveat!
You and me both! This is the first time I've run into something I couldn't modify as needed on the GUI-side, so it was a great excuse to start learning js :LZScool:

Thanks again for pointing me in the right direction!
 

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

Latest Threads

Latest Profile Posts

Once again working on a game I'm not sure I'm going to sell or even publish
That feel when you're awake past midnight and suddenly you're one year older :ninja:
I miss collaborations, but I don't know how to find someone to make face parts just to share them with others, and even though I don't like writing or music, I can't trust anyone with writing on my game because it has themes that are easy to mess up, and music needs a clear tone and scenes.
People donating to me for my upcoming birthday so I can pay my team a little. Such angels, I'm so happy. T uT I smile so much my face hurts. Good souls in this world.
Playing Ragnarok Online again is very nostalgic. The last time I played it was 20 years ago, when I was ten-twelve old.
My first mmorpg.^^

Forum statistics

Threads
105,571
Messages
1,014,723
Members
137,245
Latest member
dashstop
Top