Lowell

The Walking Atelier
Veteran
Joined
Apr 21, 2012
Messages
292
Reaction score
69
First Language
English
Primarily Uses
Requesting a small script where skills have their own variables stored per actor that can be accessed via script calls and in-battle grabbing the actor id then skill id.


I know of the Skill Proficiency Plugin however that plugin is incompatible with my current plugin setup (Yanfly Library) and the creator hasn't been active since November of last year


(Plugin in question)
 

DreamX

Veteran
Veteran
Joined
May 30, 2015
Messages
816
Reaction score
837
First Language
English
Primarily Uses
Can you give an example of use?
 

Lowell

The Walking Atelier
Veteran
Joined
Apr 21, 2012
Messages
292
Reaction score
69
First Language
English
Primarily Uses
For skill formula's, I'd imagine something like a.skill_var(skill_id) or skill_var(actor_id,skill_id) and the latter for a script call outside of battle.


The main usage of this will be to simulate skill levels/experience with only the experience factor. I'll primarily be increasing the variable via script calls (I can run a comment event if I need to increase it in battle). I figured it would be easier to approach using actual skills instead of tagging the actor with the variable.
 

izyees

My Secret Santa
Veteran
Joined
Oct 24, 2015
Messages
248
Reaction score
67
First Language
english
use 

Code:
a.skillSelfVar = a.skillSelfVar || [];
a.skillSelfVar[x] = 'variable here';
 

Lowell

The Walking Atelier
Veteran
Joined
Apr 21, 2012
Messages
292
Reaction score
69
First Language
English
Primarily Uses
Where would this go?


A script call tells me a is not defined.
 

Lowell

The Walking Atelier
Veteran
Joined
Apr 21, 2012
Messages
292
Reaction score
69
First Language
English
Primarily Uses
That would cover the damage aspect, but there is no way to set this value before battle starts. I'm also pretty sure the variables can't be called outside the skill itself unless it's global.
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,458
First Language
Portuguese
Primarily Uses
Just make a script call with:


$gameActors.actor(actorId).skillVariables = {}
$dataSkills.forEach(function(skil) {
   if (skill) $gameActors.actor(actorId).skillVariables[skill.id] = 0;
}


This can be done anywhere, anytime, although it's better if done at game start to avoid issues, and should be done for each actor.


use this script call to set/change them


$gameActors.actor(actorId).skillVariables[skillId] = X // set the skill variable to X


$gameActors.actor(actorId).skillVariables[skillId]++ // adds 1 to the skill variable


You can use them in damage formulas with: a.skillVariables[skillId]


Or outiside of forumlas with: $gameActors.actor(actorId).skillVariables[skillId]


for example, to add the value of the skill Id 10 to the default attack damage formula you can use:


a.atk * 4 - b.def * 2 + a.skillVariables[skillId]
 
Last edited by a moderator:

Lowell

The Walking Atelier
Veteran
Joined
Apr 21, 2012
Messages
292
Reaction score
69
First Language
English
Primarily Uses
Works like a charm, thanks for the help everyone
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,458
First Language
Portuguese
Primarily Uses
@Lowell


Just a side note. This will work only for actors. If you have skills that use variables for enemies call this at the start of each battle (with a plugin or troop events)

Code:
$gameTroop.enemies().forEach(function(enemy) {
  enemy.skillVariables = {}
  $dataSkills.forEach(function(skil) { 
     if (skill)enemy.skillVariables[skill.id] = 0;
  }
}
 
Last edited by a moderator:

Latest Threads

Latest Profile Posts

I was listening to songs by Chuck E Cheese's voice actor (Jaret Reddick from Bowling for Soup) when the meds I was taking for my stomach virus apparently stopped working. I can't take my next dose until morning, but it's no use anyway. I'm officially sick again. Of course, I'll definitely take the next dose either way, but it's useless now.
New profile picture! This time, it's representative of my current project.
I suddenly feel like making a game for little kids: a pointless sandbox of cute animals, silly collectibles, and random mini games.
Anyone else just like, not bother to make games themed around specific holidays? I know I won't get them done in time for it to make sense.
time to enter the playtest dimension

Forum statistics

Threads
115,987
Messages
1,094,673
Members
151,281
Latest member
rexcvd
Top