Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TABLE class. RMXP's dup and clone params missing #50

Closed
DerVVulfman opened this issue Aug 3, 2014 · 1 comment
Closed

TABLE class. RMXP's dup and clone params missing #50

DerVVulfman opened this issue Aug 3, 2014 · 1 comment

Comments

@DerVVulfman
Copy link

It isn't that the commands aren't present. But their function was to retrieve the data contents is not present. You can try this statement within the Spriteset_Map class to see my point:

p $game_map.data[7,6,0]
my_dup = $game_map.data.dup
p my_dup[7,6,0]

In a normal RPGMaker XP project, this method would twice print the tile ID of a floor tile at the 7/6 location in the map.

However, it runs into a massive problem when run within mkxp. The question I asked myself was... WHY?

As the data field in $game_map is a table, I ran an additional check to ensure the issue was with the Table class.

s1 = Table.new(2,2)
s1[0,0] = 1
s1[0,1] = 2
s1[1,0] = 3
s1[1,1] = 4
p s1[0,1]
s2 = s1.dup
p s2[1,1]

A very simple test. I created a 2x2 table with data in each field. When I ran this within RPGMaker XP, it would retrieve data from both the original and duplicate tables. With mkxp, it again suffered an error. This again puzzled me. I looked at some info on the Table class, and it was a child class of the Object class that has both .dup and .clone commands......

So I did one more test. You COULD get a response from the below version, returning that a table exists...

s1 = Table.new(2,2)
s1[0,0] = 1
s1[0,1] = 2
s1[1,0] = 3
s1[1,1] = 4
p s1
s2 = s1.dup
p s2

And there in gave me an answer. I could get a response with both .dup and .clone indicating that it was actually copying the whole table itself. But once you try to retrieve contents from the duplicated/cloned table, you get an error. Both dup and clone were supposed to return a table with the contents, but that was where it failed. It duplicated the table, but not the contents as it is supposed to

It would have been nice if the 'Standard Library / Built-In Classes' part of the RMXP help file mentioned that the Table class was a child of the Object class. I tested the other object children and most are working fine. ;) Well, mebby not the Font class (duh), and I honestly wouldn't know how to test the IO, Viewport or Window classes. :P

@Ancurio Ancurio closed this as completed in 151a1f0 Aug 5, 2014
@Ancurio
Copy link
Owner

Ancurio commented Aug 5, 2014

Table cloning wasn't implemented, thanks for the report.

Font cloning is supposed to work, if not please open a new ticket. Viewport, Window etc. cloning is forbidden by RGSS (see #17). No idea about ruby's builtin classes like IO.

Splendide-Imaginarius added a commit to Splendide-Imaginarius/mkxp that referenced this issue Oct 17, 2023
…ad-artifacts

GitHub Actions: Add preload scripts to Linux and Windows artifacts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants