Creating skills at run time

Status
Not open for further replies.

Zechnophobe

Veteran
Veteran
Joined
Jul 17, 2013
Messages
93
Reaction score
2
First Language
English
Primarily Uses
Hello, I've been trolling the forum and script code for a while, and seem to be coming up short. I notice that the creation of actors can be done via game_actor. However, I don't see an equivalent model for skills that would allow me to create a skill. It seems like it would be an odd thing to omit, so I assume I'm just missing something.

What I would want to do:

1) Clone an existing skill (if possible, so I can template them)

2) Modify the values of the skill (such as damage formula)

With cloning possibly not being an option:

1) Create a new Skill with custom values (Once again, such as damage formula)

(Similarly is there a model for Classes that could potentially be modified, and if so what are its props and methods?)

Uh, lastly, I can see how normal events can retrieve a specific stat of an actor, but what about via a script? Game actor doesn't include it.

Any help would be much appreciated.
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,696
Reaction score
935
First Language
English
Primarily Uses
N/A
skills are loaded at the beginning of the game and put into the global variable $data_skills. They are loaded from the skills data file, which is modified by the editor. You can copy a skill by using:

my_var = $data_skills[some_skill_id]These skills follow the format of RPG::Skill. you can see how they are made in the helpfile's contents, on the index tab, towards the bottom of the list.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Why do you want to create a NEW skill at runtime?


Normally you'd set up all your skills in the database, then you'd use a Change Skills command to give it to the actor when you want to (or set up your classes so new skills are learned at certain levels).


Creating completely NEW skills will certainly call for some complicated scripting, as well as ensuring the skills are saved and loaded with the player's save file.


You can get stats from actors via script. Game_Actor is a child of Game_Battler, which in turn is a child of Game_BattlerBase. Either Game_Battler or Game_BattlerBase has methods to retrieve stats.
 

Zechnophobe

Veteran
Veteran
Joined
Jul 17, 2013
Messages
93
Reaction score
2
First Language
English
Primarily Uses
Okay, so one of the things I'm working on is a randomized companion system where you find through various means, possible companions you can choose to make part of your game. Part of this is randomized stats and class, which isn't hard. Further more, however, I'd love if I could have the occasional skill for a character be special. Maybe have some quirk, or do extra damage. Those random companions could be extra fun to consider. Instead of having a finite list of skills to choose from, instead creating these random skills on the fly (with variable features) sounds like fun. And yeah, I'm a professional developer so I'm not too scared of some heavy scripting.

Why do you want to create a NEW skill at runtime?

Normally you'd set up all your skills in the database, then you'd use a Change Skills command to give it to the actor when you want to (or set up your classes so new skills are learned at certain levels).

Creating completely NEW skills will certainly call for some complicated scripting, as well as ensuring the skills are saved and loaded with the player's save file.


You can get stats from actors via script. Game_Actor is a child of Game_Battler, which in turn is a child of Game_BattlerBase. Either Game_Battler or Game_BattlerBase has methods to retrieve stats.
 

Zechnophobe

Veteran
Veteran
Joined
Jul 17, 2013
Messages
93
Reaction score
2
First Language
English
Primarily Uses
skills are loaded at the beginning of the game and put into the global variable $data_skills. They are loaded from the skills data file, which is modified by the editor. You can copy a skill by using:

my_var = $data_skills[some_skill_id]These skills follow the format of RPG::Skill. you can see how they are made in the helpfile's contents, on the index tab, towards the bottom of the list.
Excellent information, and it looks like the super classes of RPG::Skill allow for all the modifications I want. Thanks!
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
Zechnophobe, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top