General RGSS/RGSS2/RGSS3 Help

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

Previous topic - Next topic

G_G

What module is the method "raise" under? Same with "print"? Would like to make some modifications to the methods reguarding an error log system I have in plan.

ForeverZer0

They are both in the Kernel.
Just make methods outside of a class at top-level to change them.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

G_G

Thanks F0. Another question, when you run into a general error like
Undefined Method
No method "clear"
Does "raise" get called? This is very crucial to my logging and debugging system for beta testers. Any errors that occur would be saved into a log that they can just post and I can go and fix.

ForeverZer0

April 24, 2011, 11:08:38 pm #543 Last Edit: April 24, 2011, 11:25:50 pm by ForeverZer0
I believe so, but I can't say 100% sure. If you need to log errors, you simply need to keep an eye on one global variable: $!

This will be nil until an Exception is raised, then it will be the copy of that Exception, where you can log the message and backtrace information.
What I have done to log errors in Ruby is something simple like this:

In your entry point in Main where looping starts...

require 'script'
require 'another_script'

$program_started = true

begin
 while $program_started
   # Some type of loop
 end
rescue
 file = File.open('ErrorLog.txt', 'a+b')
 file.write(Time.now + "\r\n" + $!.message + "\r\n" + $!.backtrace)
 file.close
ensure
 # Anything you want to log or do no matter how it closes
end



EDIT:
Here, use these. They were invaluable to me when learning to script, and I still use them to look up various things.

Ruby 1.8.6 Documentation, which I use when writing for RMXP.
Ruby 1.9.1 Documentation, for every other time.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

Check out my mod of the main script in RMX-OS. I added a nice way of logging errors.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

LazyViking

May 24, 2011, 05:49:36 pm #545 Last Edit: May 24, 2011, 05:54:29 pm by LazyViking
Hi  :) i dont know if this is the rght place to post, but i'll take a dive  :P

My question Is as following: Is ruby scripting and RGSS two different things?

if yes: Do i need basic ruby knowlege to start RGSS scripting?


edit*: I forgot to add something: i have done a little bit of java, and then i used eclipse, is there a similar program for RGSS? :D


thank you for your time   :D


      -lazyV
Worki'n on my first game! gotta say its a lot of work, trying to figure it all out xD but its so awesome! it's Legen
Spoiler: ShowHide
dary!



ForeverZer0

RGSS is the set of scripts that make RMXP what it is. It is basically a "framework" of a basic game, that can be built upon. They are written in Ruby, and use Ruby to execute.

And, no, you don't need to learn Ruby first. By learning to write code for RMXP, you are in fact learning Ruby. The actual Ruby language is much more expansive than what it used in RMXP, so in my opinion, it is actually easier to start with RGSS, and then built upon that knowledge to learn Ruby, though they each will allow you to learn the other.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

LazyViking

Thanks for the quick reply :)

and do i just use RMXP as my "eclipse" for RGSS coding? :P


         -lazyV
     
Worki'n on my first game! gotta say its a lot of work, trying to figure it all out xD but its so awesome! it's Legen
Spoiler: ShowHide
dary!



ForeverZer0

Pretty much.

Although using an external IDE has a lot better features than the RMXP script editor, it is way too much of a hassle to be constantly porting the files back and forth for playtesting. It would be neat to create a little thing that actually read/writes the Scripts.rxdata from an external IDE, such as VS, Eclipse, or NetBeans.

* starts thinking of ways to accomplish this....
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

LazyViking

thank you so much for the answer :)
Worki'n on my first game! gotta say its a lot of work, trying to figure it all out xD but its so awesome! it's Legen
Spoiler: ShowHide
dary!



Blizzard

Small correction: RGSS was made in C++, but it was interfaced with Ruby so the whole framework can be used with Ruby in RMXP.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

I've seen it done somewhere and I can't remember where I found the code. I basically want to create "events" when scripting. Events as in when x happens do y. Like .NET forms, when Form loaded, call this method. How would I go doing this?

nathmatt

im trying to get the a map locations autotile bitmap location with the tile_id im making my own minimap and i got it to display all the maps graphics fine except for the autotiles i cant figure out how to get the location in the autotile graphic for the specific x,y
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Explain this please. The 2 lines in Main.
filename = $!.message.sub("No such file or directory - ", "")
  print("Unable to find file #{filename}.")

I finally looked at it instead of glancing. I don't see the point in it really. To me it looks like their just making their own custom error message. Or is there a deeper meaning?

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

nathmatt

June 25, 2011, 09:22:49 am #556 Last Edit: July 22, 2011, 05:18:39 pm by nathmatt
@Blizzard thx worked perfectly

edit: never mind its messed up somewhere else
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


maniak

I want a script to recheck "Data/MapInfos.rvdata" when a game save is loaded. What would this look like?

element

Hey guys, need some help with my first ever rgss script.

Basically I'm making a skill button combo system addon for Blizz-abs.
Everything works fine, but now I have come to the part where I need to unleash the skills.

I tried searching in Game_battleaction and in scene_battle and also in the blizz-abs scripts.
But I cant seem to figure out how to unleash a skill through a script command.

All that it needs to do is simply use a skill with blizz-abs.


Hope you guys can help :)

Ryex

I made a script "Ryex's Weapons Unleash skills" you can use the code there to lean if you want. I even made a BABS plugin for it so barrow away."
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />