RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Dual Enemy Data

0 Members and 1 Guest are viewing this topic.

****
Hey... my name's... Sashikinaroji...
Rep:
Level 83
fear me...
Basically, I was wondering if there was some sort of script out there, similar to the Bestiary scripts I've seen lyin' about, which can display two sets of data at the same time?

That is, I want a display to show up when a I say so, that shows the stats of two chars, side-by-side, so the character can make an informed decision on who to root for.

I would like it to look something like this:


(as you may be able to tell, I pasted this together in MS Paint...)

and I want to have the characters that are displayed be automated based on variables (where the variables choose the monster ID, and the script displays their stats on the screen)

Anybody wanna take this up?
Ok, DON'T EXPECT HELP FROM ME~! I will perhaps rant a bit, but don't expect me to do graphics for you, even if I say I will... I won't.

***
Rep:
Level 82
aka DigiDeity
This is a modified snipset I've written some weeks ago.
It's not well tested but it should show you the needed informations.
Just setup the settings and call the windows ingame with "Script ..." command.
Everything is written in the script.

Code: [Select]
#Using#
=begin
  You can create a window for monsterinfos if you just
  use the "Script..." Eventcommand. Add this line to the script:
  create_monsterinfo_window(x,y,width,height,monster_id,window_id)
  for example:
  create_monsterinfo_window(0,0,250,200,1,"window1")
  would create a window which has the coordinats 0 and 0. The width would be 250
  and the hight 200 and the id of this window would become "window1".
  The Monster would be Slime. :)
  If you wish to dispose a window just use this command:
  dispose_monsterinfo_window(id)
  While you created a window you should give the window an id.
  Just add this id into the command.
=end
module Deity
  module MI_Window
    PICTURE_SETTINGS = [
    60, # x-coord of the picture
    10, # y--cord of the picture
    130, # width of picture
    130, # height of picture
    true, # Make picture fit to given place?
    true, # Use background and Edge?
    Color.new(100,100,100,100), # Backroundcolor
    Color.new(200,200,200,200) # Edgecolor
    ] #<= Do not delete!
    # Color of the prefix (ATK,DEF)
    ATRIBUTE_COLOR = Color.new(200,20,20,250)
    # Setup the infos you wish to be shown:
    # Followings infos are possible:
    # [NAME,HP,MP,ATK,DEF,SPI,AGI,HIT,EVA,EXP,GOLD]
    # Just choose your favorit order and place the prefix in the
    # first place and the info of this prefix into the second.
    # For example if you want to show the name of a monster,
    #add just this line:
    # ["Name:","NAME"],
    PRE_AND_INFO = [
    ["Name:","NAME"],
    ["HP:","HP"],
    ["MP","MP"],
    ["Atk:","ATK"],
    ["Def:","DEF"],
    ["SPI:","SPI"],
    ["AGI:","AGI"],
    ["HIT:","HIT"],
    ["EVA:","EVA"],
    ["EXP:","EXP"],
    ["GOLD:","GOLD"],
    ] #<= Do not delete!
  end
end
include Deity::MI_Window
class Window_MonsterInfo < Window_Base
  def initialize(x,y,width,height,monster_id,id = "")
    super(x,y,width,height)
    @monster = $data_enemies[monster_id]
    @id = id
    @m_id = monster_id
    draw_infos
  end
  def id
    return @id
  end
  def m_id
    return @m_id
  end
  def draw_infos
    self.contents.clear
    if PICTURE_SETTINGS[5] && PICTURE_SETTINGS[4]
      self.contents.fill_rect(PICTURE_SETTINGS[0]-3,PICTURE_SETTINGS[1]-3,PICTURE_SETTINGS[2]+6,PICTURE_SETTINGS[3]+6,PICTURE_SETTINGS[7])
      self.contents.fill_rect(PICTURE_SETTINGS[0],PICTURE_SETTINGS[1],PICTURE_SETTINGS[2],PICTURE_SETTINGS[3],PICTURE_SETTINGS[6])
    end
    enemy_pic = Cache.battler(@monster.battler_name, @monster.battler_hue)
    if PICTURE_SETTINGS[4]
      src_rect = Rect.new(0,0,enemy_pic.width,enemy_pic.height)
      rect = Rect.new(PICTURE_SETTINGS[0],PICTURE_SETTINGS[1],PICTURE_SETTINGS[2],PICTURE_SETTINGS[3])
      self.contents.stretch_blt(rect,enemy_pic,src_rect)
    else
      x = (self.width - enemy_pic.width)/2
      y = (self.height - enemy_pic.height)/2
      rect = Rect.new(0,0,enemy_pic.width,enemy_pic.height)
      self.contents.blt(x,y,enemy_pic,rect)
    end
    for o in 0...PRE_AND_INFO.size-1
      i = PRE_AND_INFO[o]
      self.contents.font.color = ATRIBUTE_COLOR
      self.contents.draw_text(0,20*o,60,20,i[0],0)
      text = ""
      case i[1]
      when "NAME"
        text = @monster.name
      when "HP"
        text = @monster.maxhp
      when "MP"
        text = @monster.maxmp
      when "ATK"
        text = @monster.atk
      when "DEF"
        text = @monster.def
      when "SPI"
        text = @monster.spi
      when "AGI"
        text = @monster.agi
      when "HIT"
        text = @monster.hit
      when "EVA"
        text = @monster.eva
      when "GOLD"
        text = @monster.gold
      when "EXP"
        text = @monster.exp
      end
      self.contents.font.color = Font.default_color
      self.contents.draw_text(60,20*o,60,20,text,0)
    end
  end
end
class Game_System
  attr_accessor :monsterwindow_infos
  alias initialize_monsterinfo_window initialize unless $@
  def initialize
    initialize_monsterinfo_window
    @monsterwindow_infos = []
  end
end
class Scene_Map
  alias initialize_monster_window initialize unless $@
  def initialize
    initialize_monster_window
    for i in $game_system.monsterwindow_infos
      $game_map.interpreter.create_monsterinfo_window(i[0],i[1],i[2],i[3],i[4],i[5],false)
    end
  end
  alias terminate_monster_windows terminate unless $@
  def terminate
    terminate_monster_windows
    for i in $game_map.interpreter.monsterinfo_windows
      i.dispose
    end
    $game_map.interpreter.monsterinfo_windows = []
  end
end
class Game_Interpreter
  attr_accessor :monsterinfo_windows
  alias initialize_mi_win initialize unless $@
  def initialize(depth = 0, main = false)
    initialize_mi_win(depth = 0, main = false)
    @monsterinfo_windows = []
  end
  def create_monsterinfo_window(x,y,width,height,monster_id,window_id,switch = true)
    @monsterinfo_windows.push(Window_MonsterInfo.new(x,y,width,height,monster_id,window_id))
    $game_system.monsterwindow_infos.push([x,y,width,height,monster_id,window_id]) if switch
  end
  def dispose_monsterinfo_window(id)
    for i in 0...@monsterinfo_windows.size
      if @monsterinfo_windows[i].id == id
        @monsterinfo_windows[i].dispose
        @monsterinfo_windows.delete_at(i)
        @monsterinfo_windows.compact
        $game_system.monsterwindow_infos.delete_at(i)
        $game_system.monsterwindow_infos.compact
        break
      end
    end
  end
end     

Deity
« Last Edit: April 18, 2010, 12:23:35 AM by Deity »
Greetings
DigiDeity

├Work┤
├Contact┤


****
Hey... my name's... Sashikinaroji...
Rep:
Level 83
fear me...
and if I were to plug in the label for a variable in the monster ID queue, would that work?

EDIT: It seems that if there is a variable tag in the script, it will not work... Any suggestions on how I can make it work? Or should I just go with the plethora of conditional branches?
« Last Edit: April 18, 2010, 12:27:38 AM by Sashikinaroji »
Ok, DON'T EXPECT HELP FROM ME~! I will perhaps rant a bit, but don't expect me to do graphics for you, even if I say I will... I won't.

***
Rep:
Level 82
aka DigiDeity
Jes you can use any id you wish. The only condition is that the id is an integer or float type. ^^
Let me know if something wrong.

Deity
Greetings
DigiDeity

├Work┤
├Contact┤


****
Hey... my name's... Sashikinaroji...
Rep:
Level 83
fear me...
For the monster ID, I plugged in "\v[24]" (variable 24 is randomized between 1 and 7, and set right before the window is created), however it causes a ????????SyntaxError???? ????
Ok, DON'T EXPECT HELP FROM ME~! I will perhaps rant a bit, but don't expect me to do graphics for you, even if I say I will... I won't.

***
Rep:
Level 82
aka DigiDeity
Of course!
The monster_id value have to be a number(integer or float). If you take quotationmarks it become a string and produce an error.
Btw I've changed the Script again copy it one more time. ^^

Deity
Greetings
DigiDeity

├Work┤
├Contact┤


****
Hey... my name's... Sashikinaroji...
Rep:
Level 83
fear me...
 :(

I meant the quotation marks in the way they are traditionally used... As an indication of a direct quote. The exact thing I put in the monster ID slot was \v[24]

Although... I could see how that could be miscontrued...

but regardless, even with the new script, the variable tag doesn't work... and, as a side note, how would one go about changing the pic to be a faceset rather than a battler?
Ok, DON'T EXPECT HELP FROM ME~! I will perhaps rant a bit, but don't expect me to do graphics for you, even if I say I will... I won't.

***
Rep:
Level 82
aka DigiDeity
Ah now i understand the error....
You used \v[id] which the interpreter don't understand X_X
You have to use: $game_variables[id] to get the value of this variable. ^^
ANyway i made a demo for you maybe it helps:
http://deity.jimdo.com/app/download/4028304056/4bca65e2/8cffb264f0fca87178db1db0b435902b753faa0e/MonsterInfo.rar

Deity
Greetings
DigiDeity

├Work┤
├Contact┤


****
Hey... my name's... Sashikinaroji...
Rep:
Level 83
fear me...
Yeah... That worked much better haha  ::)

Anyways, thanks for the help/script!
Ok, DON'T EXPECT HELP FROM ME~! I will perhaps rant a bit, but don't expect me to do graphics for you, even if I say I will... I won't.

***
Rep:
Level 82
aka DigiDeity
Np.
Have fun.

Deity
Greetings
DigiDeity

├Work┤
├Contact┤