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
62
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
62
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 Posts

Latest Profile Posts

rux
The most words I have ever written in an entire document is in my game's script, jeez i have a lot of characters that ramble on
Yes! I finally did something! This is a picture I drew of what I wish I looked like; I hope that you guys like it!
Finished that egg-sitting mini-game I mentioned here a couple weeks back. Now to fix the weather system so it doesn't rain indoors while you're playing it. >.> A simple fix in itself; leave it to me to take it as an excuse to completely revamp the time/weather/lighting system from scratch.
I'm really tempting to pre order cyberpunk 2077... should I do it or not :/ I really want to play the game but don't want to take a big hit to my saving because of it

Forum statistics

Threads
105,485
Messages
1,014,098
Members
137,138
Latest member
DawnStar
Top