Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Rairun

1
RMXP Script Database / Re: [XP][VXA] Localization
December 23, 2015, 02:53:26 pm
Thanks for the info!

Also, you were right, your change fixes the issue! I initially got a crash, but it was because I made a mistake setting up the text offset - nothing to do with the localization part. Cheers.
2
RMXP Script Database / Re: [XP][VXA] Localization
December 23, 2015, 05:04:43 am
Sorry if I'm being stupid, but I just want to be 100% sure - does having no terms of use amount to being free to use commercially? I ask because I don't have any terms of use for my photography, for example, but I'm pretty sure I could still enforce copyright if I wanted to.

Also, thanks! I'm going to try again tonight when I'm on my laptop, but I think I've tried your exact solution, and it didn't work. :( If I remember it correctly, it threw a script error here:

      self.x = character.screen_x - self.width / 2 + character.offset_text[0]


EDIT: Actually, no, that would make no sense. I think the script error happened when I included \loc[1] in the comment without modifying the script. When I modified the script, I believe I got a method error? I'll check again tonight.
3
RMXP Script Database / Re: [XP][VXA] Localization
December 22, 2015, 09:02:47 pm
Great script! I have two questions:

- If I decide to go commercial with my game (not sure I will), am I allowed to use the VXA version of this script?

- I have been able to make this script work with pretty much all text I'm using in my game, except for this modified version of an Atelier RGSS script. Would it be complicated to make both scripts work together? I need to be able to have a comment like <Text = \loc[1]>

#==============================================================================
# +++ MOG - Event Text Popup (v1.1) +++
#==============================================================================
# By Moghunter
# https://atelierrgss.wordpress.com/
#- English
#1 - You're free to use all Atelier-Rgss scripts in commercial or non-commercial projects.
#2 - You're free to edit and adapt my scripts.
#==============================================================================
# Apresenta o um texto em cima do evento.
#==============================================================================
# Para ativa basta colocar um comentário com o prefixo:
#
# <Text = X>
# <Offset_text = x, y>
#
# X - Texto apresentado no evento.
#
# Exemplo
#
# <Text = Teleport>
# <Text = Save Point>
#
#==============================================================================
module MOG_EVENT_TEXT_POPUP
 #Definição da fonte.
 FONT_SIZE = 16
 FONT_BOLD = true
 FONT_COLOR = Color.new(255,255,255)
 #Definição da prioridade do Texto
 SCREEN_Z = 550
end  

#==============================================================================
# ■ Game CharacterBase
#==============================================================================
class Game_CharacterBase  
 attr_accessor :text
 attr_accessor :opacity
 attr_accessor :erased
 attr_accessor :offset_text
end

#==============================================================================
# ■ Game Event
#==============================================================================
class Game_Event < Game_Character  
 
#--------------------------------------------------------------------------
# ● Setup Page Setting
#--------------------------------------------------------------------------                    
 alias mog_event_text_setup_page_settings setup_page_settings
 def setup_page_settings
     mog_event_text_setup_page_settings
     setup_event_text
     setup_event_offset_text
 end
   
#--------------------------------------------------------------------------
# ● Setup Event Text
#--------------------------------------------------------------------------                      
 def setup_event_text
     return if @list == nil
     for command in @list
     if command.code == 108
        if command.parameters[0] =~ /<Text = ([^>]*)>/
           @text = $1
 
        end  
      end
     end
  end

  #
def setup_event_offset_text
     return if @list == nil
    for command in @list
    if command.code == 108
       if command.parameters[0] =~ /<Offset_text = (\-?\d+), (\-?\d+)>/
           @offset_text = [$1.to_i, $2.to_i]
           p @offset_text
        end
      end
     end
 end  
 
  #
 

end  

#==============================================================================
# ■ Sprite Character Text
#==============================================================================
class Sprite_Character_Text < Sprite_Base
 
 include MOG_EVENT_TEXT_POPUP
 
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------                    
 def initialize(viewport = nil,character,sprite)
     super(viewport)
     text_size = character.text.to_s.split(//)
     w = 32 + (FONT_SIZE / 2) * text_size.size rescue nil
     w = 32 if w == nil or w < 32
     self.bitmap = Bitmap.new(w,32)
     self.bitmap.font.size = FONT_SIZE
     self.bitmap.font.bold = FONT_BOLD
     self.bitmap.font.color = FONT_COLOR
     self.bitmap.draw_text(0,0,self.width,self.height,character.text.to_s,1) rescue nil
     update_position(character,sprite)
 end
 
#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------                    
 def dispose
     super
     self.bitmap.dispose
 end  

#--------------------------------------------------------------------------
# ● Update Position
#--------------------------------------------------------------------------                    
 def update_position(character,sprite)
     if character.erased
        self.visible = false
        return
      end
     self.x = character.screen_x - self.width / 2 + character.offset_text[0]
     self.y = character.screen_y - (sprite.height + self.height) + character.offset_text[1]
     self.z = character.screen_z + SCREEN_Z
     self.visible = character.transparent == true ? false : true
     self.opacity = character.opacity
 end

end

#==============================================================================
# ■ Sprite Character
#==============================================================================
class Sprite_Character < Sprite_Base

#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------                    
 alias mog_event_text_initialize initialize
 def initialize(viewport, character = nil)
     mog_event_text_initialize(viewport, character)
     @character_text = ""
     @character_offset_text = [0,0]
     create_event_text
 end  
 
#--------------------------------------------------------------------------
# ● Create Event Text
#--------------------------------------------------------------------------                    
 def create_event_text
     return if @character == nil
     return if @character.text == nil
     return if @character.text == @character_text
     dispose_event_text
   if Input.press?(:X)
     @event_text = Sprite_Character_Text.new(viewport,@character,self)
     @character_text = @character.text
     @character_offset_text = @character.offset_text
   end
 end

#--------------------------------------------------------------------------
# ● Dispose
#--------------------------------------------------------------------------                  
 alias mog_event_text_dispose dispose
 def dispose
     mog_event_text_dispose
     dispose_event_text
 end  
 
#--------------------------------------------------------------------------
# ● Dispose Event Text
#--------------------------------------------------------------------------                    
 def dispose_event_text
     return if @event_text == nil
     @event_text.dispose ; @event_text = nil
     @character_offset_text = [0,0]
 end
 
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------                    
 alias mog_event_text_update update
 def update
     mog_event_text_update
     create_event_text ; update_event_text
 end  
 
#--------------------------------------------------------------------------
# ● Update Event Text
#--------------------------------------------------------------------------                    
 def update_event_text
     return if @event_text == nil
     if Input.press?(:X)
     @event_text.update_position(@character,self)
   else
     @character_text = ""
     end
 end
   
end

$mog_rgss3_event_text_popup = true
4
RMXP Script Database / Re: [XP][VX][VXA] MCI Audio Player
February 16, 2015, 04:33:48 am
No worries! Also, I'm pretty sure you can simplify the event even further. On the same page:

Conditional Branch: if Input.trigger?(YOUR_BUTTON)
> Play SE
> Self Switch A = ON
End

Conditional Branch: if Input.release?(YOUR_BUTTON)
> Fade SE
> Self Switch A = OFF
End

I'd also include a wait command in there to reduce lag (start at 15 and go down until you don't notice a delay).
5
RMXP Script Database / Re: [XP][VX][VXA] MCI Audio Player
February 11, 2015, 10:19:12 am
A second fade command might override the first (instead of only being run when the first is finished). I can't try it right now, but place this right after the ".play" script call:

Audio['La#2´].fade(1,100)

6
RMXP Script Database / Re: [XP][VX][VXA] MCI Audio Player
February 04, 2015, 12:39:43 pm
Thanks for replying so quickly!

I'm pretty sure it happens with MP3 and WAV files (MP3s are tricky to loop anyway, because there's always a bit of silence when they are encoded.) I haven't tried it with OGG files because I want to avoid codec dependencies. I'm not using the MCI Audio Player as a full replacement, so if the user doesn't have a codec, I don't want some sounds to play but not others.

And yes, I'm aware the script is only a wrapper, but I was wondering whether there was a possible workaround. When I use the seek command, I don't hear a gap, so maybe there is a way to trigger it right before the song is over, taking us to the start without ever "officially" starting over? That way we could avoid the troublesome MCI repeat command, looping the audio seamlessly.
7
RMXP Script Database / Re: [XP][VX][VXA] MCI Audio Player
February 04, 2015, 07:37:01 am
This is amazing! Seriously, one of the best scripts I've ever seen.

I have two questions:

1. Is there a way to loop sounds seamlessly? When using the RPG Maker VX Ace sound engine, I can loop .wav files without problems. When I use MCI, I can still loop the file, but not seamlessly. There's always a gap.

2. Can this script be used commercially? I'm very far from finishing my project, but if I'm happy with it, I'd consider releasing it commercially.