BUGMENOT'S PROFILE

Search

Filter

[RM2K3] Plugin: If Monster Present is...

copy pasted version of CodeBlocks

Try the proper route (worked on Win7, works on Win8.1, as far as I can tell, too):

[1]
download Codeblocks with GCC 4.7.1

[2]
run the downloaded codeblocks-13.12mingw-setup

[3]
Don't read the License agreement, here's what it says:

-totally free (except time and nerves)
-creators: Free Software Foundation, Inc.; Copyright (C) 2007 ; try to respect them
-copy & distribute allowed, but no passing it off as your own work
-don't be a dick
-GNU General Public License:
  • -freedom to distribute free software (but not if there's a price on it)
    -freedom (with free software) to ask for source code, to modify source code, to use pieces
    of source code in your own stuff; try to respect other people if they decide to help you
    -if new software results, you yourself are responsible for figuring out bugs in it
    -the same freedom applies to others (using your stuff) as well
    -if you make your work free under GNU GPL and provide documented source code, others might
    help you figuring out bugs, make the software more useful and/or better
    -don't be a dick

-GNU General Public License may apply to your resulting programs as well, or you can sell the results if you want
(people buy if it's good & worth it (& not available for free elsewhere); try not to be too much of a dick)

[4]
Agree
Next >
Browse where to put it
Install
Wait
Next >
Finish

[5]
download dyn0.20
dynrpg_patcher: patch your RPG_RT.exe if you haven't already (use clean RPG_RT.exe if possible)
extract the sdk folder

[6]
put contents of ../sdk/include into ../CodeBlocks/MinGW/include
put contents of ../sdk/lib into ../CodeBlocks/MinGW/lib

[7]
Start CodeBlocks
default compiler: GNU GCC Compiler
OK
"No, leave everything as is"
(later, when selecting a .cbp file (in a plugins source folder) set CodeBlocks as default program to open it up with)
OK

[8]
(up top) File > New > Project...
select Dynamic Link Library, press Go/Enter/whatever
Next >
Project title: name your plugin
Folder to create project in: select DynPlugins folder of your game
Next >
make sure Compiler = GNU GCC Compiler
uncheck "Create "Debug" configuration"
Output dir.: put " ..\ " (2x dot, 1x \)
click Finish

[9]
(up top) Project > Build options...
Linker settings > Link libraries > Add
enter DynRPG
OK
OK

[10]
(up top) Project > Set programs' arguments...
Host application > select RPG_RT.exe
OK

[11]
(left side of CodeBlocks)
Sources > main.cpp > double click > Ctrl+A > delete contents of main.cpp
delete contents of main.h (in Headers) as well

[12]
start creating / pasting code in main.cpp

[13]
In case of trying to figure C++ out


figure out the #includes

#include <DynRPG/DynRPG.h>

[RM2K3] Plugin: If Monster Present is...

int getMonLiveCount()
{
int MonGroupSize = ( *reinterpret_cast<int ****> (0x4CDE64) )[0][2][2];
int monLiveCount = 0;
for (int i = 0; i < MonGroupSize; i = i++)
{
if (RPG::monsters[i]->notHidden == true && RPG::monsters[i]->hp != 0)
{ monLiveCount++; }
}
return monLiveCount;
}

Uhm, yeah notHidden isn't actually set to false when a monster dies, so testing if hp != 0 would be needed, too.

[RM2K3] Plugin: If Monster Present is...

I bet there's different ways to do this, but:
#include <DynRPG/DynRPG.h>


int isMonPresent (int ID)
{
int MonGroupSize = ( *reinterpret_cast<int ****> (0x4CDE64) )[0][2][2];
if (ID > 0 && ID <= MonGroupSize)
{
return RPG::monsters[(ID)-1]->notHidden;
} else {
return -1; //error message = "invalid monster"
}
}

bool onComment ( const char* text,
const RPG::ParsedCommentData* parsedData,
RPG::EventScriptLine* nextScriptLine,
RPG::EventScriptData* scriptData,
int eventId,
int pageId,
int lineId,
int* nextLineId )
{
std::string cmd = parsedData->command;
if(!cmd.compare("is_mon_present") && parsedData->parametersCount == 2 && parsedData->parameters[0].type == RPG::PARAM_NUMBER
&& parsedData->parameters[1].type == RPG::PARAM_NUMBER)
{
//comment "@is_mon_present [0], [1]" substitute [x] with numbers or a Var_ID with a "V" in front
int a = parsedData->parameters[0].number; //get Enemy_ID (1, 2, 3, ...)
int b = parsedData->parameters[1].number; //Var_ID for output
RPG::variables[b] = isMonPresent(a);
}
return true;
}



boolean value you can use if you've won the battle

There's always a workaround for everything.

Defeat:
return ( *reinterpret_cast<char ***> (0x4CDD38) )[0][132];


Victory:
return ( *reinterpret_cast<char ***> (0x4CDD38) )[0][133];



...or:
return ( *reinterpret_cast<long ***> (0x4CDD38) )[0][31];

current BattlePhase (0|1|2|3 = Battle|Death|Victory|End)

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

Screen scrolling in pixels (in addition to tiles). Since, why not. Maybe someone finds a use:

download ScreenScrollBug-in

[RM2K3] Rpg maker 2003 battle skills question help please.

In case the person above me did in fact miss the problem:
Your "Weapons" command has the archetype "Skill". Change that to "Skill Subset", too.

Yes, you have to change a lot of Skills (the type).
No, I or other people will not quote unquote "fix" the Skills to not show subsets.
And yes, most people don't realize that archetype "Skill" shows everything learnt, as seen in the default menu.

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

author=Xenomic
I'm going to assume it's a no-go though...
Depends on what you have in mind.

Static EXP curve dictated by variables. Easy.
EXP Curve from a plugin / updating approprietly. Somewhat doable.
Custom stat progression (probably not logged on down-leveling). Just slightly impossible to not mess up.


author=bulmabriefs144
You can even code If (Char1) uses $AFight...
'twas talking about [row] which can not be set as a battle event trigger, thus not be detected in vanilla 2k3 (DynRPG plugins can detect it, though. Issues with battle events being out of sequence may occur.).

author=bulmabriefs144
I'd want some formula that compares party total AGI to monster total AGI [...]

You can set the FleeChance with
bool onComment ([...])
{
int newFleeChance;
[...]
//calculations and stuff changing newFleeChance
[...]
( **reinterpret_cast<long ***> (0x4CDD38) ) [22] = newFleeChance;
return true;
}
Set newFleeChance to 101 if you want to guarantee an escape.

FleeChance by default is
50 + (100 - 100x(AverageEnemyPartyAGI / AverageHeroPartyAGI))
and increases by 10% every time the escape command fails, and does not update when the faster enemies are removed from the fight.
Just don't make something worse.


That "Escape" in the Fight|Auto|Escape window is misleading if you think it's the same as in RM2k.
It's 100%, though only usable if escape = allowed, nothing made a turn yet and if you have an advantage over the enemy (initiative/surround/firstStrike).


What DynRPG's missing is a (fast) compiler that converts comments with certain prefixes and runs them like plugins (without access to callbacks, I guess. Unless registered somewhere for later re-accessing).
So stuff like setting (0x4CDD38)[22] does not eat up a whole plugin.
(Or to prevent creating a giant plugin that grants access to... (sort of) a lot of stuff)

Something like RMVXP's script event command. Just less retarded. (execution- and planning-wise)

[RM2K3] Easy way to show small dialogue boxes in DBS?

author=PepsiOtaku
Does it automatically move the blinker thing? Or would that patch still be needed?
It's automatically centered at the bottom. Though you can still use the SetBlinker to move that thing around (Var+0 = y-Pos, Var+1 = x-Pos). iirc the position updates in real-time. (dancing blinker. again)
The coordinates are screen coordinates (not adjusted to the window's borders).

[RM2K3] Easy way to show small dialogue boxes in DBS?

author=PepsiOtaku
My method is not easy (nor 100% break-proof)
Now, don't make me delete the link a third time:

download BattleMessenger

Remove any QuickPatches that change something about battle messages (the one above and BottomBattleMessage)


Is that less bothersome than trying to cope with the way transparancies get messed up?

I can guarantee that this is 100% break-proof. Unless it crashes your game with a pointer error or something. And nothing will be displayed if width/height are zero.

[RM2K3] Easy way to show small dialogue boxes in DBS?

author=Shoobinator
I got a pointer error or something
Any QuickPatches that write around 4C72xx? What's the error saying?

[PATCH EXPUNGED] Well that was 1/4 of an hour wasted.

Ask PepsiOtaku, he mentioned a plugin that draws the message box at different heights, with different heights. (the down-pointy-cursor-thingy needs to be placed... x = x(Window)+1/2width(Window)-8, y = y(Window)+height(Window)-8)

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

author=bugmenot (06/22/2014)
Changes the last BattleCommand (Row) into another BattleCommand(ID)
download RowSwap

[QuickPatches]
RowSwapCommand(ID)=49606E,#1
Command_IDs can be found under Battle Layout -> Default Battle Commands -> [Set]


author=bulmabriefs144
defense being higher than damage (resulting in a negative number)
(STR/2 - DEF/4) gets set back up to zero if the result would be negative.

author=Shoobinator
Both skills and regular attacks still seem to have this absorption issue even with this most recent update.
Care to elaborate on the setup?

Are you sure you don't have any other attribute that has higher damage multipliers than the one that should get absorbed?