+++ DYNRPG - THE RM2K3 PLUGIN SDK +++
Posts
By crashes on startup you mean... doesn't compile or literally rpgmaker crashes on startup?
For onStart keep it simple. Don't overload the namespace with alot of C++ variables
configuration = RPG::loadConfiguration(pluginName); that's in my code too, so no that's fine.
The other two should be moved outside the thing to run in any and all namespaces (you're defining globally). Char sucks anyway, use strings. And not just regular strings, use the std::string format, since this is running off a game.
But here's the biggie. Always stick to the given names of objects. Making your own (conf instead of configuration) can sometimes cause glitches because such codes are actually written this way internally. If the thing were written RPG::Actor::getName and I instead changed it to Get_N it would crash.
#define AUTO_DLLMAIN
#include <DynRPG/DynRPG.h>
#include <iostream>
using namespace std;
std::map<std::string, std::string> configuration;
std::string mystring;
bool onStartup(char *pluginName) {
// We load the configuration from the DynRPG.ini file here
configuration = RPG::loadConfiguration(pluginName);
return true; // Don't forget to return true so that the start of the game will continue!
}
Something like this.
For onStart keep it simple. Don't overload the namespace with alot of C++ variables
configuration = RPG::loadConfiguration(pluginName); that's in my code too, so no that's fine.
The other two should be moved outside the thing to run in any and all namespaces (you're defining globally). Char sucks anyway, use strings. And not just regular strings, use the std::string format, since this is running off a game.
But here's the biggie. Always stick to the given names of objects. Making your own (conf instead of configuration) can sometimes cause glitches because such codes are actually written this way internally. If the thing were written RPG::Actor::getName and I instead changed it to Get_N it would crash.
#define AUTO_DLLMAIN
#include <DynRPG/DynRPG.h>
#include <iostream>
using namespace std;
std::map<std::string, std::string> configuration;
std::string mystring;
bool onStartup(char *pluginName) {
// We load the configuration from the DynRPG.ini file here
configuration = RPG::loadConfiguration(pluginName);
return true; // Don't forget to return true so that the start of the game will continue!
}
Something like this.
It shouldn't make any difference whether it's called "conf" or "configuration". That's only a variable name.
Of course, names within the RPG namespace can't be changed, but I don't think you are trying to do that anyway.
Of course, names within the RPG namespace can't be changed, but I don't think you are trying to do that anyway.
author=bulmabriefs144Literally crashes with standart Windows error.
By crashes on startup you mean... doesn't compile or literally rpgmaker crashes on startup?
author=bulmabriefs144Why, if I use the map and char only inside this callback? But ok, thanks, it seems reasonable (just for unity).
The other two should be moved outside the thing to run in any and all namespaces (you're defining globally).
author=bulmabriefs144Previosly I worked in pure C. As for me, char is simply 1-byte number (and here it is used in this way). Maybe it's bad habit, of course :)
Char sucks anyway, use strings.
author=bulmabriefs144You can see that variable conf is created by myself, not by DynRPG library. As far as I know, that's no difference how to name it, if this name isn't yet in use.
But here's the biggie. Always stick to the given names of objects. Making your own (conf instead of configuration) can sometimes cause glitches because such codes are actually written this way internally. If the thing were written RPG::Actor::getName and I instead changed it to Get_N it would crash.
Cherry, sorry, didn't see your first post before.
Plugin crashed again. Debugger (Visual Studio) says: "Unhandled exception in RPG_RT.exe (TIME_MEASURE.DLL): 0xC0000005: Access Violation" and point to the line:. Global definitions doesn't help. I'll try now the sample plugin.
upd: Sample plugin (compiled by myself) crashes with just the same error, only at another asm line (but on the same command). I'll try your DLL now.
upd2: your DLL started fine. It seems that something is bad with my compiler... Strange, because I followed your instruction and use Code::Blocks (with its standart compiler).
Plugin crashed again. Debugger (Visual Studio) says: "Unhandled exception in RPG_RT.exe (TIME_MEASURE.DLL): 0xC0000005: Access Violation" and point to the line:
6E2CC548 mov ecx,dword ptr [ecx]
upd: Sample plugin (compiled by myself) crashes with just the same error, only at another asm line (but on the same command). I'll try your DLL now.
upd2: your DLL started fine. It seems that something is bad with my compiler... Strange, because I followed your instruction and use Code::Blocks (with its standart compiler).
@Cerberus:
This might be the issue. Probably I should check it and update the manual...
EDIT: Could you upload your DLL? I am interested in what's going wrong (from the technical side).
author=Kazesui
If you followed the instructions in great detail, given on the DynRPG site and still can't get it to work, it could be that you're using the wrong compiler. If you recently downloaded Code::Blocks, compiler included, you probably got the new gcc compiler, which doesn't work with this patch.
You'll have to use a sufficently old version of gcc for it to work.
I'm not entirely sure how old is old enough, but I THINK version 3.8.5 will work (I'm not entirely sure about this though)
This might be the issue. Probably I should check it and update the manual...
EDIT: Could you upload your DLL? I am interested in what's going wrong (from the technical side).
http://elementconflux.ucoz.ru/sample.dll
Here it is (not DLL of my project, but DLL of your one, which, as I mentioned, was compiled unproperly by my g++).
Thanks for information, I'll try to look for older version. I've got MinGW before installing Code::Blocks, but without g++, only with gcc... As far as I know, it can make difference here.
Here it is (not DLL of my project, but DLL of your one, which, as I mentioned, was compiled unproperly by my g++).
Thanks for information, I'll try to look for older version. I've got MinGW before installing Code::Blocks, but without g++, only with gcc... As far as I know, it can make difference here.
Hmm, I am not sure what could be the incompatibility there.
Maybe somebody else has an idea...
Here is the source code of loadConfiguration:
Does anybody have an idea what might be wrong with that? (In the .h file the "filename" parameter is declared optional.)
Maybe somebody else has an idea...
Here is the source code of loadConfiguration:
std::map<std::string, std::string> loadConfiguration(char *sectionName, char *filename) {
char *buffer = new char[32768];
char *pKey = buffer;
std::map<std::string, std::string> data;
std::string sFilename(".\\");
if(filename) {
sFilename += filename;
} else {
sFilename += "DynRPG.ini";
}
GetPrivateProfileSection(sectionName, buffer, 32767, sFilename.c_str());
while(*pKey) {
std::string strKey = pKey;
std::string::size_type nPos = strKey.find('=', 0);
data[strKey.substr(0, nPos)] = strKey.substr(nPos + 1);
pKey += strlen(pKey) + 1;
}
delete[] buffer;
return data;
}loadConfiguration is not the only thing not working anymore. isMovePossible() doesn't work either. Same Problem.


Just move it outside the thing already. If it doesn't work, and it's the right code, the rule of thumb is that it's in the wrong place, or something is missing.
What are you trying to do anyway?
If you're working with strings, Kazesui and I made this in the last few weeks (I'd like to get it published on CherryTree, but I'd need Kaz to give permission, since I only modified it, I'm not the initial creator).
If you're wanting a text display thing, there's DynText. If you're wanting something that inputs individual keys, Cherry has himself made something called Keyboard and Mouse.
Read the Getting Started instructions carefully, to make sure you did everything right. I skimmed that the first 1000 times, and codes seemed to crash. Then I linked everything properly and stuff suddenly worked. MinGW must look like this.
What are you trying to do anyway?
If you're working with strings, Kazesui and I made this in the last few weeks (I'd like to get it published on CherryTree, but I'd need Kaz to give permission, since I only modified it, I'm not the initial creator).
If you're wanting a text display thing, there's DynText. If you're wanting something that inputs individual keys, Cherry has himself made something called Keyboard and Mouse.
Read the Getting Started instructions carefully, to make sure you did everything right. I skimmed that the first 1000 times, and codes seemed to crash. Then I linked everything properly and stuff suddenly worked. MinGW must look like this.

Got it to work.
I used the compiler from here the tdm-gcc-4.6.1.exe (Make sure to uncheck "Check for updated files on the TDM-GCC server")
The problem seems to be gcc 4.7.x
I used the compiler from here the tdm-gcc-4.6.1.exe (Make sure to uncheck "Check for updated files on the TDM-GCC server")
The problem seems to be gcc 4.7.x
I'm talking about the problem Cerberus and I have.
The crash on startup when using RPG::getConfiguration() is caused by gcc 4.7.x
Downgrading to gcc 4.6.1 does the trick
The crash on startup when using RPG::getConfiguration() is caused by gcc 4.7.x
Downgrading to gcc 4.6.1 does the trick
author=Deflaktor
loadConfiguration is not the only thing not working anymore. isMovePossible() doesn't work either. Same Problem.
That's even more strange, since isMovePossible is only a thin wrapper around an internal RPG Maker function (someRPGCharacterObject->vTable{11], to be exact). Maybe something with the assembler support is broken?
bool Character::isMovePossible(int fromX, int fromY, int toX, int toY) {
bool ret;
asm volatile(
"pushl %7;"
"pushl %8;"
"call *%%esi"
: "=a" (ret), "=d" (_edx), "=c" (_ecx) : "S" (vTable[11]), "a" (this), "d" (fromX), "c" (fromY), "g" (toX), "g" (toY) : "cc", "memory"
);
return ret;
}You could try generating a new libDynRPG.a with the new compiler suite. I think the problem lies within the new version of the linker of gcc.
Something else: Seems like I made two mistakes, which is why RPG::monsters doesn't work.
1) DList.h: Lines 10 and 11 need to be swapped.
2) Catalog.h: Line 34: "list.count" should be "list.list->count" instead.
1) DList.h: Lines 10 and 11 need to be swapped.
2) Catalog.h: Line 34: "list.count" should be "list.list->count" instead.
author=bulmabriefs144
No, I meant what does the plugin do? I know what that version does.
you mean action_ks.dll? Nothing as of now, I just started it. Im trying to make intelligent KI for an ARPG.
Also I found an interesting bug:
if you execute two comment-commands and one uses a parameter as string and the other a parameter as a token this happens:

(I'm debugging by using MessageBoxes. The MessageBoxes are ingame and the one on the left has read the token incorrectly.)
the token hero gets the "xt" from "myText". It seems that the four first characters of "myText" are overwritten with "hero" but the rest is not removed. So in the end the parsed parameters token will become heroxt and is not recognized by my plugin. Kinda complicated to explain but I hope you get what I mean.
author=Deflaktor
Got it to work.
I used the compiler from here the tdm-gcc-4.6.1.exe (Make sure to uncheck "Check for updated files on the TDM-GCC server")
The problem seems to be gcc 4.7.x
Thanks very much! It worked.
author=CherryIt seems that "list.list->count" (on your version my compiler says "list isn't a pointer" about first "list"). I'll check whether this work in my case...
2) Catalog.h: Line 34: "list.count" should be "list->list.count" instead.
upd: yes, now it seems to work.















