Jump to content
Sign in to follow this  
kal

Pretty print

Recommended Posts

copy paste this in to the editor: http://pastebin.com/raw.php?i=ZAGPZpFx

 

Problem: you are writing a script and you want to inspect the contents of $game_actors array.

 

The default way to do this in Ace would be something like this:

 

puts $game_actors.inspect

 

Which gets you something like this:

 

gbsPq.png

 

Trying to see what is happening here will give you a headache real quick ;)

 

Enter the PP (pretty print) Ruby standard library:

 

pp $game_actors

 

2NLqd.png

 

Soooo much better.

 

Note: I did not write this script (it is from the Ruby standard library). I only had to combine two files to one, and change 1 line of code to get it running in Ace. I don't take any credit for this, but it is so useful that I want you guys to know about it. It would be really nice if Enterbrain just included the standard library in Ace so we don't have to do silly workarounds like this but it's better than nothing at all I guess. :)

Share this post


Link to post
Share on other sites

Very useful! I always hated sifting through the jibberish to find what I wanted. Admittedly though, Ace made this easier with the ability to use the "Find" command. However, this makes so I don't have to rely on that to be able to read the mess I'm looking at.

 

It would have been nice if it was included by Enterbrain, but we can still just add it to the "original" copy of the starting file, so it's in there for all projects innately. Well done!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted