[PLUG-IN] [RM2K3] ANIMATED MONSTERS PLUGIN

Posts

dragonheartman
Developer, Starless Umbra / Heroes of Umbra
2754
It's just, I come with the expectation that it's workable from the start, and I'd be able to to add these on a little at a time, and the fact that I really don't understand your code well enough to edit it myself is frustrating.
No -- I think on this matter it's important to appreciate that 9 years after the release of 2k3 we have someone incredible enough to provide this capability in the first place. I'm hugely grateful Cherry has provided this opportunity to developers as well as users of dying gamemaking software.

Now your best option, plain and simple, is to learn how to program. This doesn't mean go and ask which lines to modify in my code, it means actually learning how to write some simple programs and reading on the capabilities of the SDK. You are capable of much more if you learn the fundamentals and apply them to your own simple applications rather than fumbling around with my code.

You see -- as a developer it's not always straightforward what the code does. Even Cherry is asking me about how I implemented certain functionality, and he's the mastermind behind DynRPG. One thing you can control is your own ability to write your own plugins, even if they're small. You have to actually sit down and write your own code, not copy-paste lines here and there from plugins and hope it comes together. As you learn more programming, you will see the capabilities DynRPG has to offer, and as you explore those capabilities, you will improve yourself as a developer. This is a skill that I cannot teach, but something that takes years of experimentation for developers to get good at. This plugin is my own opportunity to practice my skills as a developer.

Oh thank you, that's the code I was looking for ^^
Another question... (the more I work with your plugin the more questions appear, sorry)
I haven't changed anything so far. When using skills, the enemy may run towards the hero and then the skill appears, while at some skills he stays there (which is the option I prefer) and performs his magic (without running towards the heroes). How do I check on which skill the enemy "runs" ?
Well, of course I could just wait some weeks, but I'm really curious since I've seen what is possible to do with the good old makers.

Same answer--you need to mess with the code and flag them as casting skills, then recompile. Better to wait until I properly implement something for you.

dhm, how do you let the monsters' attack "wait" during their movement? I don't see any RPG::screen->update()...

It's all done in the onFrame() callback. In the onDoBattlerAction() callback (or whatever it's called) I set a flag to approach a target as well as the x/y coordinates of the target, then using a frame timer I update accordingly.

I should really make the movements framerate-independent by multiplying the velocity by some timestep between frames, but honestly if your machine can't handle the battles at 60fps you'll be in more trouble trying to play my minigames...

Ooh I'd love to know this too. Ever since I switched from Power Mode to DynRPG, I've noticed my Steal system is all borked now because enemies interrupt in the middle of it and attack the party. Weirdly enough, this wasn't a problem in PM.

@Pepsi--this is a bug with DynRPG where the extended skill window display caused some issues with interrupting abilities. (Unfortunate because I really liked that feature.) I reverted back with a patch cherry provided (I'd have to dig it up) and the problem was resolved.
author=dragonheartman
dhm, how do you let the monsters' attack "wait" during their movement? I don't see any RPG::screen->update()...
It's all done in the onFrame() callback. In the onDoBattlerAction() callback (or whatever it's called) I set a flag to approach a target as well as the x/y coordinates of the target, then using a frame timer I update accordingly.
Yes, I see that, but I mean: How do you delay the actual attack until the enemy has reached the target?

author=dragonheartman
I should really make the movements framerate-independent by multiplying the velocity by some timestep between frames, but honestly if your machine can't handle the battles at 60fps you'll be in more trouble trying to play my minigames...
I think this wouldn't be an issue if you would use RPG::system->frameCounter instead of your own frameCounter, because even when frames are skipped (i.e. not drawn), they are still counted internally. See the notes here: http://rpg-maker.cherrytree.at/dynrpg/group__callbacks.html#gaeb3cc580d193d21358513fff5e1687c5
dragonheartman
Developer, Starless Umbra / Heroes of Umbra
2754
author=Cherry
author=dragonheartman
dhm, how do you let the monsters' attack "wait" during their movement? I don't see any RPG::screen->update()...
It's all done in the onFrame() callback. In the onDoBattlerAction() callback (or whatever it's called) I set a flag to approach a target as well as the x/y coordinates of the target, then using a frame timer I update accordingly.
Yes, I see that, but I mean: How do you delay the actual attack until the enemy has reached the target?

author=dragonheartman
I should really make the movements framerate-independent by multiplying the velocity by some timestep between frames, but honestly if your machine can't handle the battles at 60fps you'll be in more trouble trying to play my minigames...

I think this wouldn't be an issue if you would use RPG::system->frameCounter instead of your own frameCounter, because even when frames are skipped (i.e. not drawn), they are still counted internally. See the notes here: http://rpg-maker.cherrytree.at/dynrpg/group__callbacks.html#gaeb3cc580d193d21358513fff5e1687c5

I think I just make it so the enemies reach the players in time before the skill animation starts. For skills that have the casting animation prior, I added 10 or so blank frames to the battle animation.

I saw framecounter too -- I will have to implement it that way.
Why did actual waiting with RPG::screen->update() not work?
author=dragonheartman
It's just, I come with the expectation that it's workable from the start, and I'd be able to to add these on a little at a time, and the fact that I really don't understand your code well enough to edit it myself is frustrating.
No -- I think on this matter it's important to appreciate that 9 years after the release of 2k3 we have someone incredible enough to provide this capability in the first place. I'm hugely grateful Cherry has provided this opportunity to developers as well as users of dying gamemaking software.

Now your best option, plain and simple, is to learn how to program. This doesn't mean go and ask which lines to modify in my code, it means actually learning how to write some simple programs and reading on the capabilities of the SDK. You are capable of much more if you learn the fundamentals and apply them to your own simple applications rather than fumbling around with my code.


Cherry is awesome (and that dog is freaking cute). You aren't. Grow up. I spent, what was it two months, working on your problem, on a screwy spaghetti code I neither liked nor understood at all to get this problem (and yes, it is a problem, not a personal preference) to not happen.



This. This is unacceptable. A code should always have a general consideration for the people using it, you don't need to please them but it at least should be decently built. Suppose I built a house, and it fell on someone? Oh, but it's only code, right? A traffic light is only code, only it makes a tremendous difference in someone's life. This is not a serious problem for me, so I can afford not to care, but if anyone else were counting on your program to run, they'd get screwed.

So, yea, I set out to fix your problem. This is not important to me, this is important to everyone who uses your program. I only need it for five enemies, and I've already patched those over using earlier code you gave. Anyone else will need it for when they have enemies that don't need a certain frame or other, only to found out that wait, no, you can't omit them.

You know what? Screw it. I know how to program simple things. This is my speed, and I know as I look at and or tweak code I'll gradually improve, but somehow I've been stuck asking for your help to fix your problem because you won't take responsibility for it. You give me cryptic answers and partial code, and expect me to know where things go in a code you built. You want people to keep using your code, fix the problems. If not, well, I've got what I needed already, so I have no business worrying about your problems anymore.
author=dragonheartman
@Pepsi--this is a bug with DynRPG where the extended skill window display caused some issues with interrupting abilities. (Unfortunate because I really liked that feature.) I reverted back with a patch cherry provided (I'd have to dig it up) and the problem was resolved.


I would die for this patch if you or Cherry still has it. This may or may not be related but I noticed when there's a "enemy encounter" event command right after a message window, the battle command starts before the window fades away, and then you see it in the battle for a brief moment. Does it fix that too?
dragonheartman
Developer, Starless Umbra / Heroes of Umbra
2754
author=Cherry
Why did actual waiting with RPG::screen->update() not work?
It would hang while enemies were animating (meaning I could not move the cursor), and it seems onBattlerActionDone() would be called multiple times if a second callback was made while another was in-progress.

See my video below. Here if an enemy is in the middle of an action and another player attacks, there's a bit of chaos going on. If I were to speculate, I'd guess some sort of stack pointer is getting overwritten, because this is similar behavior I've seen within the native player when two common events are called from a battle event. (One never returns and attacks can get canceled.) All just speculation of course.

@dhm:

About not moving the cursor: You are right, I forgot that this will update the screen but not the selection windows (there is no RPG::Window object at the moment so you can't update them manually either).

About onBattlerActionDone: This callback has a "success" parameter. I assume it will be "false" the first times and "true" the last time.

So probably RPG::updateBattle() would work better than RPG::Screen->update(), but then again other characters can take action in the meantime... and you would have to make sure that the currently attacking monster's actionStatus is RPG::AS_WAITING all the time... And the whole thing is very experimental.

So yes - we better keep it as it is now - until I know more about this battle process and maybe can add some way to keep an action waiting.

Did you get my email about combo attacks, by the way?
Gee, can't believe this topic actually turned into this. @>@
Well, anyways, I can only say I'm looking forward for further releases and bugfixing. xD
(Though I'm afraid to be missile-locked for even saying something as cheerful and innocent as this >A>)
Aanyways. >A>
Looks nice, will give this a try some time soon. This will actually be really cool, since I plan on having some playable characters appear as enemies in my game, like in the combat tutorial.
dragonheartman
Developer, Starless Umbra / Heroes of Umbra
2754
author=Cherry
Did you get my email about combo attacks, by the way?

Yes -- I've wanted to do some sort of combo system for attacks done in succession with small damage bonuses. I think it would be a brilliant idea.

author=JosephSeraph
Gee, can't believe this topic actually turned into this. @>@
Well, anyways, I can only say I'm looking forward for further releases and bugfixing. xD
(Though I'm afraid to be missile-locked for even saying something as cheerful and innocent as this >A>)
Aanyways. >A>
I appreciate your feedback and suggestions because you initially reminded me to go back and revisit this plugin to see what it was capable of. So thank you!

author=Milennin
Looks nice, will give this a try some time soon. This will actually be really cool, since I plan on having some playable characters appear as enemies in my game, like in the combat tutorial.

Yeah, I tried to mimic the hero attack patterns (approaching and returning) closely so it feels similar.

I want this to work properly for back attacks. It seems RM doesn't simply flip the battlers, because you'll get the default poses for back attacks, and they don't animate either. Or I'm missing something and my pointer manipulation technique doesn't work because something else is changing it after onBattlerDrawn().
Or onDrawBattler and onBattlerDrawn maybe doesn't work at all, because I have to admin I never tested it for back attacks...
Cherry helped me today. I've got what I wanted, an automated system for this.

Animated_Monsters (Check File).

I included both the 6 frame and the 11 frame version. The later version is sort of iffy, due to the casting frames (I didn't have 120 or whatever, so I dunno), and might likely need some work if it is to function. But the old one works just fine.

He also had a config version, but I couldn't get it to work. See if you can tinker with it (remove doesFileExist, and change to this code before onStartup)


bool isBattlerAnimated(RPG::Battler *battler) {

if(!battler->isMonster()) return false; // Only monsters are handled, no actors

RPG::Monster *monster = (RPG::Monster *)battler;
// Cast the battler to a monster pointer, so that we can access databaseId



// Assemble the key name of the configuration entry, e.g. Monster123Animated

std::stringstream keyName;

keyName << "Monster" << monster->databaseId << "Animated";
// Animated part is not necessary, but if there are later other categories,
// this is generally good practice



// Check if Monster123Animated (for example) is set to 1 in the configuration and return result

return configuration[keyName].compare("1") == 0;

}

You'll need to input Monster12Animated=1
where 12 is whatever animated number. But really, that's for if you have it autorun, it doesn't make much of a difference except in terms of hardrive savings (might be some memory leak from the file check) for the ones that don't have a lot of monsters animated.

Anyway, thanks again Cherry. You were good at explaining how to do it.
No, the difference is that the non-config version opens and closes files 120 to 960 times a second, which I didn't think of, that's why I came up with the config version as a quick fix.
Yea, that way you explained it in PM was kinda graphic. Still, it's pretty good for now, as long as you have it for battles lasting less than a certain number turns.

If you want the config one to work, change keyname on the last line to keyname.str()
I'ts amazing this plugin! Thanks to Dragonheartman to do a great job with this! Congrats man!

I download the modification of this plugin of Bulmabriefs144, all correct yo are a machine too! but in a fight sometimes when enemy use a skill or attack, then go to outside of screen and i can't see in battle O_O
Hey, now it's not really my code at all... Cherry basically gave me the whole thing.

Yeah, this exit screen thing was mentioned as part of the health_bar thread.
dragonheartman
Developer, Starless Umbra / Heroes of Umbra
2754
author=Beleren
I'ts amazing this plugin! Thanks to Dragonheartman to do a great job with this! Congrats man!
Thanks, I need to do a few things to it but it's on hold at the moment. I have lots of good enhancements in mind.