New account registration is temporarily disabled.

[RMMZ] HOW TO MAKE A COMMON EVENT THAT CHECKS FOR HIT?

Posts

Pages: 1
Hello everyone,

is it possible for a skill that calls a common event that will increase a variable if the skill hits its target? (or if it is easier, that hits a specific actor)

Currently I am only able to call a common event which will increase the variable no matter what.

Any help is appreciated :)
Marrend
Guardian of the Description Thread
21806
The sub-thought in my head is to call the Common Event as part of the damage calculation. I'm not 100% sure if this would be the MZ implementation, but, maybe something like...

$gameTemp.reserveCommonEvent(id); a.atk*4 - b.def *2

...this? Replacing "id" with the Common Event ID you're looking to use, of course. I'm also assuming the typical damage formula, but, of course, that could be replaced too.

*Edit: I'm also largely assuming that calling the Common Event through skill Effects will call it regardless of hitting or missing.
Wow that worked! Thank you so much Marrend! I really should learn about all those script calls and what is possible with them. Is there a good tutorial about it somewhere? Beregon already showed me to a list of all available commands but I am just too overwhelmed to look into it, without any guidance.

Edit: And yes if you call it through the skill effect it always call it, thus my predicament.
Marrend
Guardian of the Description Thread
21806
Well, it kinda helped me, personally, that the script-call to call a Common Event in Ace...

#Snippet taken from [url]http://rpgmaker.net/scripts/464/[/url]
$game_temp.reserve_common_event(ID)

...was similar. Though, I also admit to doing a Control+F for "common event" inside "rmmz_objects.js" and going from there. Like, I may not have access to the MZ engine (my trial has loooooong since expired), but, I still have Heaven's Gate MZ that I can use to look this kind of stuff up and maybe earn another achivement while I'm at it.
Pages: 1