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!!! Enemy database ID name recall to display text box

how can i recall the enemy database ID name on to diplay text box? Example, the actor will say on the display box of the enemy name on the ID recalled from the enemy database.... is there a special code? Like for example, i use variables for gold to describe how much is in the variable by typing it on the display text box using the code \v[50] gold. it would show on the display text box how much gold i have but i cant seem to know the code for the enemy database ID name into the display text box... help would be much appreciated =)
 
So.....

You want to enter (something like), "Hey! Look, it's a \e[50].", and have the message show, ""Hey! Look, it's a Kobald." ??

That would require a minor modification to the message script.
 
yes thats it brewmeister.... basically, identifying the enemy in database to the message box just exactly what you said. Thanks a bunch for understanding what i had in mind LoL :biggrin: Sooo, what do i have to do?
 
Script Request. It's just a matter of adding the \e[n] code to the Window_Message script. I'd do it for you, but I currently don't have RMXP installed. (hard drive crash, reinstall, won't register/activate..., contacted Protexis, waiting....)
 
if you are using the normal system, this will work:

Code:
class Interpreter

  alias inter_cmd_101         :command_101

  def command_101

    @list[@index].parameters[0].gsub!(/\\[Ee]\[([0-9]+)\]/) do

    $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].name : ""

    end

    inter_cmd_101

  end  

end
if you use and AMS or UMS this might not work. im not at home to test, but should work
 
an error came up while trying to test the script... error showed

endefined method `command_101' for class `interpreter'


if it did work how would call the enemy database ID to the display box? What would i type?
 
I just tried it with RMXP and the no error came up when I playtest the script... the game work fine but i just dont know how to recall it to display test... i tried using e\[1] and Ee\[1] and it didnt work... Is this script only for RMXP? I was wondering if you can make it compatible for RMVX also thanks for all your help :thumb:
 
ok, i did NOT do this the good programming way, i didnt alias it because i couldnt get it to work and i dont feel like learning rgss 2. so this code will work, but its not the cleanest way to do it. so if you are ok with "it works" then here you go, if not im sure some one who knows rgss two can shorten it to just a few line of code.

Code:
class Game_Interpreter

 def command_101

    unless $game_message.busy

      $game_message.face_name = @params[0]

      $game_message.face_index = @params[1]

      $game_message.background = @params[2]

      $game_message.position = @params[3]

      @index += 1

      while @list[@index].code == 401       # Text data

        @list[@index].parameters[0].gsub!(/\\[Ee]\[([0-9]+)\]/) do

        $data_enemies[$1.to_i] != nil ? $data_enemies[$1.to_i].name : ""

        end

        $game_message.texts.push(@list[@index].parameters[0])

        @index += 1

      end

      if @list[@index].code == 102          # Show choices

        setup_choices(@list[@index].parameters)

      elsif @list[@index].code == 103       # Number input processing

        setup_num_input(@list[@index].parameters)

      end

      set_message_waiting                   # Set to message wait state

    end

    return false

  end

end  
 
Thanks for reply Vergessen... i just tried your script and the game works fine until i put \e[1] in the text box and this error comes up...
error states
unefined method `busy' for #<Game Message:0x35ac654>

basically what im trying to do is make a troop battle event... when the party engage in battle and go's to the battle scene... before the command menu pops up, i want it to say what type gender is each enemy the party is fighting... basically, for example... if there was 3 same slime on the scene.... then the system will break them up as SlimeA, SlimeB, and SlimeC.... I was going to make a battle event which calls the enemy database ID to the text box and will have random genders for each slime which will state on the beginning of battle on the text box, for example "SlimeA is a male, SlimeB is a female, SlimeC is a male" and i was going to add additional attributes to the different genders of the same type of monster which would make every battles different and interesting even if its just a slime that the party is fighting... i hope you get the picture so you have any ideas how to go by about getting this done? I just need how to call enemy database to the text box, how to call each battle position to the text box example: SlimeA, SlimeB and SlimeC to the text box, and last which i already have a script for is a gender description... i dont need the gender cuz i already figured out how to call it to text box... i just need the other two.
 

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