Adding new Basic in the default Ace RGSS3 Scripts

Hi, I'm curious if we can edit the Vocab section and add a new feature into the whole basic status of an actor. Such as

def self.tp_element; basic(8); end

#-------------------------------------------------------------------------- def self.level; basic(0); end # Level def self.level_a; basic(1); end # Level (short) def self.hp; basic(2); end # HP def self.hp_a; basic(3); end # HP (short) def self.mp; basic(4); end # MP def self.mp_a; basic(5); end # MP (short) def self.tp; basic(6); end # TP def self.tp_a; basic(7); end # TP (short) def self.fight; command(0); end # Fight def self.escape; command(1); end # Escape def self.attack; command(2); end # Attack def self.guard; command(3); end # Guard def self.item; command(4); end # Items def self.skill; command(5); end # Skills def self.equip; command(6); end # Equip def self.status; command(7); end # Status def self.formation; command(8); end # Change Formation def self.save; command(9); end # Save def self.game_end; command(10); end # Exit Game def self.weapon; command(12); end # Weapons def self.armor; command(13); end # Armor def self.key_item; command(14); end # Key Items def self.equip2; command(15); end # Change Equipment def self.optimize; command(16); end # Ultimate Equipment def self.clear; command(17); end # Remove All def self.new_game; command(18); end # New Game def self.continue; command(19); end # Continue def self.shutdown; command(20); end # Shut Down def self.to_title; command(21); end # Go to Title def self.cancel; command(22); end # Cancel#--------------------------------------------------------------------------Say, if it is possible, how can I do so? So that I can manipulate my own inserted feature in later methods.
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


basic and command are methods. Look them up and see what they do.


You might be able to add to them, but you'll need a way to populate them, and for the methods to read them back and return them.


Please do not keep posting the same question. It didn't appear because you posted it in the wrong place, in a forum that requires moderator approval. Your repeat post did not appear for the same reason. If you can't see a post you just made, check the rules of the forum (pinned at the top) to ensure you put it in the right place.
Sorry for posting on the wrong place. Just realize few minutes ago the forum I posted is for completed script only lol.

So, I try to find (ctrl + F) basic in the list of RGSS3 scripts but don't find anything that explains what it's for. I look up in http://rpgmaker.net/articles/1109/ which explains about Module/Vocab and here's what I got.

# Basic Status

def self.basic(basic_id) $data_system.terms.basic[basic_id] end

This is known as a shortcut method: near the bottom of Vocab, things like self.level are defined simply as "basic(0)" and that's because of this method. If we didn't have that, it would have had to be "$data_system.terms.basic[0]" instead. Considering there are 8 methods that draw from "basic" and 23 which draw from "command", you can see why having a shortcut would be handy. As you can see, the method doesn't really do anything by itself, but it makes referring to a long nest of objects much easier in other places. 

$data_system.terms is where the terms from the database are located, and subsequently contains the arrays "basic", "params", "etypes" and "commands". These correspond to the Basic Status, Parameters, Equip Types and Commands sections of the terms tab. 

If you ever want to call something from Vocab, all you have to do is type Vocab, two colons, and the name of the method/property. For example, if I have an event where I want to display the name of the player's party, all I have to do is "Vocab:😛artyName". This is the universal way to call stuff from modules, and you'll probably see it a lot in 3rd party scripts. 
I don't really understand what you mean by populating them, and is there an example, code lines or maybe a snippet, to show how the new feature is added and then be used in methods that can read them back and return them?
Those values work because they are already in the database. If you want to invent new values to represent new stats, you need to have a way of populating those values. This could be by adding lines to the note box of each actor, then making something read the notes and turn them into variables after the database is loaded. Then you need to have a way to make def self.basic know whether to look at the default above, or to get the value from your new stats.


It's not just a matter of making up new stuff - you have to determine how you're going to put values in them in the first place, and make the scripts know whether to return your values or look to the database for them.
So that's how if you want to invent new stats.

If you want to invent new values to represent new stats, you need to have a way of populating those values. This could be by adding lines to the note box of each actor, then making something read the notes and turn them into variables after the database is loaded. Then you need to have a way to make def self.basic know whether to look at the default above, or to get the value from your new stats.
Okay. May I elaborate a bit, hope it doesn't stray too much from this topic.

My new feature def self.tp_element; basic(8); end is intended to be a variable to define the element of actor's TP (the new feature I'm trying to make in my Ace game). So, if the battlers get hit by FIRE damage, self.tp_element = item.damage.element_id. 

So, what I'm trying to create now is a variable which can be accessed by self.[name of term/variable]. Because in my mind, self.[name of term/variable] is simpler to manipulate then having to make sure the battler index is correct then change the variable assigned to that battler.

Hope I don't ask too much. Thanks

Original thread: https://forums.rpgmakerweb.com/threads/adding-new-basic-in-the-default-ace-rgss3-scripts.53873/