+++ DYNRPG - THE RM2K3 PLUGIN SDK +++
Posts
author=Cherry
2) Catalog.h: Line 34: "list.count" should be "list->list.count" instead.
Shouldn't it be "list.list->count" instead? "list->list.count" gives me compile errors.
Another bug:
-1 is recognized as a token rather than a number
Maybe it's time for a bugtracker ^^
@RayCast V4,V5,-1,V5,12,13,4
Maybe it's time for a bugtracker ^^
A small question: Cherry, in the documentation (class Character) you say:
upd: I don't know, is it a bug or my misunderstanding, so I'm asking. In the map event there are Teleport command, which moves hero to the another map. After thet, in onComment callback, I look at the eventId argument and suddenly see that it is 0 - that's not true, of course. It seems that on another map this event looks like common, because it doesn't belong to the map. If that's a bug - can it be fixed, or it's some kind of internal restrictions? If that's my mistake - please tell me, where I'm wrong :)
author=CherryIt's relevant to hero, too. Is it dangerous to look at (not to change) this attribute, or you simply doesn't mention this?
int mapId
Map ID (only relevant for vehicles which are not supported yet)
upd: I don't know, is it a bug or my misunderstanding, so I'm asking. In the map event there are Teleport command, which moves hero to the another map. After thet, in onComment callback, I look at the eventId argument and suddenly see that it is 0 - that's not true, of course. It seems that on another map this event looks like common, because it doesn't belong to the map. If that's a bug - can it be fixed, or it's some kind of internal restrictions? If that's my mistake - please tell me, where I'm wrong :)
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):
@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.
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.
author=Cherry
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.
Thanks for explayning. It seems that this value is in fact read-only.
Okay. So I had the animated_monsters thing tweaked so that it had the whole thing blocked off. That is, except for the monsters I wanted, nothing would animate at all (freeing me from errors on stuff that I didn't want). But to do this, initially I had to work with some clunky code:
(replacing the Monster Name with the actual name)
So then, I tried adding in condition_icons the wholekeyname code thing (I removed width I think, and shifted keyname to being a global thing (it said outside scope otherwise)) and then I replaced
with
It does appear to work, at least in terms of blocking enemies out of the thing that aren't involved. But I'm not sure I know how to add anything in either (it's not a simple matter of just adding in the name, or the Monster(Num) and unlike the condition_icons one, it's a folder rather than an image file.
What I'd want is just as way to as before just add in the name of the creature (for example Monster id 186 is "Elias" and I'd like to just add "Elias" in) and check it as before, but using the config system. Which being that I'm largely a C++ means I'd need to see quite a few lines of code to see what to do.
Be specific. I have onStartup, initializeBattle, onDrawBattler, onBattlerDrawn, and onFrame. And I probably have the keyname part in the wrong one.
(battler->getName().compare("MonsterName") == 0) || (battler->getName().compare("MonsterName2") == 0)
(replacing the Monster Name with the actual name)
So then, I tried adding in condition_icons the whole
Condition << i
(battler->getName().compare("MonsterName") == 0) || (battler->getName().compare("MonsterName2") == 0)
(battler->getName().compare(configuration[keyName.str()]) == 0)
It does appear to work, at least in terms of blocking enemies out of the thing that aren't involved. But I'm not sure I know how to add anything in either (it's not a simple matter of just adding in the name, or the Monster(Num) and unlike the condition_icons one, it's a folder rather than an image file.
What I'd want is just as way to as before just add in the name of the creature (for example Monster id 186 is "Elias" and I'd like to just add "Elias" in) and check it as before, but using the config system. Which being that I'm largely a C++ means I'd need to see quite a few lines of code to see what to do.
Be specific. I have onStartup, initializeBattle, onDrawBattler, onBattlerDrawn, and onFrame. And I probably have the keyname part in the wrong one.
Interesting fact. If I set the battleSpeed to 0 and then set some actors' atbValue to 300000, the ATB gauge is visually filled, but no actions are performed. If atbValue is 300001 (or, I think, any number above 300000) - action is performed immediately. It seems that internally RPG Maker checks "atbValue>300000", not >=.
One more strange moment. In documentation you say:
Monster id is zero-based. Actor - seems to be one-based.
bool __cdecl onDrawBattler ( RPG::Battler * battler,
bool isMonster,
int id
)
...
id Zero-based party member ID of the battler
Monster id is zero-based. Actor - seems to be one-based.
So does anyone have a quick answer to my question? Or am I to be ignored?
I want a simple way to do this, so I could just have certain enemies animated, by DynRpg.ini codes
I want a simple way to do this, so I could just have certain enemies animated, by DynRpg.ini codes
In addition to trying out VX Ace recently, I made the jump to DynRPG for my current 2k3 project from the Power Mode 2003 patch, and managed to add the Better Auto Enter, and No Autobattle patches. For plugins, I've added the keyboard/mouse input, faster ATB, and particle effects so far.
There are two things that Power Mode had that I can't find a replacement for:
- ogg support. Although this isn't that high of a priority since I just converted all of my oggs over to wav or mp3, this would be nice to have again. I tried using the disharmony patch, but it ended up crashing DynRPG when it loaded. Power Mode's ogg support was pretty solid, although it was quirky.
- the ability to detect if there are no save games present. This was actually a really awesome feature that Power Mode had that the BAE patch doesn't. You could basically create two states for your title screen - one where "continue" is selectable, and one where it's grayed out. To do this, PM used variable 0001 as "control register 0" and if there are saves present, it would be automatically set to "1", otherwise if there were no saves, it would be "0".
In rm2003, you could basically set your title screen event to say "Branch if Var 0001 is 1", load these event instructions where "continue" is selectable, otherwise load these instructions, where it's not.
Is it possible to make a plugin for DynRPG? Can it detect if there are no saves present, or can this be added to a future release?
Here's the full description from PM's Readme:
1) 0001:CR0
“Control Register 0”. The "system variable" controlling some basic functions:
Set to 255 – call up the save menu.
Set to 254 – exit to Windows.
Whenever there is any variable operation executed, CR0 turns 1 if there is any savestates in the game folder, and 0, if there are none. In the latter case, the “call up the save menu” command won’t do anything.
NOTE: Some has attempted creating their custom main menu in such a way that there are BOTH save AND load options in it. I’m going to disappoint them a little: neither will this work in powermode, nor it is a good idea at all (=doesn’t really make sense).
There are two things that Power Mode had that I can't find a replacement for:
- ogg support. Although this isn't that high of a priority since I just converted all of my oggs over to wav or mp3, this would be nice to have again. I tried using the disharmony patch, but it ended up crashing DynRPG when it loaded. Power Mode's ogg support was pretty solid, although it was quirky.
- the ability to detect if there are no save games present. This was actually a really awesome feature that Power Mode had that the BAE patch doesn't. You could basically create two states for your title screen - one where "continue" is selectable, and one where it's grayed out. To do this, PM used variable 0001 as "control register 0" and if there are saves present, it would be automatically set to "1", otherwise if there were no saves, it would be "0".
In rm2003, you could basically set your title screen event to say "Branch if Var 0001 is 1", load these event instructions where "continue" is selectable, otherwise load these instructions, where it's not.
Is it possible to make a plugin for DynRPG? Can it detect if there are no saves present, or can this be added to a future release?
Here's the full description from PM's Readme:
1) 0001:CR0
“Control Register 0”. The "system variable" controlling some basic functions:
Set to 255 – call up the save menu.
Set to 254 – exit to Windows.
Whenever there is any variable operation executed, CR0 turns 1 if there is any savestates in the game folder, and 0, if there are none. In the latter case, the “call up the save menu” command won’t do anything.
NOTE: Some has attempted creating their custom main menu in such a way that there are BOTH save AND load options in it. I’m going to disappoint them a little: neither will this work in powermode, nor it is a good idea at all (=doesn’t really make sense).
Example C++ code:
See http://msdn.microsoft.com/en-us/library/windows/desktop/aa364418(v=vs.85).aspx
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
Wow! That was a quick reply. I'm just getting started with plugin making now (compiled a few cpp files already), and just attempted pasting that code. I got 2 build errors:
||=== save_detector, Release ===|
C:\Users\Rew\Documents\DynPlugins\save_detector\main.cpp|6|error: 'hFind' does not name a type|
C:\Users\Rew\Documents\DynPlugins\save_detector\main.cpp|10|error: expected unqualified-id before 'else'|
||=== Build finished: 2 errors, 0 warnings (0 minutes, 0 seconds) ===|
I assume it's expecting hFind to be int/bool etc, but in this case it's "handle?" Not sure how to fix it.
Edit: Nevermind. Figured it out. It's compiled and I'm testing now!
Edit 2: Had to place that code within "void onNewGame" & remove the "L" in front of save.lsd and it works!!! Thank you so much Cherry! I'm gonna mess around with this some more, and then upload the plugin.
||=== save_detector, Release ===|
C:\Users\Rew\Documents\DynPlugins\save_detector\main.cpp|6|error: 'hFind' does not name a type|
C:\Users\Rew\Documents\DynPlugins\save_detector\main.cpp|10|error: expected unqualified-id before 'else'|
||=== Build finished: 2 errors, 0 warnings (0 minutes, 0 seconds) ===|
I assume it's expecting hFind to be int/bool etc, but in this case it's "handle?" Not sure how to fix it.
Edit: Nevermind. Figured it out. It's compiled and I'm testing now!
Edit 2: Had to place that code within "void onNewGame" & remove the "L" in front of save.lsd and it works!!! Thank you so much Cherry! I'm gonna mess around with this some more, and then upload the plugin.
Yeah, I just figured the L was a typo. :)
Here's the save detector plugin (info included in the readme):
http://rpgmaker.net/media/content/users/40/locker/save_detector_v02.rar
I liked the features in RagnaDyn, but hated how it was all lumped into one plugin, so I stripped out the 3 switches (Fullscreen/Window/ATB Mode) and created a separate plugin for those:
http://rpgmaker.net/media/content/users/40/locker/ragnadyn_extrakeys.rar
Edit: Both now have ini settings! Had to use the tdm-gcc-4.6.1.exe instructions on the previous page to fix the LoadConfiguration compile issues.
When I get deeper into this stuff and start messing around with the Battle System, I'll try to implement the rest of RagnaDyn.
Here's the save detector plugin (info included in the readme):
http://rpgmaker.net/media/content/users/40/locker/save_detector_v02.rar
I liked the features in RagnaDyn, but hated how it was all lumped into one plugin, so I stripped out the 3 switches (Fullscreen/Window/ATB Mode) and created a separate plugin for those:
http://rpgmaker.net/media/content/users/40/locker/ragnadyn_extrakeys.rar
Edit: Both now have ini settings! Had to use the tdm-gcc-4.6.1.exe instructions on the previous page to fix the LoadConfiguration compile issues.
When I get deeper into this stuff and start messing around with the Battle System, I'll try to implement the rest of RagnaDyn.
Has anyone tried doing a mode7 plugin yet? I found some great documentation about it, but I wouldn't know where to begin with implementing it into rpg maker.
http://www.coranac.com/tonc/text/mode7.htm
http://www.coranac.com/tonc/text/mode7ex.htm
http://www.coranac.com/tonc/text/mode7.htm
http://www.coranac.com/tonc/text/mode7ex.htm
Damn, my upstairs computer needs repair, so I can't use it until then (heat sink problem).
Pepsi's codes look interesting, I might check them when I can. Especially the RagnaDyn, I've been wanting to tweak that for awhile.
Cerberus, what I was wanting, is you know the animated_monsters plugin? Well, it works for everything, giving an error if you have just a single frame monster that isn't animated (frame 1.png missing, frame 2.png missing, etc).
So the original maker said you could compare it to a name. And everything without one of those names, wouldn't check for animate. But the issue is that, if you're working with stuff, it helps to have it customizable so you don't have to build and rebuild to decide what you want to compare to, and instead have it look at the ini and say "oh, monster x is in the ini, let's animate that."
But I suck at working with the ini. Can someone teach me about atoi?
Pepsi's codes look interesting, I might check them when I can. Especially the RagnaDyn, I've been wanting to tweak that for awhile.
Cerberus, what I was wanting, is you know the animated_monsters plugin? Well, it works for everything, giving an error if you have just a single frame monster that isn't animated (frame 1.png missing, frame 2.png missing, etc).
So the original maker said you could compare it to a name. And everything without one of those names, wouldn't check for animate. But the issue is that, if you're working with stuff, it helps to have it customizable so you don't have to build and rebuild to decide what you want to compare to, and instead have it look at the ini and say "oh, monster x is in the ini, let's animate that."
But I suck at working with the ini. Can someone teach me about atoi?
It seems I understand. So, what format would you like to use for ini? Number=1, or Name=1? (To set what monsters are to be animated, I mean) First variant is, I think, a bit easier in programming, second - a bit easier in use (for game makers), but may result in something strange when the national symbols are used. Maybe better would be the first variant.
Another possible format is: Animated=1,3,6,14... (just a list of numbers, which monsters have to be animated) or Unanimated=... (the same list). Possibly it can be read faster - it doesn't make much sense, though, because it's read once and then saved into the boolean array.
As for me, I don't use the atoi, instead written a simple function which (without any checking at the moment) read the number written at the beginning of the std::string (the same may be with standart char*, I did in that way just for less convertations) or leave it unchanged, if string is empty. That's its code:
Is it what you need?
Yes, maybe it's not optimal, but it works :)
By the way, about the national symbols. I'm Russian, so my games use messages in Russian. It seems that they are incorrectly shown in patched games - symbols are printed too close, which hardens reading. Fonts are OK - in unpatched games text is correct. English symbols are correct too. Cherry, may it be the DynRPG issue, or I'm doing something wrong?
Another possible format is: Animated=1,3,6,14... (just a list of numbers, which monsters have to be animated) or Unanimated=... (the same list). Possibly it can be read faster - it doesn't make much sense, though, because it's read once and then saved into the boolean array.
author=bulmabriefs144
Can someone teach me about atoi?
As for me, I don't use the atoi, instead written a simple function which (without any checking at the moment) read the number written at the beginning of the std::string (the same may be with standart char*, I did in that way just for less convertations) or leave it unchanged, if string is empty. That's its code:
bool strtoint (std::string str, int *num) { int i; if (!(str.empty)()) { *num=0; for (i=0; str[i]; i++) (*num)=(*num)*10+(char)(str[i])-'0'; return true; } else return false; }
Is it what you need?
Yes, maybe it's not optimal, but it works :)
By the way, about the national symbols. I'm Russian, so my games use messages in Russian. It seems that they are incorrectly shown in patched games - symbols are printed too close, which hardens reading. Fonts are OK - in unpatched games text is correct. English symbols are correct too. Cherry, may it be the DynRPG issue, or I'm doing something wrong?