Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Scripting Query [Actors]

Mac

Member

I was messing around with some scripts and i am currently making a list of RGSS codes and their functions but i ran into something that has me kinda puzzled. So here goes:-

To change an attribute such as the name of your character in your game you have to use the $game_actors as $data_actors wont work because it has been wrote to the database and they are set values. But this is the part that puzzles me...if you use the following code below it somehow overwrites the database and displays the new value. Is there a reason why classes make an exception?

Code:
$data_classes[1].name = "New Class"
 
I think that the actor classes as it appears in the editor, only defines the base stats based on the actor data set values, and the plus values. The plus values, however, is defined within the script class. Such as $game_actors.hp_plus.

I wouldn't know why the classes make an exception, but as it is, you can change an actor's name; can you not? I know that ain't through the $data_actors (least I think it ain't?), but most of these things happen through scripting by obtaining the set values from the database.

I'll have to check this out a bit further to check why it works with classes.
 
First, that's because the $data_actors attributes are stored in the Game_Actor class ($game_actors variable), while the class name is not stored there. Take a look at the following method in Game_Actor:
Code:
  def class_name
    return $data_classes[@class_id].name
  end
Scond, you know that if you change anything in the $data_ globals, save your game and restart it, you will lose the changes, unless you use Seph's dynamic database.
 
tibuda, more like "if you change anything in the $data_ globals, save your game and restart it, you will lose the changes, unless you save the new globals, too, which i.e. Seph's dynamic database does." ;)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top