General RGSS/RGSS2/RGSS3 Help

Started by G_G, March 04, 2009, 12:14:28 am

Previous topic - Next topic

KK20

Without a message system script, there is no such thing as text speed in RMXP.

The alignment problem could be solved if the text wasn't drawn character-by-character.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

bigace

Quote from: KK20 on April 07, 2013, 02:42:58 pm
Without a message system script, there is no such thing as text speed in RMXP.

The alignment problem could be solved if the text wasn't drawn character-by-character.

Or VXAce for that matter, I guess I"ll have to make one.

I don't know why enterbrain did that but, until someone figures that out. The alignment is stuck that way. Or I guess I can just create a new help window.  :P


Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.

KK20

You are aware RMXP just shows the entire message at once, not by character, right? Hence why I said it doesn't exist--it's not even possible to begin with :P I thought I got somewhere by using wait(int) in VXA, but the "Input C to display entire message" wasn't working.

Yeah, you have to make edits to the classes anyways. Alignment is only made through draw_text so you would have to manually add the parameter to the class methods.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

bigace

April 07, 2013, 09:37:04 pm #583 Last Edit: April 08, 2013, 12:05:46 am by bigace
Ya the problem with the message script I'm having is that the game I'm remaking has a option in the menu like in Pokemon where you have three text speeds. Enterbrain does make things more difficult than they need to don't they.  :facepalm:

Edit: Pokemon Essential has a text speed option. However everything so confusing thats it's hard to work through and figure out how it works.


Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.

G_G

Pokemon Essentials has it's own custom messaging system.

bigace

Quote from: gameus on April 12, 2013, 08:13:04 am
Pokemon Essentials has it's own custom messaging system.

Ya I know I've already stated that in the post above yours.


Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.

G_G

Sorry, I just misunderstood what you were saying. xD

bigace

what does "LocalJumpError occurred. no block given." mean? I was writing a script and got this when I tried to load the game from the title screen.


Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.

KK20

May 15, 2013, 07:50:59 pm #588 Last Edit: May 15, 2013, 07:53:33 pm by KK20
Quote from: bigace on May 15, 2013, 07:23:51 pm
what does "LocalJumpError occurred. no block given." mean? I was writing a script and got this when I tried to load the game from the title screen.

A quick Google search says that it occurs when no block is given to a method that requires a block. What's a block? It looks like this

some_array.each {|array_element| do_some_stuff_here }

One of your methods is using 'yield' instead of 'return'.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

bigace

I have never used yield before so that's strange. I think I know what I need to rewrite though.


Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.

bigace

May 17, 2013, 04:23:22 am #590 Last Edit: May 17, 2013, 02:49:49 pm by bigace
Okay well nothing seems to fix this issue. The error seems to stem from when I use this
24.times.max_by {|i| do_some_stuff_here(i) } 


This is the code that gives the error from my save system script.

module ACE
module SaveManager
#--------------------------------------------------------------------------
# * Maximum Number of Save Files
#--------------------------------------------------------------------------
def self.savefile_max
return 24
end
#--------------------------------------------------------------------------
# * Get Update Date of Save File
#--------------------------------------------------------------------------
def self.savefile_time_stamp(index)
File.mtime(make_filename(index)) rescue Time.at(0)
end
#--------------------------------------------------------------------------
# * Get File Index with Latest Update Date
#--------------------------------------------------------------------------
def self.latest_savefile_index
savefile_max.times.max_by {|i| savefile_time_stamp(i) }
end

even if I do it the original way RMXP had it:
		#--------------------------------------------------------------------------
# * Get File Index with Latest Update Date
#--------------------------------------------------------------------------
def self.latest_savefile_index
#savefile_max.times.max_by {|i| savefile_time_stamp(i) }
$game_temp = Game_Temp.new
# Timestamp selects new file
$game_temp.last_file_index = 0
latest_time = Time.at(0)
savefile_max.times.max_by do |i|
filename = make_filename(i)
if FileTest.exist?(filename)
file = File.open(filename, "r")
if file.mtime > latest_time
latest_time = file.mtime
$game_temp.last_file_index = i
end
file.close
end
end
end

I still get the same error, removing the max_by just puts the cursor at the bottom of the list instead of at the last updated save file.


Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.

KK20

Not to mention, the method 'max_by' doesn't even exist in Ruby 1.8.1, which I believe is the version RMXP uses.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

bigace

Quote from: KK20 on May 17, 2013, 02:18:25 pm
Not to mention, the method 'max_by' doesn't even exist in Ruby 1.8.1, which I believe is the version RMXP uses.

:facepalm: Wow, this whole time I've been looking at 1.8.7. Okay that explains why this doesn't work.


Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.

Kiwa

January 02, 2014, 09:38:24 am #593 Last Edit: January 02, 2014, 09:42:57 am by Kiwa
Hey fellas.

since i've felt like such a piece of turd for always having to depend on you all for coding help. i have spent nearly every hour of my week vacation studying (i know its not a lot of time but it has truly helped) coding in RGSS.

i have discovered that the language is not so different than things i remember in other languages such as VB, Action script, and some C. but ...more simple.
but the real trouble i have in this language is finding what is threaded through other classes or modules and borrowed into the new one.

so in the end someing like...
actor  or game_actor and Game_Actors can be really confusing. the dot commands "self.content.font.size" can also be confusing... what is part of ruby or what is part of rmxp.

anyway thanks for listening to that rant. next is the question.



So im trying to make basic windows for a start. i've managed more or less. sizing, positioning, fonts, font size, ect... i managed to get icons aswell but i think i need to use another method if i want only icons and no text.. but for now the text way is what im looking for.

so what i want to add is attributes of the item. such as atk, str, pdef, ect.. to the text box
looking in the scripts i see alot of actor.str but thats not the item its self its the actors. looking at the code i would expect to see something like

ATKbonus = actorATK - EquipdWEP + NEWwep.
NewATK = actorATK + NEWwep.

or something.

but i find no such thing. only things like:

draw_actor_parameter(@actor, 4, 32, 0)

or

if @new_atk != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 32, 40, 32, "->", 1)
      self.contents.font.color = color_choose(@actor.atk, @new_atk)
      self.contents.draw_text(200, 32, 36, 32, @new_atk.to_s, 2)


so how could i display lets say atk or str from the wep onto the display box?

here is what i have. please critique.


class Item_Window < Window_Base
   
  def initialize
    super(0,0,300,100)  #   taken from Window_Base:  super( x, y, width, height)
    actor = $game_actors[$activecharid]
    self.contents = Bitmap.new(width-32, height-32)
    self.contents.font.name = "Arial"
    self.contents.font.size = 24
    #self.contents.draw_text( 0, 0, 200, 32, "It's a trap")
    self.draw_item_name($data_weapons[1], 0, -5)
   
  end
 
end

KK20

First tip: Read the Manual (F1). There's a good amount of help for learning Ruby syntax as well as hidden classes and methods you may not find in the default scripts.

Following that, you can see there's a RPG::Weapon class with the variable atk.

self.contents.draw_text(0, 0, 30, 24, $data_weapons[1].atk.to_s)

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

whitespirits

Hi all im running into a couple of problems on my RMX-OS game,

1st is that when I try to teleport to other maps using an event i just shoot to another spot on the same map?? I have no idea how or what to do to fix this!

2nd is that when i use RMXOS global variables and switches i get stuck on the receiving just after u login for example i see title screen and  receiving 17/17 and nothing happend?

please help thanks !

bigace

April 15, 2015, 08:43:27 pm #596 Last Edit: April 15, 2015, 09:00:07 pm by bigace
Engine: RGSS3

So i was trying to count the amount of files in the movie folder:

module ACE_Manger
def self.folder_size(dir)
Dir.glob(File.join(dir, '**', '*')).select { |file| File.file?(file) }.count
end
end

class Scene_Title
alias :ace_start :start
def start
ace_start
puts ACE_Manger.folder_size("/Movies")
end
end


but when I start the game up it says I have 0 files in the folder when there is actually 4. However if I change the directory name to this:

class Scene_Title
alias :ace_start :start
def start
ace_start
puts ACE_Manger.folder_size("D:/Dropbox/Last Bible I - Revelations The Demon Slayer/Game Mechanics/Title Scene/Movies")
end
end


Then the game will print that there is 4 files within the folder. Can anyone figure out why this happens.


Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.

KK20

April 15, 2015, 09:17:33 pm #597 Last Edit: April 15, 2015, 09:23:18 pm by KK20
How about not putting a forward slash and just do ("Movies")

EDIT: Confirmed. Heck, all I did was see how graphics were loaded into the cache. It goes ("Graphics/FOLDER").
Note that when you start with a forward slash, it looks into the local disk wherever your project is on. In your case, it was looking for D:\Movies.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

bigace

Thanks that does makes sense, I forgot that Graphics doesn't have the forwards slash in front of it.


Use Dropbox to upload your files. Much simpler than other upload sites, you can simply place a folder on your desktop that will sync with your DropBox account.