CHERRY'S PROFILE

Search

Filter

+++ DynRPG - The RM2k3 Plugin SDK +++

Thank you for bringing the bugs to my attention. I just wrote them onto my todo list (reserved for the next time I am in the mood for spending time with the RPG Maker)!

Hero won't stop running downward RM2k3

Sometimes it can also be caused by an error in the internal buffer.

I often heard of similar problems, so I created a "fix". Run this tool once whenever you have any keyboard issues: http://share.cherrytree.at/showfile-2704/kbdreset.exe

+++ DynRPG - The RM2k3 Plugin SDK +++

author=Essenceblade
Say, Cherry. Do you know if it's possible to remove the number of MP needed to use an ability completely? so it doesn't show "- 0"? Just for an individual skill (field skill). Or does it affect the whole skill database if you remove the parameter?

Put the following code into a onStartup handler:

*reinterpret_cast<int *>(0x4C9440) = 0;
*reinterpret_cast<int *>(0x4C9444) = 0;

Untested, but it should work.

EDIT: Oops, didn't read precisely enough... this removes the parameter altogether... :-/

[Plug-in] [rm2k3] Animated Monsters Plugin

No, that's for 2k...

[Plug-in] [rm2k3] Animated Monsters Plugin

Oh, sorry, my bad...

Firstly, I misunderstood MAX_MONSTERS... I thought you were caching the monster images for each monster in the database, not for each monster in battle, so I thought monsters with an ID > 8 couldn't be used. So, forget my objection ^^

Secondly, I actually forgot that onBattlerDrawn exists, so forget what I said about "next onDrawBattler and/or onFrame" - onBattlerDrawn will do the job just fine.

You still understood my thoughts correctly...

Let me explain what happens at your current version:

The RPG Maker loads the original image. You load 6 other images.
Then, you overwrite the monster's image pointer with one of yours.
At then end, the RPG Maker frees the monster's image - which is now one of yours!
So, the effect is that the original image leaked (it never gets freed), and one of your images was freed by the RPG Maker, but 5 are still loaded. If you would now try to free all your 6 images, the one which was unloaded by the RPG Maker would cause an Access Violation (segfault, yes) when you try to free it, because it was already freed! However, you currently don't free any images at all, so you are leaking the original image plus 5 of yours.

To solve that problem, my suggestion is changing the image pointer in onDrawBattler while saving the old pointer, and changing it back in onBattlerDrawn. As far as I know, the RPG Maker never frees the image between these two callbacks, so at the end, the RPG Maker will always free its own image, and you should free your 6 images after battle.

Also please take into account that monsters could have the ability to transform, so you better save the monster ID too, and if it changed after a frame, unload the old images and load the new ones.

By the way, I remember that somebody suggested changing color during fading in the other thread - this would be possible using the colorControl1 and/or colorControl2 members of the image. You have to call the applyPalette method after changing the color parameters, though.

Best regards,
Cherry

EDIT: For attack poses, you could move the monster using the x and y members of the RPG::Battler, and update the screen using RPG::Screen::update while moving (so that the battle won't continue before you are finished moving)... However keep in mind that the onDrawBattler/onBattlerDrawn handler will be called again during RPG::Screen::update!

EDIT2: To avoid confusion: When I talked about "freeing an image", I actually meant using RPG::Image::destroy(image), not image->free() which only frees the image's pixel data, not the whole RPG::Image structure.

EDIT3: The RPG::Image::destroy function automatically sets the pointer to NULL after destroying the image... however if you assign the image pointer to the "image" member of the RPG::Monster, you have two copies of that pointer, so that even though the RPG Maker also sets the pointer to NULL when it destroys the image, you weren't able to find that out before.

EDIT4: Oh, I found another mistake of yours, which might also cause bugs or crashes: for(int i=0; i<9; i++) << this loops from 0 to 8 (including), although I assume you want to loop from 0 to MAX_MONSTERS-1. Currently you are accessing the index 8 which doesn't exist and which thus causes memory corruption.

[Plug-in] [rm2k3] Animated Monsters Plugin

[Plug-in] [rm2k3] Animated Monsters Plugin

#define MAX_MONSTERS 8


This line looks suspicous... Couldn't you use a configuration and a dynamic array instead?

Apart from that: GREAT, thank you!!

(I will add it to the plugin directory after the MAX_MONSTERS thing is clarified...)

EDIT:

Oh, I think there is another problem... You are creating a memory leak because you don't free the images. I can also explain the access violations to you.

The RPG Maker doesn't know that you are playing around with the monster image. So it thinks the image which is in the RPG::Monster::image member belongs to the RPG Maker, and it frees it after battle (or when a monster is transformed!!!)

So my suggestion would be: Store the old image pointer and the RPG::Battler pointer of the last monster which you modifie d somewhere. Then, change the image pointer at onDrawBattler, and change it back at the next onDrawBattler (of the next monster) and/or onFrame. Then, a simple RPG::Image* array would be enough, where you have NULL for "not yet loaded".

An Official *English* Version of 2k3 Approaches!

I just hope the new company won't think of punishing/reporting me for heavily breaking the EULA/laws in the process of improving their dusty old software... Who knows... :-/

+++ DynRPG - The RM2k3 Plugin SDK +++

Well, I understand, but it's significantly shorter during testplay. I decided to never completely hide it so that people couldn't just add a shortcut "START GAME" with TestPlay enabled to avoid the logo.

+++ DynRPG - The RM2k3 Plugin SDK +++

Well, you could just prevent enemies and heroes from reaching full ATB at the same time using C++ trickery...

@MPs: Would be possible, yes, but not via any "official" functions of the SDK. However, I can look up the address for you when I am at home and show you a "hackish" C++ line which will do it (by changing some bytes in memory).