Help with script (check state, check skill and force action)

RenatoCrovella

Villager
Member
Joined
Nov 3, 2018
Messages
12
Reaction score
2
First Language
Português
Primarily Uses
RMMV
Hello guys! Newbie here LOL

I use the RPG Maker MV and I need a help with a skill mechanics that I'm trying to create for my game. It's like "follow-up skills," but scripts like this have not yet got what I need ...

Now that I understand a bit of programming logic (very basic), I think I can make it clear what I need the script to do. But I can not find the right commands on the internet to do this.


How do these skills work?

- First a user (who can be an ally or an enemy!) Performs an action that causes a state in the target (again, it can be an ally or an enemy). I will call this state of “vulnerability” to aid in the explanation.

- As you take action, a check will take place to see which characters on the user's team can instantly take an action on the target with that state. I will call this second action of "Pursuit".

For example, if an Actor used the first ability and caused this state (Vulnerability) to an Enemy, then the check is to see if any other Actor has the "Pursuit" ability to perform the next action instantly.

OR, if the ability was used by an Enemy and caused Vulnerability in an Actor, then the check is to see if any other Enemy has the "Pursuit" ability to perform the next action instantly.

- If there is someone on the team who has this ability, he is forced to use it immediately on the target with "Vulnerability".

For example, following the examples above: if an actor used a skill that caused "Vulnerability" on an enemy and there is some other actor (including the user!) Who has the "Pursuit" ability, this action is taken immediately.

But if an enemy uses the ability that causes "Vulnerability" in an Actor, and if there is any other enemy (including the user!) That has the "Pursuit" ability, this action is taken immediately.

---------------------------------------------------------------------------------------------------------------------------------------------

This is the basic structure of this "system" (script) that I am trying to create. I have already been able to create something similar with common events, but by this method I can only check if specific actors have the "Pursuit" ability (and since my game has MANY characters, it is not possible to create an individual check for each actor - besides not being able to put this ability to be executed by Enemies).

If I can figure out the commands to create a script that does what is above, I'll be super happy already !!! LOL

But if it’s possible, I would like to get some other questions and make the script meet these possibilities too:

1- A skill that deals damage in a group has a chance of causing "Vulnerability" on targets.

> How to make a character (enemy or actor) only perform a "Pursuit" on only one target if more than one enemy character (actor or enemy) acquires the "Vulnerability" state (so that the same character does not perform the same action on different targets)? (However, if there are other characters with the "Pursuit" ability, each of them can use their ability on one of the remaining targets)

2- With the end of both actions (ability that causes "Vulnerability" and "Pursuit" ability) the status "Vulnerability is removed.

> I know that if "Pursuit" ability is used, just add "Remove Vulnerability" to the effects of the ability, but what if the ability is not used? How do I get the target (s) out of state?

3- Change of sprite / position.

> I would like some states of vulnerability to cause a physical alteration in the character. For example: when hit by "Vulnerability" the character would fall to the ground (it would call this state "fall" and use the sprites of the "dead" character) or perform a jump on the screen (called this "Flight" state). How to do this?

> If in the above example the character is hit by "Flight", I would like the "Pursuit" ability to be used when he is in the air. Can I do that?

4- Combo even bigger.

> I would like to create some "Pursuit" abilities that would not only pursue the target, but would also put it into a new "Vulnerability" state, triggering another "Pursuit" ability.

For example:

>> Character 1 uses a skill that causes "Flight."

>> Character 2 is forced to use a skill that pursues "Flight" and causes "Fall" (in that case, Flight is removed and Fall is added to target).

>> Character 3 is forced to use a skill that pursues "Fall" (removing "Fall")



It would be great to be able to create a script with all these functions, even to make it available to others who want to use this system, but I really can not find the necessary commands.

Another way that may have been my needs is by Yanfly's "Action Sequences", but in that case I also need some commands that I do not know.

NOTE: I have all the Yanfly plugins installed.

Link to Yanfly plugins: http://yanfly.moe/yep/

Link to the Action Sequences plugins:

http://yanfly.moe/2015/10/11/yep-4-action-sequence-pack-1/

http://yanfly.moe/2015/10/12/yep-5-action-sequence-pack-2/

http://yanfly.moe/2015/10/12/yep-6-action-sequence-pack-3/



Thanks, guys! And sorry my bad english...
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
As you seem to want help to write this script, I will move this to Learning Javascript. If, however, you in fact want someone else to write it, then please Report this post and ask for it to be moved again, this time to JS Plugin Requests.

[mod]Moving this to Learning Javascript.[/mod]
 

RenatoCrovella

Villager
Member
Joined
Nov 3, 2018
Messages
12
Reaction score
2
First Language
Português
Primarily Uses
RMMV
As you seem to want help to write this script, I will move this to Learning Javascript. If, however, you in fact want someone else to write it, then please Report this post and ask for it to be moved again, this time to JS Plugin Requests.

[mod]Moving this to Learning Javascript.[/mod]
Sorry for posting in the wrong place... I am trying to learn how to write it, indeed.

Thank you for moving it to the right one
 

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
640
Reaction score
353
First Language
English
Primarily Uses
RMMV
I made a vulnerability skill that stores the current battler in a variable by using this in the damage formula:
Code:
v[20] = this.subject()
and calls a common event when it's used. The common event calls the following code:

Code:
var subject = $gameVariables.value(20);
var target = subject.opponentsUnit().members()[subject._lastTargetIndex];
subject.friendsUnit().aliveMembers().forEach(function(member) {
    var action = new Game_Action(member);
    action.setSkill(19); // Pursuit skill ID
    member.useItem(action.item());
    action.apply(target);
    BattleManager._logWindow.startAction(member, action, [target]);
    BattleManager._logWindow.displayActionResults(member, target);
    BattleManager._logWindow.endAction(member);
});
What it will do is get the battler that just acted, then get the target they just used vulnerability on. Then, for every living friendly member, it uses an action with the Pursuit skill on the same target.

A couple things that are missing, however:

- You'll need to add in conditionals to figure out who has the Pursuit skill or otherwise determine who's going to use it. You could try referencing "member.skills()" to see if the member knows the Pursuit skill, for example, but you'll need an if statement in the forEach block.
- There's an issue where this code only displays the damage popup for the last battler that uses the Pursuit skill the first time a Pursuit skill is animated, then correctly animates and fills in the battle log on every subsequent skill, but doesn't perform the right damage popup. I've spent a couple hours trying to figure out what the hell is going on and I can't for the life of me understand the base engine's processing of damage popups. I don't understand how I can get the log window to correctly display target.result().hpDamage, appropriately waiting for animations and everything, but right when the damage popup should animate at the exact same time, it just doesn't.

If you're using YEP_BattleEngineCore, it's going to get a lot more complicated, however, because Yanfly overwrote basically the entirety of how actions are processed.

If I manage to figure out how to fix the damage popup issue, I'll let you know.


Actually, I've continued testing and this whole thing is broken. Don't use it. I can get everything but damage popup to work, or everything but updating the battle log with action results to work, but I can't get everything to work. It's basically stuck in an impossible situation where you have to apply the action to get the results to work, but applying the action causes the damage popup to break, and vice versa.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top