CHERRY'S PROFILE

Search

Filter

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

You can directly draw onto the screen using DynRPG, and the RPG Maker screen uses 16 bit.

So a plugin for displaying 16-bit pictures would be possible, even with alpha (though a bit complicated).

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

Sorry, I forgot that DynRPG doesn't use unicode, that's why the "L" was wrong.

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

Example C++ code:
WIN32_FIND_DATA lpFindFileData;
HANDLE hFind = FindFirstFile("save??.lsd", &lpFindFileData)
if(hFind != INVALID_HANDLE_VALUE) {
RPG::switches[123] = true;
FindClose(hFind);
} else {
RPG::switches[123] = false;
}

See http://msdn.microsoft.com/en-us/library/windows/desktop/aa364418(v=vs.85).aspx

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

Yes, that's right. :)

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

It's not relevant for the hero, there is another object "fieldScene" which is not implemented in DynRPG yet (the corresponding internal RPG Maker class is TLcfgFieldScene). X, Y and Map ID are stored in the fieldScene object too, and they are releveant. If you change Map ID there, the hero would be teleported.

If you change the value at RPG::hero, nothing will happen, but I think when you save and load the game, there might be strange effects if the map ID of the hero object and the fieldScene object are not in sync.

The mapId field in RPG::Character is only used for vehicles so that the RPG Maker knows on which map they should be displayed (because internally there exist as event on every map in the game, like the hero, but they are hidden if the mapId doesn't match the current map's ID).

EDIT: About the bug: Yes, eventId, pageId, lineId is buggy anyway, I noticed that. For example, pageId might be wrong if an event page has been called using "call event", and as you mentioned, the eventId might be wrong too on teleport. Only lineId works correctly at the moment (the nextLineId pointer does not, though). I hope I can fix it some day.

EDIT2: Here is untested code how to access the fieldScene in order to teleport the hero (which automatically changes the values at the hero object too):
class FieldScene {
public:
void **vTable;
int _unknown_4;
bool initialized;
bool teleport; // I don't remember if you have to set this to true manually or if it happens automatically when you change the mapId
int mapId;
int x;
int y;
// There are more members but I haven't analyzed them yet
}

static FieldScene *&fieldScene = (**reinterpret_cast<FieldScene ***>(0x4CDC1C));

@Deflaktor: You are right. Please try this dynloader.dll, it should have all the parsing bugs fixed: http://share.cherrytree.at/showfile-8675/dynloader.dll

The reason for these bugs, by the way, is that parsing comments needs to be very fast otherwise it would slow down the game. At first, I used normal library functions for string split, etc. - which was too slow. Now I created my own parsing function which has to walk through the whole comment only once in order to analyze it and fill the parsedData structure, without any memory or temporary string allocations. Obviously it's not perfect, though.

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

Oh right. ._.

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

@deflaktor: Interesting. First I thought: Yes, that's a known bug. If a command doesn't end with a number, append a dummy token like ", end" or at least a comma... But then I realized that the command doesn't end with "hero" but it's the first parameter...

Thanks for telling me!

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

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.

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

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;
}

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

Hmm, I am not sure what could be the incompatibility there.

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;
}
Does anybody have an idea what might be wrong with that? (In the .h file the "filename" parameter is declared optional.)