JS line to edit the availability of a skill?

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,783
Reaction score
746
First Language
French
Is there a way to edit (in-game) when a skill is available, ie swap at will between "always", "never", "use in battle" and "use in menu"?
 
Last edited:

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
12,605
Reaction score
12,923
First Language
English
Primarily Uses
RMVXA
I think you meant to post this in another section. Moving to Javascript Support.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,048
Reaction score
10,278
First Language
Czech
Primarily Uses
RMMV
Definitely not one line. It would require a dedicated plugin.
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
679
Reaction score
521
First Language
French
Primarily Uses
You most definitely can do it, though it's a bad idea.

Just change $dataSkills[skillId].occasion to what you want (0-> always, 1-> battlescreen, ...).

Try it yourself:
Code:
$dataSkills[8].occasion = 1
This will make heal only castable on the battle screen in a default project.

It's a terrible idea outside of very few fringe cases though, as all data object changes only get reset when closing and restarting the game.
That means they persist along save and reloads as long as the game isn't closed. Use at your own risk, and only if you know what you're doing.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,048
Reaction score
10,278
First Language
Czech
Primarily Uses
RMMV
It's a terrible idea outside of very few fringe cases though, as all data object changes only get reset when closing and restarting the game.
That means they persist along save and reloads as long as the game isn't closed. Use at your own risk, and only if you know what you're doing.
That is why I said it required a dedicated plugin.
 

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
679
Reaction score
521
First Language
French
Primarily Uses
Yeah, just thought I'd mention it in case someone making a game where the player can't save or load is reading this.
In that case it's a valid solution, in all others, a terrible idea.

Basically, if you know what you're doing, you could use it when the player doesn't have the ability to save or load without closing the game, and get away with it.

Given this behaviour, you could probably make a horribly inefficient workaround by calling $dataManager.loadDatabase() when a file is loaded, that should reset database objects properly. Probably your best bet outside of a dedicated plugin.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I wonder if there's ever been an art challenge that involves drawing faces from the generator.
I'm sorry about earlier. I have the most hate and the most love for my art at the same time. Felt bad about my thread because I wasn't listening, and because I made it out of a bad mindset to begin with. S'another Thursday for me.

The main character of the book)
Things you can say about your rpg maker project but not your bf/gf: I'm not super committed but it's fun to play around with it.

Forum statistics

Threads
94,368
Messages
920,349
Members
124,134
Latest member
scrollstorm
Top