[Finished] [RGSS] Cloning

Started by Blizzard, May 19, 2011, 03:17:02 pm

Previous topic - Next topic

Blizzard

May 19, 2011, 03:17:02 pm Last Edit: September 09, 2011, 06:41:18 pm by Ryex
Cloning




Description

RGSS objects can be cloned. The question is which of them can be cloned and which can't.
Every object that can be cloned needs to have a rb_initialize_copy method defined. Declare the method in the header, define the method in the source file and add it to the interface of the class.



Priority

High.



Prerequisites

None



Assigned

Blizzard



Everything else

For reference you can take a look at how Bitmap was done.
If you are unsure how to implement rb_initialize_copy for a specific class, just leave a comment with "// TODO - cloning" and I will take care of that.
You should first try in the original RGSS to call clone for every RGSS class to see if it works and if it's defined.
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.

ForeverZer0

Wasn't this already included in this task?
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

I made a special task because nobody was attending to that task. :P
Basically the other task is done except that the rd_initialize_copy method wasn't implemented.
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.

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

Quote from: Blizzard on July 30, 2011, 06:41:07 am
*cough* <_<;

Is this task done? I removed the rb_initialize_copy method from the list because it is part of another class.


Quote from: Blizzard on August 09, 2011, 11:18:51 am
*coughs*


I have some cough medicine if you need any.

Blizzard

August 09, 2011, 11:37:40 am #5 Last Edit: August 13, 2011, 07:07:00 am by Blizzard
rb_initialize_copy still needs to be implemented. :P
The thing is that the Color needs it in order to fix the current text color bug.

EDIT: Can somebody at least check out which RGSS classes are clone-able? I'll take care of the rest.
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 know color is for sure. Tone, plane, viewport? I would honestly test all classes but I'm in the worst environment for a computer nerd right now.

Blizzard

In the middle of a forest? D:

I'm more worried about the Renderable classes. I think they aren't clone-able. The simple classes are all clone-able (Color, Tone, Font).
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

Bitmaps can be cloned. I remember doing it while testing out graphics. I was applying effects to bitmaps and then when I realized I had to clone the graphic to its own id so the effect wouldn't be applied to that one graphic globally. I think Sprite is even clone-able.

I'm just on a password protected computer, the owner keeps changing passwords so I can't install anything, so I can't pop open RMXP and do a test on several classes....*remembers portable RMXP*

Blizzard

I know bitmaps can be cloned. That's already implemented.
As I said, I'm not sure about the renderable classes, because we had to implement them in an unusual way and probably Enterbrain had to do so as well. Because of that simple cloning might not work well. So somebody simply needs to test it. *pokes all scripters at the forum*
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

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

I was right, Renderables cannot be cloned. And cloning Viewport crashes the whole Game.exe. That one won't happen in ARC.
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.