Yes, it would, but I want to call it by its name, not a number 😉
Ruby/RGSSx questions that don't deserve their own thread
RGSSx Script SupportI have a bad habit of not reading the whole post. I'm bad at forums.
class Game_BattlerBase alias :defense :defendEdit: This is probably closer to what you want.
I'd stick with 'self.def' though
Code:
send(:def)
Doesn't self.def work? It should, and it's what you should use when referencing a method from within that same method 🙂
`def` is defined in Game_BattlerBase, which is inherited by Game_Enemy. `enemy` refers to the RPG::Enemy object, which doesn't define any `def`.
You need to have `self` otherwise ruby doesn't know what you mean.
Yes, I got it working. self.def works.
no Method Error Occurred.
Undefined method 'bitmap' for nil:NilClass
---------------------------------------------------
What does that mean? does that mean it cant find the image or did it lose one?
Undefined method 'bitmap' for nil:NilClass
---------------------------------------------------
What does that mean? does that mean it cant find the image or did it lose one?
Gosh Shin, that's the bare minimum information, isn't it?
It means the bitmap object of a sprite or window or something is being referred to before it has been created, or after it has been disposed (or something else). It may or may not have anything to do with an actual image (I suspect it doesn't, but I don't really know). Can't tell you anything more due to the lack of information.
Got a script name? Line number? If it's a script you've added and not RTP, post in a new thread, with a link to the script.
It means the bitmap object of a sprite or window or something is being referred to before it has been created, or after it has been disposed (or something else). It may or may not have anything to do with an actual image (I suspect it doesn't, but I don't really know). Can't tell you anything more due to the lack of information.
Got a script name? Line number? If it's a script you've added and not RTP, post in a new thread, with a link to the script.
Is there any documentation on map data in runtime?
All the manual says is a vague "map data is stored as a 3 dimensional array", without giving how deep, how events are stored, or what layer is what. Or even if the array starts at 0 or 1(some arrays have started with a null in the beginning I have discovered, to make ids in code match the editor's starting 001 entry).
I'm going to try running some traces and poking around, but it would really save me a lot of time if someone already did it or the documentation on the formats and runtime map memory for tiles is somewhere already in more detail.
My eventual goal is to be able to take part of a map and put it onto another map during the loading phase of the map data. I need a good grasp of how this ticks first though.
Would appreciate any links / posts on the subject. Thanks!
All the manual says is a vague "map data is stored as a 3 dimensional array", without giving how deep, how events are stored, or what layer is what. Or even if the array starts at 0 or 1(some arrays have started with a null in the beginning I have discovered, to make ids in code match the editor's starting 001 entry).
I'm going to try running some traces and poking around, but it would really save me a lot of time if someone already did it or the documentation on the formats and runtime map memory for tiles is somewhere already in more detail.
My eventual goal is to be able to take part of a map and put it onto another map during the loading phase of the map data. I need a good grasp of how this ticks first though.
Would appreciate any links / posts on the subject. Thanks!
@Shaz Well it involves Khas Lighting Effects. I just need to be able to turn it off during the battle and then have it come back on after the battle is over.
Link to the script! Don't expect us to extract every little bit of information from you. If you want help, you need to provide as much information as possible, and make it as easy for someone to help you as possible. I won't go searching over the internet for a script, when you already know exactly where you got it from.
And if your error has occurred because you're trying to do something that it wasn't designed to do, you need to elaborate on that. How did you attempt to make it do that?
And as I said, if it involves help with a custom/imported script, post it in its own thread.
And if your error has occurred because you're trying to do something that it wasn't designed to do, you need to elaborate on that. How did you attempt to make it do that?
And as I said, if it involves help with a custom/imported script, post it in its own thread.
@darkgriffin: Poking around, map.data appears to just be the tile information. @map.data[x, y, z] gives you the tile id at that coordinate. Maps start at 0,0, so this data does as well. z goes from 0 to 2, with 0 being the base layer. Events are stored in map.evens.
There is actually an additional layer (@map.data[x, y, 3]) that contains region ids and shadows. There MAY be something else in there, but those are the only things I'm sure of.
On a semi-related topic ... since a Table is a multidimensional array, is there any way to apply array methods to a table? I tried mytable.each but got an error. I'm interested in extracting an array of elements containing [x, y] from a table, where [x, y, z] meets a set requirement. The documentation doesn't provide much.
On a semi-related topic ... since a Table is a multidimensional array, is there any way to apply array methods to a table? I tried mytable.each but got an error. I'm interested in extracting an array of elements containing [x, y] from a table, where [x, y, z] meets a set requirement. The documentation doesn't provide much.
No, Table is pretty limited.
Its superclass is Object and it doesn't include Enumerable module.
If you print out
Array.instance_methodsTable.instance_methodsYou'll see that Table doesn't really have anything.You should also note that tables can only store signed 2-byte integers (ie: values between -32,768 to 32,767 inclusive).
One solution is to explicitly modify the Table class to include Enumerable, and define `each` and `index` methods so that you can correctly enumerate over the table.
Its superclass is Object and it doesn't include Enumerable module.
If you print out
Array.instance_methodsTable.instance_methodsYou'll see that Table doesn't really have anything.You should also note that tables can only store signed 2-byte integers (ie: values between -32,768 to 32,767 inclusive).
One solution is to explicitly modify the Table class to include Enumerable, and define `each` and `index` methods so that you can correctly enumerate over the table.
Anyone know of an RGSS3 script call you could do in game to deactivate/reactivate a menu option other than Save and Formation (such as Item?)
Am I missing something obvious?
EDIT: Nevermind. I figured out how to do what I wanted in Yanfly's Menu. I just added an if $game_switches[50] == true and end under each of the menu items I wanted to be able to turn on and off.
Am I missing something obvious?
EDIT: Nevermind. I figured out how to do what I wanted in Yanfly's Menu. I just added an if $game_switches[50] == true and end under each of the menu items I wanted to be able to turn on and off.
Next time, when you're looking for a script, please post in Script Requests.
You don't need to say == true.
if $game_switches[50] will return true if it's on, or false if it's off.
You don't need to say == true.
if $game_switches[50] will return true if it's on, or false if it's off.
Noted. And thank you.
I added a script and it said stack level too high error? How many scripts can be added to RPG Maker Ace engine?
@ShinGamix: That means there's a conflict between the same method calls in one or more of your scripts. Usually, it's the result of two scripts using the same alias_method name, thus the method keeps calling itself indefinitely, creating a stack level error.
That explains it very well. Now I have to figure out the method that conflicting. Any suggestions on the easiest way?
Original thread: https://forums.rpgmakerweb.com/threads/ruby-rgssx-questions-that-dont-deserve-their-own-thread.150/