Help editing a script
#1
Hi people! I have a script that allows short messages to appear in the lower-right corner without pausing the game action, making the gameplay smoother. I decided to add an Icon to make it nicer, however, due to my lack of expertise in RGSS, the icon always appears and I want it to appear AND disappear along with the text, I think it's a very easy scripting but I do not know how to do it :v

The code:


Code:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#|Autor: RD12| Mensagens na Tela v1.5
#-------------------------------------------------------------------
#Chame o script: Msg_txt("Texto", cor) onde cor = red, blue..
#É opcional por a cor, se você não por, ficará branca.
#--------------------------------------------------------------------

module WIN_MSG
X = 373
Y = 0
L = 300#largura
Windowskin = "windowskin" #"001-blue01"
#Tempo em segundos para ir deletando as mensagens
Clear_Time = 7
end

#::Cores::
def red; return Color.new(255, 0, 0); end
def green; return Color.new(0, 255, 0); end
def blue; return Color.new(0, 0, 255); end
def black; return Color.new(0, 0, 0); end
def white; return Color.new(255, 255, 255); end

class Window_Msg < Window_Base

def initialize
super(WIN_MSG::X,WIN_MSG::Y,WIN_MSG::L,30*2)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 126
self.windowskin = RPG::Cache.windowskin(WIN_MSG::Windowskin)
color = Color.new(255, 255, 255)
$Msg_log = [["", color], ["", color], ["", color], ["", color]]
self.y = 420
Msg_txt("")
refresh
end

def refresh
self.contents.clear
self.contents.font.name = "Corbel"
self.contents.font.size = 15
#::Escrever as Mensagens::
bitmap = RPG::Cache.icon("info.png")
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 24, 24), 255)
self.contents.font.color = $Msg_log[$Msg_log.size-1][1]
self.contents.draw_text(40, 0, 310, 32, "#{$Msg_log[$Msg_log.size-1][0]}")
end

end

def Msg_txt(text, color=Color.new(255, 255, 255))
$Msg_log << [text, color]
end

class Scene_Map
alias me_main main
def main
@win_msg = Window_Msg.new
me_main
@win_msg.dispose
end
alias msg_update update
def update
msg_update
@win_msg.refresh
if Graphics.frame_count % (40*WIN_MSG::Clear_Time) == 0
Msg_txt("")
end
end
end

and an image:
[Image: obci.png]
I'm looking for a scripter to help me with my proyect. Need some minor adjustments-modifications and some larger codes. The larger ones will be remunerated :) Thanks beforehand.
Reply }
#2
try adding a 'refresh' after 'if Graphics.frame_count % (40*WIN_MSG::Clear_Time) == 0
Msg_txt("")'

also next time, when posting code, use the
Code:
[code]
[/code] tags.
Reply }
#3
It didn't work but I replaced the script with a new one, thanks anyway! ^^
I'm looking for a scripter to help me with my proyect. Need some minor adjustments-modifications and some larger codes. The larger ones will be remunerated :) Thanks beforehand.
Reply }
#4
DerVVulfman and I cooperatively created a GameLog window that worked for pretty much just what you want to do. and I believe with a little tweaking you should be able to get it to recognize icons in the messages too. You should be able to find the Lycan ABS 4.7 here somewhere, and in the addons, JayRay's Lycan GameLog is available. The best thing about that one, is it works without the rest of the scripts as far as I know.
[Image: AVvXsEga1vIr5Rx3FkoFbGo1OoMJAqgq6TeqcbpF...L3AWg=s752]

BLOG: JayVinci.blogspot.com
FORUM COMING SOON
Currently working on:
Ambitions: RPG Developer Bakin
Heart of Vox: RPG Developer Bakin
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Plugin or Script help with Item menu, SKill menu, and Equip menu JayRay 3 294 11-22-2024, 07:02 PM
Last Post: JayRay
   Script compatibility help Lord Vectra 3 4,735 07-25-2021, 11:42 PM
Last Post: DerVVulfman
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 16,103 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   "Wait" in the script Whisper 13 16,370 04-28-2020, 04:06 PM
Last Post: Whisper
   Skill Cooldown script Fenriswolf 11 16,750 12-10-2019, 11:10 AM
Last Post: Fenriswolf
   Help iwth script (RGSS Player crash) Whisper 3 8,610 06-17-2017, 05:03 PM
Last Post: Whisper
   Help modifying a script Keeroh 7 10,379 06-11-2017, 04:43 PM
Last Post: DerVVulfman
Question  Mog Menu script: help me stop the crazy picture movement during transitions Zachariad 4 10,026 05-31-2017, 05:10 AM
Last Post: Zachariad
   Actor names in Quest Script jreagan406 5 8,766 03-07-2017, 08:06 AM
Last Post: JayRay
   Bizarre issue with Lanzer counter script. Steel Beast 6Beets 2 7,307 10-04-2016, 11:46 AM
Last Post: Steel Beast 6Beets



Users browsing this thread: 1 Guest(s)