PEPSIOTAKU'S PROFILE

PepsiOtaku
Perhaps I can find new ways to motivate them.
2369
Randal Graves: Which did you like better? "Jedi" or "The Empire Strikes Back"?
Dante Hicks: "Empire".
Randal Graves: Blasphemy.
Dante Hicks: "Empire" had the better ending. I mean, Luke gets his hand cut off, finds out Vader's his father, Han gets frozen and taken away by Boba Fett. It ends on such a down note. I mean, that's what life is, a series of down endings. All "Jedi" had was a bunch of Muppets.
Everlasting Journey
Characters, magic, stats, charm, plot, ADVENTURE!

Search

Filter

[RM2K3] I don't understand timing!

Yeah, you'd have to turn on the switch in every teleport within the town, and turn off the switch in the teleports where you leave the town.

[RM2K3] I don't understand timing!

From the top:
Make an auto-start event. On page 1, use all the default start conditions (no boxes checked) and add your show picture: 0% and move picture: 100%+wait. Next, erase that picture. Then, at the very end of your event script, turn a switch ON (any switch will do). Create a second page that is NOT auto-start. Set it to action key and give it a starting condition for when that switch mentioned previously is turned on. Save the event. That's all you need there.

Next, go into all of your teleport events where you teleport off that map, and turn off that switch.

So basically, when you walk into the map, You get the name of the town, it fades away and turns on the switch. Then, when you leave to the world map or whatever, the switch is turned off so that next time you show up to the town, it can turn on again. If you do that, you should be able to move the hero after the switch is turned on.

If you want the hero to move while the name of the town is shown, instead of an auto-start event, make it parallel process--meaning that event script runs alongside any other events, regardless of their start conditions. You'll run into more timing issues if you go this path though.

That's probably the simplest way to handle it. There's some more advanced things you could do, but I won't go into that for now.

[RM2K3] [DynRPG] Simulate Keypress

The mouse X & Y might be the screen's X & Y though, so you might need to do something trickier than that.

author=Annoyed_Grunt
Well Game Maker is designed for any kind of game :P

Maybe I'm mis-understanding you here, but it sounds like you're confusing Adventure Game Studio with Game Maker. You can indeed make any kind of game with game maker, but Adventure Game Studio was designed specifically for adventure games, so it would be less work.

I can see why you'd want to do it in 2k3 for the contest though. What's the timeframe you have for it?

[RM2K3] [DynRPG] Simulate Keypress

author=bugmenot
But... key bindings


Pssssshhhhhhh. Booo this man!

author=Annoyed_Grunt
I need to make the game in Rm2003. If I didn't have this restriction I'd use Game Maker.


Adventure Game Studio is neither though. It was designed for adventure games...

Why doesn't the code I wrote work?


I'm guessing it's how you're trying to call your comment. If you're forcing the menu open, it might interfere with the event script or something. Try calling it from a parallel process event of some kind.

[RM2K3] [DynRPG] Simulate Keypress

Out of curiousity, have you heard of Adventure Game Studio? It might be worth looking into if you're going to make an adventure game.

To answer your question, there's a number of ways you can do this for 2k3. This would simply simulate the keys:
#include <DynRPG/DynRPG.h>

bool onStartup (char *pluginName) {
configuration = RPG::loadConfiguration(pluginName);
confMouseInput = atoi(configuration["MouseInputSwitch"].c_str());

/* Add to DynRPG.ini:
[plugin_name]
MouseInputSwitch=1234
Change plugin_name to match filename of plugin dll without extension
Change MouseInputSwitch to whatever switch ID you want to use to enable/disable keypress checking
*/

return true;
}

void onFrame (RPG::Scene scene){
if (switches[confMouseInput]) { // IMPORTANT! This switch must be turned on in order to check for mouse clicks!
if (GetKeyState(VK_LBUTTON) & 0x8000) // Left mouse button
{
keybd_event(VK_RETURN,0,0,0);
keybd_event(VK_RETURN,0,KEYEVENTF_KEYUP,0);
}
else if (GetKeyState(VK_RBUTTON) & 0x8000) // Right mouse button
{
keybd_event(VK_ESCAPE,0,0,0);
keybd_event(VK_ESCAPE,0,KEYEVENTF_KEYUP,0);
}
else if (GetKeyState(VK_MBUTTON) & 0x8000) // Middle mouse button
{
keybd_event(VK_ESCAPE,0,0,0);
keybd_event(VK_ESCAPE,0,KEYEVENTF_KEYUP,0);
}
}
}

And this would turn on a switch each time you hit a mouse button, which might be more desirable since you could create your own menus/ui this way:
#include <DynRPG/DynRPG.h>

bool onStartup (char *pluginName) {
configuration = RPG::loadConfiguration(pluginName);
confMouseInput = atoi(configuration["MouseInputSwitch"].c_str());
confLButtonSwitch = atoi(configuration["LButtonSwitch"].c_str());
confRButtonSwitch = atoi(configuration["RButtonSwitch"].c_str());
confMButtonSwitch = atoi(configuration["MButtonSwitch"].c_str());

/* Add to DynRPG.ini:
[plugin_name]
MouseInputSwitch=1234
LButtonSwitch=1241
RButtonSwitch=1242
MButtonSwitch=1243
Change plugin_name to match filename of plugin dll without extension
Change MouseInputSwitch to whatever switch ID you want to use to enable/disable keypress checking
*/

return true;
}

void onFrame (RPG::Scene scene){
if (switches[confMouseInput]) { // IMPORTANT! This switch must be turned on in order to check for mouse clicks!
if (GetKeyState(VK_LBUTTON) & 0x8000) // Left mouse button
{
switches[confLButtonSwitch] = true;
}
else if (GetKeyState(VK_RBUTTON) & 0x8000) // Right mouse button
{
switches[confRButtonSwitch] = true;
}
else if (GetKeyState(VK_MBUTTON) & 0x8000) // Middle mouse button
{
switches[confMButtonSwitch] = true;
}
}
}

[RM2K3] [DYNRPG] Title window position plugin?

Here's a simple implementation of that:

#include <DynRPG/DynRPG.h>

std::map<std::string, std::string> configuration;

int confTitleX;
int confTitleY;

bool onStartup (char *pluginName) {
configuration = RPG::loadConfiguration(pluginName);
confTitleX = atoi(configuration["TitleX"].c_str());
confTitleY = atoi(configuration["TitleY"].c_str());
return true;
}

void onFrame (RPG::Scene scene){
if (scene == RPG::SCENE_TITLE
&& RPG::title->winStartLoadEnd) {
RPG::title->winStartLoadEnd->x = confTitleX;
RPG::title->winStartLoadEnd->y = confTitleY;
}
}

Requires the following in DynRPG.ini:
[plugin_name]
TitleX=##
TitleY=##

Let me know if you have any trouble compiling it.

Youre Impressions of New 2k3 [RM2K3]

author=unity
Correct me if I'm wrong, but was anyone on this forum ragging people for using the old version? Because, seeing as you kept bringing it up on the other topic, it seems to me like you've been totally fighting an enemy that doesn't exist. Heck, the RMN contest to celebrate the release of the official version allowed people to use the old version!


Pretty much this. I don't think we need another thread.

What are you jamming to?

Axiom Verge is a cool game with an even cooler soundtrack:



[RM2K][RM2K3] Small survey about patches - takes only a minute

Submitted! Hopefully I'm not too late or something.

Here's my input since I've been heavily involved in the world of DynRPG:

I have a big project that has been in the works for many years, and at this point, I'm waist deep in the world of plugins/patches. It would take an ungodly amount of work to revert back to vanilla 2k3, and I frankly would just stop 2k3 use all together at that point and start fresh in a new engine.

Making plugins has been hugely beneficial to me as a developer, because it's given me a reason to learn C++ and figure out every little nuance of 2k3 in order to add some really special features and modernize it. Reverse engineering has kind of been a necessary evil in this regard, because it's the only way you'll really understand the engine, and how to enhance it. Patches are incredibly helpful because you can do a lot of quick fixes that would be less feasible as plugins (and would cause more overhead/be more "hacky").

As for paid patches/plugins, that's a tough area to get into for sure, but I could see some kind of distribution system, where you check off the ones you want to buy/add, click a button, and it does the work for you. Problematic areas would be bug testing and feedback. The DynRPG route has been nice because you get all kinds of honest feedback. In the pay model, negative feedback would get magnified, because someone could pull out the "I paid for this, so you have to fix it" card. In general obviously you wouldn't want someone to pay for a broken plugin, and if they did, you would need a way for them to provide feedback and updates. I could see some of that leveraged through steam workshop, but I don't think they allow paying for that stuff yet. The Skyrim mod debate from a few weeks ago comes to mind.

With that said, I'd love to get paid a little money for my blood, sweat & tears. It would probably motivate me more to fix bugs/etc. Being a plugin developer would have bigger responsibilities for sure.

That's my 2 cents. Good luck, Cherry!

[DYNRPG] Access violation when using classes

Hmmm, first, let's talk high-level stuff. That error usually means you're trying to call an RPG object at the wrong time (where it doesn't yet exist), or you're trying to use one in an incorrect way. Examples: Calling an RPG::Battler member when you're not in battle, or if the battler does not exist. They're basically things that could have the correct syntax, so the compiler doesn't catch it.

As far as your code goes, assuming your class compiled fine, the crash is going to stem from onFrame(). You can probably trim down the stuff you have btw:

void onFrame( RPG::Scene scene )
{

if (scene == RPG::SCENE_BATTLE)
{
inBattle = true;
for (int i=0; i<NUM_MONSTERS; i++)
{
// if (0 != RPG::monsters[i]->databaseId) { } // crash
if (RPG::monsters[i])
{
monsterBattleDisplay[i].SetBattler( RPG::monsters[i] );
}
}
}
else if (inBattle) inBattle = false;
}

With your original code, here's the problem though:
if (0 != RPG::monsters[i]->databaseId)
If RPG::monsters does not exist, RPG::monsters->databaseId wouldn't exist either, so as soon as it loops to a non-existent monster, it's going to crash.

To check if a monster exists, use:
if (RPG::monsters[i])

RPG::monsters is just a pointer after all, so you can compare it as if it were a boolean value.

Also, get rid of "#define NOT_MAIN_MODULE" because you don't need that anymore.

That should at least get you started. You might be trying to add too much to your class at once though, so I'd recommend making sure a few of the values and images work for a monster or two before you go wild with it. Start small. :P