How to change skill scope with variables?

Hey there,

I was thinking about having a skill that could be upgraded throughout the game. This skill would start out with the "scope" of one enemy, but I would eventually want to have it affect all enemies once it has been upgraded. Is there any easy way to control the scope of the ability using variables or switches? 
No - and not even an not-easy way.

You have only two options:

1) make different skills with the same name and replace them when upgrading

2) look for a target manager plugin and hope that it has variable options (most target managers only add a few scopes)
I think the easiest way to do this is to unlearn the spell in the upgrade event and learn another one immediatly after this. For the player, it will be like his spell is upgraded.
$dataSkills[id].scope = X

X = number (0 to 11)

0 = none

1 = 1 enemy

2 = all enemies

3 = 1 random enemy

4 = 2 random enemies

5 = 3 random enemies

6 = 4 random enemies

7 = 1 ally

8 = all allies

9 = 1 ally(dead)

10 = all allies(dead)

11 = the user
I still wouldn't use the info posted above me. That info is from $data_skills, which is the main database, and you should *never* change that mid-game, as the game loads the database new every time a save game is loaded.

Plus, even if you overwrite the database, then you would be changing it for everyone who uses that skill at any point in the game, not just that one character.

Afraid at this point in time all you can do is unlearn the skill and learn the upgraded version, until someone gets around to writing a plug-in for variable scope.
I'm not at home right now, so sorry for the lack of details.

You'd need to write a plugin for this:

I'm imagining this upgrade will happen per Actor, right? You could add a new property for Game_Actor called something like "Upgraded_Skills", which would be an object that holds the id of the skill and whatever you want to override in them, like their scope.

Then you'd need to change the Game_Action (and Game_Scene, for selecting targets and such, if I remember correctly) methods that check for item scope, to also check to see if the battler using it is a Game_Actor that has that skill upgraded. If he has, it should use that value instead of the $data value.

(PS: Making this per Game_Item or Game_Skill wouldn't work very well, that's why I recommend Game_Actor. From what I've seem, the way the base code uses Game_Skill and Game_Item is pretty inconsistent, often completely ignoring them and going straight for the $data).
Thanks for all the feedback. I had considered making two separate skills as a backup method in case there was no easy fix. I'm controlling most of the other non-scope upgrades with common events and variables, so I think I'll still be able to achieve what I'm looking for. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/how-to-change-skill-scope-with-variables.49482/