Author Topic: General RGSS/RGSS2/RGSS3 Help  (Read 104145 times)

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2900
  • LV: 365
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #580 on: April 07, 2013, 08: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.



(click to show/hide)
NNID: KK20-CP

Offline bigace

  • Transcended Spirit
  • ***
  • Posts: 211
  • LV: 16
  • Gender: Male
    • View Profile
    • Bigace Scripting World
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #581 on: April 07, 2013, 09:07:31 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.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2900
  • LV: 365
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #582 on: April 07, 2013, 10:44:32 PM »
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.



(click to show/hide)
NNID: KK20-CP

Offline bigace

  • Transcended Spirit
  • ***
  • Posts: 211
  • LV: 16
  • Gender: Male
    • View Profile
    • Bigace Scripting World
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #583 on: April 08, 2013, 03:37:04 AM »
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.
« Last Edit: April 08, 2013, 06:05:46 AM by bigace »


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.

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #584 on: April 12, 2013, 02:13:04 PM »
Pokemon Essentials has it's own custom messaging system.

Offline bigace

  • Transcended Spirit
  • ***
  • Posts: 211
  • LV: 16
  • Gender: Male
    • View Profile
    • Bigace Scripting World
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #585 on: April 12, 2013, 11:49:23 PM »
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.

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #586 on: April 13, 2013, 12:01:54 AM »
Sorry, I just misunderstood what you were saying. xD

Offline bigace

  • Transcended Spirit
  • ***
  • Posts: 211
  • LV: 16
  • Gender: Male
    • View Profile
    • Bigace Scripting World
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #587 on: May 16, 2013, 01:23:51 AM »
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.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2900
  • LV: 365
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #588 on: May 16, 2013, 01:50:59 AM »
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
Code: [Select]
some_array.each {|array_element| do_some_stuff_here }
One of your methods is using 'yield' instead of 'return'.
« Last Edit: May 16, 2013, 01:53:33 AM by KK20 »



(click to show/hide)
NNID: KK20-CP

Offline bigace

  • Transcended Spirit
  • ***
  • Posts: 211
  • LV: 16
  • Gender: Male
    • View Profile
    • Bigace Scripting World
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #589 on: May 16, 2013, 04:55:31 AM »
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.

Offline bigace

  • Transcended Spirit
  • ***
  • Posts: 211
  • LV: 16
  • Gender: Male
    • View Profile
    • Bigace Scripting World
RMXP Help
« Reply #590 on: May 17, 2013, 10:23:22 AM »
Okay well nothing seems to fix this issue. The error seems to stem from when I use this
Code: [Select]
24.times.max_by {|i| do_some_stuff_here(i) }
This is the code that gives the error from my save system script.

Code: [Select]
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:
Code: [Select]
#--------------------------------------------------------------------------
# * 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.
« Last Edit: May 17, 2013, 08:49:49 PM by bigace »


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.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2900
  • LV: 365
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #591 on: May 17, 2013, 08: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.



(click to show/hide)
NNID: KK20-CP

Offline bigace

  • Transcended Spirit
  • ***
  • Posts: 211
  • LV: 16
  • Gender: Male
    • View Profile
    • Bigace Scripting World
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #592 on: May 17, 2013, 08:31:07 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.

Offline Kiwa

  • Transcended Spirit
  • ***
  • Posts: 155
  • LV: 4
    • View Profile
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #593 on: January 02, 2014, 04:38:24 PM »
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:
Code: [Select]
draw_actor_parameter(@actor, 4, 32, 0)
or
Code: [Select]
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.

Code: [Select]
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
« Last Edit: January 02, 2014, 04:42:57 PM by Kiwa »

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2900
  • LV: 365
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #594 on: January 02, 2014, 07:12:31 PM »
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.
Code: [Select]
self.contents.draw_text(0, 0, 30, 24, $data_weapons[1].atk.to_s)



(click to show/hide)
NNID: KK20-CP

Offline whitespirits

  • Ethereal Devastator
  • ****
  • Posts: 312
  • LV: 2
    • View Profile
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #595 on: January 17, 2014, 08:52:16 PM »
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 !

Offline bigace

  • Transcended Spirit
  • ***
  • Posts: 211
  • LV: 16
  • Gender: Male
    • View Profile
    • Bigace Scripting World
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #596 on: April 16, 2015, 02:43:27 AM »
Engine: RGSS3

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

Code: [Select]
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:

Code: [Select]
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.
« Last Edit: April 16, 2015, 03:00:07 AM by bigace »


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.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2900
  • LV: 365
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #597 on: April 16, 2015, 03:17:33 AM »
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.
« Last Edit: April 16, 2015, 03:23:18 AM by KK20 »



(click to show/hide)
NNID: KK20-CP

Offline bigace

  • Transcended Spirit
  • ***
  • Posts: 211
  • LV: 16
  • Gender: Male
    • View Profile
    • Bigace Scripting World
Re: General RGSS/RGSS2/RGSS3 Help
« Reply #598 on: April 16, 2015, 04:46:08 AM »
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.