Changing Terms Mid-Game

Marche100

Villager
Member
Joined
Aug 11, 2013
Messages
13
Reaction score
4
First Language
English
Primarily Uses
Heya, everyone.

Going to keep this short and sweet. I'm making a game that has a bonus mode of sorts post-game. That's all fine and dandy, but the main game and the bonus mode are two entirely different things, and along with that, I need to change the terms for Items as the player transitions into the bonus mode. Is there any way to do that? Any sort of script call I could use, perhaps? I was looking for some scripts with the capability to do something like that, but I haven't been able to turn anything up.

Thanks in advance for any help you guys can give me.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,254
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
what do you mean by "terms"? if it is the labels of stats and the UI, yes, you can do it.

it's not standard, though.... but you can.
 

Marche100

Villager
Member
Joined
Aug 11, 2013
Messages
13
Reaction score
4
First Language
English
Primarily Uses
Yeah, I'm talking about the labels of stats and the UI, basically. When you go into the database and open the 'Terms' tab it lets you rename stuff like 'Weapons', 'Items', 'Save', etc. But if it's possible to change them, I'm not seeing how. At least, not in event commands.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,254
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
Go into the Vocab module and take a look at the definitions.
You'll see a couple of functions that return $data_system.something.
Go to the help files and search RPG::System or RPG::System::Terms.
You'll see the same definitions as in the database tab "System"
From there, you can infer that everything that appears in the game, is defined in Vocab, after the objects defined by the database.
With that, you can punch in an instruction, overriding the origin of the data

Here's an example:
Say you want to change the label of "HP".
You go into the database, and change the label of HP....... but, what is exactly "changing the label of HP"?
Look at the code:
Code:
def self.hp; basic(2); end   # HP
That is the .hp function, within the Vocab module.... upon calling Vocab::hp somewhere else (that is effectively "function hp of module Vocab", in code) the function returns basic(2), which is another function, so it returns the result of that.
And basic() is actually
Code:
def self.basic(basic_id)
  $data_system.terms.basic[basic_id]
end
Which is written in function of $data_system, which is the database.
SO!:
Whenever you read "HP" in the game, you're actually reading "what Vocab::HP says", and "what Vocab::HP says" is "Whatever the basic group, parameter 2 is", and "Whatever the basic group, parameter 2 is" is "Whatever the database says it is"
BUT!
If instead of "whatever the database says it is", you make it "Whatever you say it is", .....

Code:
module Vocab
 self.hp
  get_parameter(2)
 end
 
 self.get_parameter(typeid)
  str = $data_system.terms.basic[typeid]
  if !$game_switches[1]
   return str
  else
   return "alternate" + str
  end
 end
end
Vocab::HP is get_parameter(2), which is "whatever the database says" when switch 1 is off, and " alternate 'whatever the database says' " when switch 1 is on.

Make sure you make the condition for changing the string something valid and defined by the time the call of Vocab::HP happens, otherwise you'll get a "function not defined" error.
Read the help files. I believe you can figure it out with that.
Same logic applies to everything else.... the items, the skills, the actors, everything is read from the database.
if you want to change them, punch in an instruction and redirect the call.
 

Marche100

Villager
Member
Joined
Aug 11, 2013
Messages
13
Reaction score
4
First Language
English
Primarily Uses
Thanks! That makes sense for the most part. I'm not very good with code, though, (I'm not a fan at all of coding in fact) so I've got a few questions. I presume I'm putting that get_parameter function in the Vocab module as well. My question is what is the 'typeid' it takes as a parameter? I presume I have to change that, as I get an (undefined local variable/method) error otherwise. Also, is it possible to return simply "alternate" rather than "alternate" + str? "alternate" would be seen as a string, too, right?

Thanks again!
 
Last edited:

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,254
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
I presume I'm putting that get_parameter function in the Vocab module as well
no.
since I wrote it as a block, it's already including the definition of Vocab.
if you drop this after Vocab itself, it'll basically overwrite that specific function, and add the new one.
(you can take it from here, and put it there, you just don't need to)

My question is what is the 'typeid' it takes as a parameter?
the internal variable I use to check what it is supposed to bring from the database.
that reads "function get_parameter; whatever parameters passed, read as typeID"
then within that function, whenever the name typeID comes up that means "whatever has been pased to us from other functions"
self.get_parameter(2) is (2) because 2 is the original pointer to HP, from the original code.

remember that everything can be tracked back to established values, either in the database or ruby's own code.... nothing is just made up!
(my mistake, it should be self.get_parameter(2).... it has to include SELF. before the call to the function, since it is a module)

Also, is it possible to return simply "alternate" rather than "alternate" + str? "alternate" would be seen as a string, too, right?
you make it return whatever you want.
I made it like this so that it would include the previous string "HP", which comes from the database: $data_system.terms.basic[2]
if you make a variable start with a string, anything you + to it will be converted to string.

if you want to pass an object or a variable into a string, you can use the sprintf command (look it up in the help files), or, break the string with the #{} tag
Code:
"string reading '#{$data_system.terms.basic[2]}' as string"
returns "string reading 'HP' as string"

anything within the #{ } will be read as code, and returned as it comes.
you can bring multiple variables and operate with them in place, and the result will still be read as string.
 
Last edited:

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D

Forum statistics

Threads
106,051
Messages
1,018,551
Members
137,837
Latest member
Dabi
Top