New account registration is temporarily disabled.

KAZESUI'S PROFILE

Doing Super Programming
on Super Computers
for Super Performance
The Curse of Cpt. Lovele...
Nautical-themed cephalopod-pirate-based action-shmup.

Search

Filter

[DynRPG Plugin]Blending Mode

To be honest, not really.
On the assumption that this plugin is the cause, that'll be a little bit surprising, since it wasn't made with optimizations for intel.

I'm not certain, but I imagine a possible culprit would be some quirk of the compiler, which is fairly restrictive when it comes to DynRPG which might mean that there's not too much to be done anyway.

What makes a good puzzle?

A good puzzle is the kind where the player feels clever for having solved it (irrespective of whether the puzzle was actually difficult or not).

To have this hit home with as many as possible, you'd do well to have the puzzle rely on something which doesn't seem obvious at first, but which the player is very likely to "accidentally" discover whilst playing, and this discovery making the puzzle relatively easy to solve.

[RM2K3] (DynRPG) A way to display an item name using a variable?

You should be able to do this using the DynText plugin, but keep in mind that this does not work with the typical text box command. Pretty sure this can be done with the textbox as well, but I don't know of a plugin which does that, meaning you'd likely have to code the plugin yourself (involves programming in C++).
Keep in mind that DynRPG itself doesn't come with any such functionality, you need to download plugins separately after patching the maker with DynRPG (and the official version is incompatible with DynRPG)

That said
\i[100]
would logically give you the 100th item in the database, not the item with value stored in variable of id 100. To do that you'd likely want to do something more along the lines of
\i[\v[100]]

[RM2K3] DynRPG Compiling Error

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.

[RM2K3] DynRPG Compiling Error

author=McBick
That is what I have been using them for, but it is weird to me that I don't have to define them as an int, string, or elsewise.

As mentioned, the compiler automatically considers them to be integers (unless other specified, though limited to being some integer type variant, e.g. no float or string).

author=McBick
Do you know if there is a way to play animations from DynRPG, specifically during battle? This is the only thing I can find for playing animations in battle:
RPG::AnimationInBattle->isAnimationPlaying = true;
RPG::AnimationInBattle->currentAnimationId = n;

This does nothing when executed though.

Nope, do not know how to use the native battle animations. If I felt the need to use animations in the default battle system, I would probably just use RPG::Image directly, though that would be tricky on a potential non-savvy end-user, as you'd lose the battle animation generation interface.

[RM2K3] DynRPG Compiling Error

Yup, if you want to make it general for other people to use, then you'll have make use of that functionality.

As for enumerators, they are there more for the programmer's convenience than other things.
In the strictest sense, they are practically named constants which are automatically assigned an integer value if you don't explicitly assign a value to them.

// semantically, this is relatively similar
enum color
{
   RED,
   GREEN,
   BLUE
}

// to this
const int RED = 0;
const int GREEN = 1;
const int BLUE = 2;

// and to a certain extent even this
#define RED 0
#define GREEN 1
#define BLUE 2
Of course, note that each of these code blocks are not meant to be appear in any code base all at the same time.

enums are generally there to store named states or specific values which would be cryptic to keep track of between multiple programmers for a common code base.
// It's easier to understand what is happening here
if(myColor == RED)
    ...
// Than it is to understand this
if(myColor == 0)
    ...
Note that common convention dictates that constant values (like those found in enums) are generally all upper-case.

[RM2K3] DynRPG Compiling Error

The conventional way of doing this would be to use onSaveGame and onLoadGame callbacks and the functionality within it to save the data to files, assuming your data is save game specific.

You could use the text plugin source given on page 2 of this thread as an example of how this functionality can be used.

If this gives a headache and you can convert the values into integers, you could just store them directly into the RPG::variables, or you could even store in at actors which are only used as variable deposits, as then the ingame load and savegame functionality should take care of it and you just need to query these values directly from the database upon loading a gamefile.

[RM2K3] DynRPG Compiling Error

author=McBick
Is there a reason I can't include the if statements in a callback that is called multiple times? From my understanding nothing will happen, at worst it will check a single line of execution. I think the battle callbacks are only called 30 times a second, so that means the callback will be called 30 times a second? This seems quite negligible as even the weakest CPUs could run millions of lines of code a second.


This is just a code thing, as there shouldn't be any performance issues from this (that aside, I would have thought it would be called 60 times a second, as rm2k3 otherwise generally runs at a fixed 60 FPS if it is able to keep up. Never checked for battles though).

While it's not going to be a performance issue, it will look like a curiosity though, since that if will be processed many times for no real reason. Ideally, you wouldn't need to go back and forth between the callback functions, since one would ideally just allocate it once and then use it in the other function. If you have a variable amount of text you might want to add. It's up to your discretion to do so or not though, and your plugin should function perfectly fine without doing this as well.

Another little tip which requires minimal change and keeps the code in the battle callback
if(!myImage["winStats"]){
    myImage["winStats"] = RPG::Image::create(320, 64);
    myImage["winparty"] = RPG::Image::create(320, 64);
    ...
    myText["winStats"] = RPG::Image::create(160, 16);
    ...
}

since you only allocate all images at once, you only need to check for one of your images. Either all of the images will have been allocated or none of them. This will prevent a little bit of code clutter from have a long list of if statements.

[RM2K3] DynRPG Compiling Error

author=McBick
std::map<int,RPG::Image*> images;
images[0] = RPG::Image::create();
images[0] = RPG::Image::create(); //A crash should happen here
RPG::Image::destroy(images[0]);
From what I studied this should not work. At least from my understanding you can not declare the same key twice, but perhaps I misunderstood this?

You're half right. That you cannot declare the same key twice is true, but a declaration of the key is actually only done the first time. If you would use the "insert" method, it would probably have failed, but not when using the subscript operator (the square brackets). What actually happens is that when you use this, it will first check if a key exists for they key you give, and if it does not exist, it will create a key. This is what happens the first time, but the second time it just gives you access to the pointer variable without trying to create another key.


author=Kazesui
You do not need the std::map data structure to use the if check. To be honest, if you have two static images which you use and you don't loop through a for loop anyway, it would generally make sense to give them more specific names and use them directly as a variable

Yes, I have learned this upon cleaning up my code. I have kept the map structure only for any HUD text now, but have since changed the objects for the window graphics to each have their own variable.

author=McBick
author=Kazesui
RPG::Image* image;
image = RPG::Image::create();
if(!image) //Error cannot convert image from RPG::Image to type bool.
    image = RPG::Image::create();
RPG::Image::destroy(image);
I'm not sure how this is supposed to work as the if condition will always be false and the destroy function will always be called immediately after creating the Image. Also this does not compile.

You sure you remembered to make "image" an RPG::Image* rather than an RPG::Image? While I don't have a compiler to validate with at the moment (or rather, I don't have one compatible with DynRPG), I'm pretty sure this should compile.
Also, the code was just for demonstrative purpose rather than being something which can actually be used. I was simply trying to make sure you didn't think you needed the map data structure to make the if statement work (which in this code example should be perpetually false, as you say).

author=McBick
std::map<std::string, RPG::Image*> myImage;
std::map<int, RPG::Image*> myText;
if(!myImage["winStats"])
    myImage["winStats"] = RPG::Image::create(320, 64);
if(!myImage["winParty"])
    myImage["winparty"] = RPG::Image::create(320, 64);
...
if(!myText["winStats"])
    myText["winStats"] = RPG::Image::create(160, 16);
...

I have no destroy functions as the code will never create multiples of the same Image objects.

I'm going to assume that the std::maps are global and that the ifs are within a callback function (I believe it should crash if this was all global). There's no need for the if statements at this point, since the keys can't exist at the point of the check, and as long as you're not using a callback which is called multiple times (which you shouldn't anyway for something meant to be allocated once like here). Apart from that, as mentioned, this should be fine.

[RM2K3] DynRPG Compiling Error

author=McBick
I believe with the map function it is impossible to have multiples of the same key too, so this should protect me from memory leaks too

The map data structure does not really protect you from memory leaks as it the value can be overwritten the exact same way a regular variable can
std::map<int,RPG::Image*> images;
images[0] = RPG::Image::create();
images[0] = RPG::Image::create();
RPG::Image::destroy(images[0]);

The code above also leads to a memory leak. The key does not protect you. Just as a side note
RPG::Image* image;
image = RPG::Image::create();
if(!image)
    image = RPG::Image::create();
RPG::Image::destroy(image);

This code does not lead to a memory leak. You do not need the std::map data structure to use the if check. To be honest, if you have two static images which you use and you don't loop through a for loop anyway, it would generally make sense to give them more specific names and use them directly as a variable, like RPG::Image* battleHUD or something (they still need to be global though). You might already understand this, but I'm just trying to attack it from various angles, since there still seems to be some confusion given how keys do not give protection against memory leaks.

author=McBick
I think I know why there aren't really any plug-ins that change the default battle system though. There are many issues with the order in which rm2k3 changes battle variables and such. I would have been better off just making my battle system exist independently from the default battle system. Unfortunately that would mean the removal of battle events as well unless I really went out of my way to parse monster group pages and battle events, which would be very time consuming.


That's probably part of it, along with the fact that most of the C++ developers here probably don't understand the battle system all too well, and the ones which do don't code C++ all too well. That, and it probably is tricky to make something nice and generic which could be useful for other people based on the default battle system without limiting the ways a plugin user can make changes to the system to fit their specific needs. It's a lot easier to hack together something which does what you need for your own game than to something which is generic enough for a random person to be able to incorporate it in a useful manner in their own game which won't require them to learn about a lot of quirks and conditions to be able to use the plugin. The default battle system just doesn't make this easy.