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.

Some commands I need to know

I am making a pet system for my MMORPG game. i need to know some commands in RGSS that I can add to a window, so that I can make this system as good and as unique as possible.

I know how to do a lot of stuff, but here's what I want to know:

Names
How can I show a character's name from the database in text? For example:

Pet Name: Brian

Where Brian is the name of character #2 in the database.

Also, how can I show other things such as their HP, MP, EXP, and other stuff like that?

Name input menu
How can I tell it, in a window, to open the input character name window for a certain character?

Shop Window
How can I tell it, in a window, to open the shop window with certain items in it?



Thanks, I think that is all for now. I think i know how to make multiple choice things like menus, so that wont be a problem.

Basically it is going to be like this. It shows the pet's stats and an image for the pet, and also the pet type in a window at the top. It then has options underneath for:
-Pet store
-Change pet's name
-etc.
 
Very basic stuff... let's see if I remind everything ^_^

Name: $data_actors[2].name
HP/MaxHP: $data_actors[2].hp.to_s / $data_actors[2].maxhp.to_s (the to_s is for converting it to a string. If this method doesn't work and you get a integer conversion error, use a checkpoint variable;
Other inputs work similar.)

You can do both actor-based Name Input and Shop with specific items by Event Commands, so I have no idea why you need to script it... well, for the name thing, look into class Scene_Name, find this line:

Code:
@actor = $game_actors[$game_temp.name_actor_id]

You can replace what's inside the [] by an actor ID. If you wish to do it for more than one specific character, I suggest you use a $game_variable which you can change both ingame and by script. That'd look like the following...

Code:
specific_actor = $game_variables[107]
@actor = $game_actors[specific_actor]

This code uses the variable with ID 107 to store the actor_id of the actor that should been used. Of course, you have to set this variable up before you call Scene_Name.

Can't help you with the shop thing, haven't looked into that class for ages...
 
you can get goods by using an array with with following format:
[type, id] ==> type0 is item, 1 is weapon and 2 is armor. Id is self explanitory.
Example shop:

$game_temp.shop_goods = [[0,1], [0,2], [1,1]]
$scene = Scene_Shop.new
 
Sorry for this, I know I must seem like a right noob, but how can I make a conditional branch within a script so that if a variable is 0, it says one thing, and if a variable is 1 it says another thing?

And how can I change that variable to a random number using a script command?

What I was thinking was this.

When the scene is called before it I will have a script to change variable 5 to a random number between one and five.

Then, inside the script it would have something like this:

if (variable 5 = 0)
blah blah message number 1
elseif (variable 5 = 1)
blah blah message number 2
elseif (variable 5 = 2)
blah blah message number 3

and so on, to create a random message. It would say something like "Your pet is very happy to see you" or "Your pet is feeling very sad and lonely" for example, randomly.
 
I need to know how to change that variable to a random number between 0 and 5 using a script now...

Also, how do I get rid of the annoying arrows on the window at the edges?

Oh and er... @bluescope

That wont work for what I am trying to do as that would replace scene_name.
What I mean is, in the pet system script I will have a selectable menu. One of them will be "Change pet's name". When that is chosen it will open up the name window for actor #2.
 
@Wyatt: If you have arrows, it means you have a text field or something like that that exeeds the window width-40. Resize your text fields, bitmaps, ... and you should get rid of 'em, if it's not a Window_Selectable of any kind.

For the name thingy, you could solve this by adding a switch to Scene_Menu and trigger the actual Scene_Name by it, like this:

Code:
if $game_switches[777] == true
  @actor = $game_actors[2]
else
  @actor = $game_actors[$game_temp.name_actor_id]
end

This is also more easy to use with a from-Scene_Menu access. Don't forget to set the switch to false when exiting Scene_Name.
 

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