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.

Help with Command_101

All right, so, I'm creating a Level-up and exp gainsystem that's narrated by messages. To do this, I'm running command 101 a few times in the level up process to display the relevant messages. Here's the bit of code for levelling:
Code:
if $game_party.actors.size > 1
       $command_101
       $game_temp.message_text = "r e i d m a n" + "   " "a n d" + "   " + "f r i e n d s" + "   " + "g a i n e d" +  "   " + exp.to_s + "   " + "e x p ."
     else
       $command_101
       $game_temp.message_text = "r e i d m a n" + "   " + "g a i n e d" +  "   " + exp.to_s + "   " + "e x p ."
     end
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
          $command_101
          $game_temp.message_text = "r e i d m a n" + "   " + "h a s" + "   " + "r e a c h e d" + "   " + "l e v e l" + "   " + actor.level.to_s + "   " + "!"
        end
      end
    end

(I haven't developed messages for other actors besides reidman levelling up.)

Unfortunately, when this is put into practice, there's a few problems:

a) The text gets all crumpled together, making it illegible. I can resolve this to some extent by spacing out the letters and words, as in + "h a s" + " " + "r e a c h e d", but I'd like to actually fix this problem instead of avoid it.

b) The real problem: when reidman does level up, the first message gets skipped, and the only message that shows up is the level up message. I'd like to show both.

c) I don't know how to use command_101 to create messages with more than one line. I'd like to put the level up message on a line below the exp message instead of making its own message box.

Can someone help me out? Thanks a bunch.
 
They ARE outside of quotation marks. Look at it again:

"r e i d m a n" + " " + "g a i n e d"

The reason the words are spaced out is because they bunch together when they aren't spaced out. One of my questions is just that: why do all my characters get bunched together? This attachment shows what I mean.
 
RPG-Advocate":3uy044sr said:
http://www.phylomortis.com/resource/script/class/class-in.html


Command_101 [Message]

Parameters:
0: The first line of the message text.
Local Variables:
Line_Count: The number of lines in the message.

How it Works: This method shows a message. If for some reason, this method has been called when there is no message to show, the method returns false. If a message is waiting, then the @message_waiting instance variable is set and the method begins assembling the message text. The $game_temp.message_text = @list[@index].parameters[0] + "\n" acquires the first line of the message from the parameter passed to the method and appends a newline character. The loop body assembles the rest of the contents of the message window. The first check is for an event command with a "code" of 401 (message line). This means that the message has another line. This line is appended to $game_temp.message_text and the line count is incremented. The check for an event command with code 102 (Show Choices) is performed so that if the number of choices plus the current line count is four or less, the choices will be shown in the same message window. The elsif statement that checks for a code of 103 (Input Number) makes it so that if there is available space in the message window, the number input prompt will appear in the same message window as the message text. If none of those conditions are true, then the method terminates.
if i understand correctly, you would need to set @list[@index+1].code to 401 for the next line in a multiline ;)

and remember:
RPG-Advocate":3uy044sr said:
rather than passing formal arguments to these methods, the engine loads the parameters into the @parameters instance variable. The parameters are represented as an array.
 

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