RMXP Errors
Authors: game_guy
Version: 1.0
Type: Error Creating Script
Key Term: Misc System
IntroductionMakes funny errors for people to laugh at
Features
- Makes funny errors for people to laugh at
ScreenshotsN/A
DemoN/A
Script
# Funny rmxp errors
pie = rand(10)
case pie
when 0
e = "RMXP overloaded. All data was erased"
when 1
e = "RMXP doesnt like being insulted. Erasing data"
when 2
e = "RMXP doesnt like you, erasing all data"
when 3
e = "RMXP ate chocolate there for erasing all data"
when 4
e = "RMXP just got aids and is now erasing all data"
when 5
e = "RMXP is now closing because he heard you call him gay"
when 6
e = "RXMP is closing because Chuck Norris doesnt sleep, he waits"
when 7
e = "????"
when 8
e = "B==D"
when 9
e = "(.Y.)"
when 10
e = "RMXP just watched 2girls1cup and is now erasing all data."
end
raise(e)
InstructionsPaste into a new script
CompatibilityNot tested with SDK should work with everything
REPORTED ERRORS
Q: RMXP closed because he was called gay?? Does this have anything to do with your script?
A: No. It probably heard you call it gay. Thats your fault
Credits and Thanks
Author's NotesThis is for entertainment only and therefor I posted it in Entertainment. As you can tell I needed some because I was bored out of my mind.
sexy.
Hmm. Why don't you try something more like this?
raise [ "err1", "err2", "err3", <etc>][rand(<length>)]
A whole lot simpler, and it would most likely be faster if Ruby had the option to use static arrays >_<
EDIT:
Oh, and BTW, to get RMXP to raise a specific kind of error (instead of just RuntimeError), use
raise <ErrorClass>, "<error message>"
ErrorClass is stuff like EOFError, ArgumentError, NoMethodError, etc
Who cares about details here.
WcW.disable_shutup_recovery
WcW.shutup
Quote from: WcW on June 07, 2009, 10:21:51 pm
Hmm. Why don't you try something more like this?
raise [ "err1", "err2", "err3", <etc>][rand(<length>)]
A whole lot simpler, and it would most likely be faster if Ruby had the option to use static arrays >_<
EDIT:
Oh, and BTW, to get RMXP to raise a specific kind of error (instead of just RuntimeError), use
raise <ErrorClass>, "<error message>"
ErrorClass is stuff like EOFError, ArgumentError, NoMethodError, etc
It's kind of like saying "Nice joke, but you can make that joke shorter by adding contractions." XD
It would be even better if Ruby allowed this:
raise (a = File.read("./error_strings.txt").split("\n\n"))[rand(a.size)]
*goes to see if Ruby already has a random method for arrays*
EDIT Well, this method really sucks (horribly slow), but it does want I was looking for (somewhat):
raise [<errors>].sort_by{rand}[0]
I prefer the version presented since it's more clear for non-scripters.
Now if there are someone you don't like you can make something like this >:3
class Fun < rand < 0.99 ? Array : Hash
# I am evil!
end
Guess what it does :evil:
Quote from: Zeriab on June 09, 2009, 04:31:59 pm
I prefer the version presented since it's more clear for non-scripters.
Now if there are someone you don't like you can make something like this >:3
class Fun < rand < 0.99 ? Array : Hash
# I am evil!
end
Guess what it does :evil:
What's so bad about subclassing Array/Hash...?
99% of the time when you run the code Fun is a subclass of Array.
The other 1% it is a subclass of Hash.
You can have code that works and suddenly it crashes! When you try it again it works.
Yay for apparent non-deterministic errors >:3
Way more fun. >:3
class Fun < rand < 0.5 ? Array : Hash
# I am evil!
end
Quote from: Blizzard on June 10, 2009, 05:35:44 am
Way more fun. >:3
class Fun < rand < 0.5 ? Array : Hash
# I am evil!
end
I really dont get what it does. I've ran my game with that script in it and nothing happens.
Quote from: Blizzard on June 10, 2009, 05:35:44 am
Way more fun. >:3
class Fun < rand < 0.5 ? Array : Hash
# I am evil!
end
How did you know that was my first version D:
I bet you went through logs and saw how it was before I edited my post >:(
It's more fun, but not as evil if you want to mess with people >:3
i still dont get the script can someone explain this wierd 2 line code to a noob like me?
Try using this code:
class Fun < rand < 0.5 ? Array : Hash
# I am evil!
end
p Fun.new
Run it a few times and you'll see ;)
it prints this
[] or {} I still dont see how this can mess up a game...
It will mess at least two things. One is .each and any submethod that uses .each and another one is simply the indexing. Hash's allowed everything as key (or index) while arrays allow only numbers. .each on Array iterates through every value while Hash iterates through the key and the value. >:3
Use Fun.new instead of [] (or Array.new) and {} (or Hash.new). >:3
Err, try this for a more obvious error
class Fun < rand < 0.5 ? Array : Hash
end
x = Fun.new
Fun[0] = 2; Fun[1] = 97; Fun[2] = 19023523532
Fun.each do |n| print n end