New account registration is temporarily disabled.

MCBICK'S PROFILE

Search

Filter

[RM2K3] DynRPG Compiling Error

author=AubreyTheBard
The equals signs in the if statement should be ==, not =. == checks WHETHER something is equal, = ASSIGNS one thing to be equal to another.
That's a typo on here, it is "==" in my code. I've tried experimenting with it more and still can't identify the issue, but I am pretty sure I need to change a variable somwewhere before executing that line of code.

So I started using the Window class and I am able to manipulate existing windows, but I am still unable to create new ones without a run time error. When I create an object of the Window class the plugin fails to load giving me the "cannot load plugin (DYnRPG 1114)" error and continues to run the game without loading it. It seems if I initialize any Window objects in my plugin the game will always fail to load the plugin, no matter where I initialize them. And if I use uninitialized Window objects the game will get a memory read error, for obvious reasons. I'll continue to experiment with them, but it might just be easier to create my own Window class inheriting the Image class objects. I also tried mapping my Window objects, but that results in a memory write error.

Also do you or anyone else know why this line of code won't compile, "RPG::WindowMenuSkill->winInfo->y = 120;"? I looked into the header and this line should point to class WindowMenuSkill, object winInfo, member int "y", but it results in the compiling error "expected unqualified-id before -> token, after RPG::WindowMenuSkill. I checked the header to see if there is a reinterpreter for that class, but there isn't and if there was I would have gotten the error WindowMenuSkill is not a class or namespace. I also checked to make sure winInfo is a static object.

[RM2K3] DynRPG Compiling Error

Does anyone know which parameter I need to change for this not to crash?

bool onDrawBattleActionWindow(paramters...)
if(RPG::battleData->navLevel = RPG::BNAV_IN_PARTY_WINDOW
&& RPG::Actor::partyMember(CurBattler)->atbValue = 300001)
{
RPG::battleData->navLevel = RPG::BNAV_IN_COMMAND_WINDOW;
}

This should open the command window for the actor whose atb bar is full, instead of having to select the the battler and press the decision key to open the battler's command menu. This results in a read error when I run it during battle though.

I am assuming it's because I haven't set the battler whom the winCommand window should open for. The only variable that looks like what I need is the RPG::battleData::currentHero, but I can't do anything with it.

[RM2K3] DynRPG Compiling Error

Wow, that is a lot more code then I thought it would be. From what I have interpreted though, he is using the image::drawText()(the old text function) when a picture is drawn to create an image ontop of it (or replaces it?) and then using the canvas::draw() function to draw the text onscreen and canvas::drawStretch() function to make the image big enough for the text to fit on the image. He doesn't actually use the image:::loadFromFile() function though, which will allow for loading up pictures in a plugin directly.

With that said, I should at least be able to create a text image even if I can't use the image::loadFromFile function, but when I try to do so, it results in nothing happening. I am however able to do so in battle, which leads me to believe either the image::drawString function doesn't allow its function in the overworld and the image::drawText function does or there is something I am missing.

This is the code I am using to draw text:
std::string pathName = "Picture\\Field.png";
RPG::Image* myImagePtr = RPG::Image::create(320, 240);
myImagePtr->useMaskColor = true;
myImagePtr->loadFromFile(pathName, true, false); //Even if I omit this, the image loads blank outside of battle, only.
myImagePtr->drawString(0, 0, pathName, 8);
myImagePtr->setSystemPalette();
RPG::screen->canvas->draw(132, 108, myImagePtr);

So is there something wrong with my code? I trigger it through a comment command for both battle and outside battle, but it only works in battle, or rather only visible in battle. I ran a debugger to check if the code is being executed outside battle and it seemingly is, so I am stumped.

EDIT So I figured out what was wrong, kinda. When I create an image in a function that only runs once, for example the onComment() function. My RPG::Image object is destroyed after the function finishes executing the code which results in nothing happening. I had to use the onFrame() function to ensure it would persists in every scene. Unfortunately, now I have run into another issue and that is my images are being immediately destroyed after being made and I am not sure why. I at least see my image for a frame before it is destroyed though, unlike before where nothing would happen. The only solution I found is to have it draw to the canvas every frame which makes me think the game automatically destroys all images every frame and redraws them, excluding the new images.

[RM2K3] DynRPG Compiling Error

That is actually how I found out my array was overflowing because it kept changing the value of another variable and so I went back and checked all my code to find out it was a memory issue. I fixed all the arrays now, so it is fine now. Thanks for the clarification, I was confused why it wasn't working, but now it makes total sense.

I've gone over all the image plug-ins, but they all function during battle, except for one which happens to be the text plug that isn't open source. I think the text plugin uses existing images to properly use the drawstring function which is why you have to show an image via the show image command in rm2k3 before being able to write text. The plugin also doesn't function in battle. My guess is that DynRPG doesn't support creating images outside of battle. Tomorrow I'll try experimenting with the window class and hopefully be able to properly use it with no issues.

[RM2K3] DynRPG Compiling Error

Okay, so I understand how Image classes work now, but they don't work... I am able to load the images, but they're always invisible. Every line of code runs with no errors, but for some reason my image is invisible, I think. Here is the code I used.
RPG::Image* myImage = RPG::Image::create();
myImage->useMaskColor = false;
myImage->alpha = 255;
std::string pathName;
pathName = "Picture\\Monster1.png";
myImage->loadFromFile(pathName, true);
RPG::screen->canvas->draw(160, 120, myImage);

I more or less did the same thing the tutorial does, but without the loops and multiple images. I ran a debugger to make sure every line executed properly and it seemingly did, but no Image appears afterwards.

I have been reading the Image header and other header files of DynRPG to try and better understand how to call these functions, but still can't understand the Window functions, but I will continue to experiment.

I thought an array's size was how many bytes the array variable is. So if I am to understand correctly an array index is equal to the Index minus 1? For example int arr(5) would begin at index arr(0) and end at index arr(4), for a total length of 5 and size of 4? It is weird that I have never ran into an issue before by using arrays that were too small in my code till now. I guess I just got lucky with my compiler.

Edit: So I got it to work in battle, but not overworld, still comes up invisible. I used the same code on both.

[RM2K3] DynRPG Compiling Error

Isn't "RPG::Image myImage;" supposed to create an object of class "Image"? Won't this "RPG::Image * imagePtr = RPG::Image::create();" just create a pointer "Ptr" to the address of function "RPG::Image::create();"? It doesn't actually call the function and if it did you would get a compiling error because you called the function without an object. I am still learning c++, so I am probably wrong here.

So I have tried adding your line of code to this, but it doesn't result in anything happening.
RPG::Image * imagePtr = RPG::Image::create(320,240); //This calls the function to create a new image, right?
RPG::Image myImage; //This declares the Image object for RPG::Image::drawString, right?
textString = "This is a test."; //string was declared earlier, used for drawString function
myImage.drawString(96, 96, textString, 1); //draws a string of variable textString to the new image???

So what am I doing wrong here? By declaring object "RPG::Image myImage;" it should inheret all functions of class Image, so shouldn't I be using "myImage.create();"? Even if I do this though, it still results in nothing happening in game. Both lines of code compile no errors too.

Sorry if my questions sound really dumb, still learning.

Edit: I noticed the text plugin requires you to show a picture before being able to draw text, so maybe there are more steps required then calling the function? Unfortunately the text plugin isn't open source, so I can't open it up and see how he made it work.

Edit2: So I ran into another issue, kinda unrelated, but I was wondering if you knew why my static int AGI(11) = {} variable would overflow when writing to AGI(11) = new value in a for loop? I had to extend my array to 12 to solve the problem, but I have other variables write no problem to the last element in the array. Arrays start from arr(0) don't they, but for some reason doing this overflows it.
for(i=0; i<8; i++)
AGI(i+4) = new value
//This one line overflows the variable when "i" is equal to 7 and I have tried using just AGI(11) to confirm it.

It wasn't until I tried compiling with AGI(11) instead of AGI(i+4) that my compiler told me about an overflow. Also I am using the correct syntax in my code, but rpgmaker.net won't allow me to use brackets to show my code accurately.

[RM2K3] DynRPG Compiling Error

Does anyone know what this error means, "cannot load 'plugin name' plugin (DynRPG 1114)". This error occurs when I load up the game with my plugin. There are no compiling errors either. This occurs when I declare an object from the Window or Image class and try to run a function with it. I've narrowed the error to just these two lines of code.

RPG::Window myWindow; //Happens with an Image class too.
myWindow.create(64, 64, 16, 16, false);


The game will load after the plugin error, but the plugin clearly isn't loaded. I've made sure that I am using the correct compiler and correct version of DynRPG for my game and header, multiple times, so I'm pretty sure that isn't my issue. I am using CodeBlocks to make the plugin.

I also run into a compiling error when pointing to certain Window objects, such as "RPG::SceneFile->winInfo* winPtr;". This will result in the error "expected unqualified-id before '->' token".

The mechanics of a turn based system...

I used a variable to track every battler's agility and set the turn order based on that by returning the highest value, then used a boolean array to track which battlers have taken a turn and set their agility to 0 depending on if the bool was on or off.

[RM2K3] CMS issue need help

I'm guessing you use a picture to highlight the submenu. Perhaps you are using the same picture ID as another picture which is causing your problem. You can try messing with picture IDs to fix your issue. Other than that I am not sure what your problem is without seeing the whole event.

Shop_Compare.png

This is really hard on the eyes. I suggest removing the transparent background.