JS line to edit the availability of a skill?

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,783
Reaction score
747
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,607
Reaction score
12,928
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,279
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,279
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

Coffee + Silk Coconut Milk + Splenda Zero = Not ..... awful :/ .
My new RPG Maker music pack, Emotional: Redemption, is now in progress and will be coming to RPG Maker soon. It is an album that focuses on emotional themes including the darker forms of sorrow and despair. Below is a demo of a composition from the album.

Please watch out for your hands when handling chests! XD Did this a few days ago, it was fun to animate

Apparently, it's illegal to be drunk on licensed premises: pubs, etc. It's illegal for keepers of public houses to permit drunkenness and disorderly conduct. lol.
Pillow Hero - A 16-bit arcade styled puzzle game, update 0.5 is live now on Itch.io! --> https://bifrost09.itch.io/pillow-hero

Forum statistics

Threads
94,437
Messages
920,907
Members
124,242
Latest member
garyxwoods
Top