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.
[RMXP] Need help writing my Messaging Script [BEGINNER LEVEL]

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 82
I can't see a church social down here, can you?
Hello everyone, I`m new to these forums. This is my first script. For those who are bored to look for themselves at what it does, it creates a window for messages with the possibility to change the font each time, the person speaking (which also his name is highlighted in red and allows 3 lines of text to be displayed. My problem is, I don`t know how to make this window I`m creating act like a normal window. Meaning it will dissapear if I press "Action" button again, it will not overlay other windows etc. etc. Basically I want it to act like a normal "Show Text" event window. Right now, my window acts on it's own. I press action, call it, shows up, and dissapears after some time by itself. Also, if I press "Action" too many times, it will look as if it`s adding a layer of brightness to the text. Please help.
Code: [Select]
class My_Window < Window_Base
  attr_accessor :fontused
  attr_accessor :person
  attr_accessor :message
  attr_accessor :message2
  attr_accessor :message3
  def initialize(fontused = "Arial", person = " ", message = " ", message2 = " ", message3 = " ")
    @fontused = fontused
    @person = person
    @message = message
    @message2 = message2
    @message3 = message3
    if @message.size > 64
      print "Warning! More than 64 characters in line 1"
    elsif @message2.size > 64
      print "Warning! More than 64 characters in line 2"
    elsif @message3.size > 64
      print "Warning! More than 64 characters in line 3"
    end
    super(5, 365, 630, 110)
    #says the content will be drawn in Bitmap 32x32 Format
    self.contents = Bitmap.new(width-32, height-32)
    self.contents.font.name = fontused
    self.contents.font.size = 17
    self.contents.font.color = text_color(8)
    self.contents.draw_text(0,0, 630, 32, person)
    self.contents.font.color = text_color(0)
    self.contents.draw_text(0,17, 630, 32, message)
    self.contents.draw_text(0,34, 630, 32, message2)
    self.contents.draw_text(0,51, 630, 32, message3)
    end
  
end
« Last Edit: January 04, 2010, 12:24:02 AM by Reisuke »

******
Revolution is not a bed of roses.
Rep:
Level 91
Project of the Month winner for July 2009
Welcome, moved to the Script Help, do try to read the rules a bit better.

**
Rep:
Level 82
I can't see a church social down here, can you?
Sorry about that, I thought I had posted it under Script Help. My bad :D

**
Rep:
Level 82
I can't see a church social down here, can you?
I'm sorry for bumping this thread but I can't seem to find the way to do what I asked in the first place. If someone can help I'd be very grateful.

****
Rep:
Level 83
Make it run a refresh in the window and have it say "self.contents.clear"  whats happening is that every time it seems to get brighter its stacking on top of its self.

like this...

Code: [Select]
class My_Window < Window_Base
  attr_accessor :fontused
  attr_accessor :person
  attr_accessor :message
  attr_accessor :message2
  attr_accessor :message3
def initialize(fontused = "Arial", person = " ", message = " ", message2 = " ", message3 = " ")
super(5, 365, 630, 110)
    #says the content will be drawn in Bitmap 32x32 Format
    self.contents = Bitmap.new(width-32, height-32)
    self.contents.font.name = fontused
    self.contents.font.size = 17
    refresh
end # initialize

def refresh
    self.contents.clear
    @fontused = fontused
    @person = person
    @message = message
    @message2 = message2
    @message3 = message3
    if @message.size > 64
      print "Warning! More than 64 characters in line 1"
    elsif @message2.size > 64
      print "Warning! More than 64 characters in line 2"
    elsif @message3.size > 64
      print "Warning! More than 64 characters in line 3"
    end
    
    self.contents.font.color = text_color(8)
    self.contents.draw_text(0,0, 630, 32, person)
    self.contents.font.color = text_color(0)
    self.contents.draw_text(0,17, 630, 32, message)
    self.contents.draw_text(0,34, 630, 32, message2)
    self.contents.draw_text(0,51, 630, 32, message3)
  end # refresh
  
end # class

and then you'll need to up date this window when something changes, so where you press the "Input::C" in the scrip that is calling this one, make it up date when or if it changes the contents. Oh, and the reason to why its stacking on other windows and the map is because you need to dispose of the window when your done with it.


just look over the default window message in the scripts data base for help on this stuff.
« Last Edit: March 31, 2010, 10:14:29 PM by Mr_Wiggles »
Spoiler for:
METALFRESH is a paint contractor that specializes in refinishing metal and vinyl siding. We paint metal buildings as well as siding on homes.

We also

    Refinish decks
    Do custom interior painting
    Strip wallpaper
    Refinish cedar siding
    Metal front doors and sidelights
    Metal garage and service doors
    Grained fiberglass doors

    If your structure is *RUSTED *FADED *CHALKING *IN NEED OF COLOR CHANGE, we can fix it with a guarentee!

northern Illinois and southern Wisconsin.

http://metalfreshcoatings.com