[RM2K3] DYNRPG COMPILING ERROR

Posts

author=Cherry
RPG::skills[1]->type = (RPG::SkillType)5;
Could you explain how that works? I'm still learning c++. I am guessing (RPG::SkillType) converts the right value to an object or pointer type?
It's just an explicit cast to the enum type.
author=Cherry
It's just an explicit cast to the enum type.

I was hoping to understand what RPG::SkillType is and why do I need to cast it? Why can't I just set the value?

@Kazesui
Do you think I could take a look at the source code of your dynmodeseven plugin? I would like to learn how to manipulate bitmaps in c++ next and possibly create more advanced plugins.
According to your compiler error and PepsiOtaku's docs `RPG::SkillType` (an enum) is the type of the `RPG::Skill::type` member. You are assinging an integer and not an `RPG::SkillType` value (which would be something like `RPG::SKILL_SWITCH`), and the compiler doesn't like the implicit conversion there, so you have to do an explicit conversion.
author=Cherry
According to your compiler error and PepsiOtaku's docs `RPG::SkillType` (an enum) is the type of the `RPG::Skill::type` member. You are assinging an integer and not an `RPG::SkillType` value (which would be something like `RPG::SKILL_SWITCH`), and the compiler doesn't like the implicit conversion there, so you have to do an explicit conversion.
So basically it is my compiler that is the issue then. I have used int values instead of enum values before and I have never had this issue before which is why I thought it was something else.
author=McBick
@Kazesui
Do you think I could take a look at the source code of your dynmodeseven plugin? I would like to learn how to manipulate bitmaps in c++ next and possibly create more advanced plugins.


Knock yourself out. Keep in mind that it is a very long time ago since I wrote this, so I won't guarantee that I can help you with a lot of the code. I have forgotten a good bunch of it, and it is a bit of code as well. I don't there should be any issues, but this was compiled with the older version of DynRPG, so I'm not a 100% certain it is compatible with the updated DynRPG, even if I don't think it should be a problem.
@Kazesui
I took a quick look at it and there seems to be a lot to learn from, thanks!

@Cherry
Do you happen to know why battler variables change during battle in rm2k3 when they shouldn't? During callbacks like onBattleStatusDrawn, if I manipulate battler objects during certain conditions I get the wrong values. For example I tried using a battler's condition ID to trigger an event, but when my code checked the ID it would return a 7 digit value.
Please show your code
I don't have any now as I have rewritten my code to work around that issue, but if I run into that issue again I will remember to save it. It typically occurs with Battler stats in general when I try to retrieve them to calculate damage before damage occurs, so I can insert my own damage algorithm. The code is usually executed when the Battler's action meets a certain condition, but before they display their action animation, which all occurs in the onBattlerAction callback.