RMMV YEP Buffs & States Core Mini & Frog States Assistance

Status
Not open for further replies.

Guy_Fightmaster

Veteran
Veteran
Joined
Aug 14, 2019
Messages
118
Reaction score
16
First Language
English
Primarily Uses
RMMV
Good evening. I am seeking assistance utilizing YEP Buffs & States (B&S) Core to create FROG and MINI states similar to the FF series. State screenshots are attached.

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

-Starting with FROG state, my desired end state would replace both actors and enemies affected with the state as mentioned earlier with the same "Frog" SV_Actor, but not sure the best way to go about it. I currently know I could make an enemy with a <Sideview Battler: Frog> tag to replace an affected enemy, but that will not work as I would like the enemy to maintain their same stats except those stats altered by the state, as seen in the screenshot. Also, I know I could make a common event to modify the actor's appearances. Still, I feel the desired effect could be achieved if I had lunatic scripting knowledge using YEP B&S Core, but I don't, so community help is appreciated as my search online has not produced any fruit.

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

-Next, moving on to the MINI state. After doing research, I found out how to utilize the YEP B&S Core plugin to shrink my actors affected by MINI state, and it works like a charm:

<Custom Apply Effect>

user.battler().scale.x = 0.3;

user.battler().scale.y = 0.3;

</Custom Apply Effect>

<Custom Remove Effect>

user.battler().scale.x = 1;

user.battler().scale.y = 1;

</Custom Remove Effect>

I want to apply the same effect to enemy sprites too. Assistance is greatly appreciated.

Happy Friday!
 

Attachments

  • Frog State.jpg
    Frog State.jpg
    79.3 KB · Views: 9
  • Mini State.jpg
    Mini State.jpg
    82.9 KB · Views: 9
  • Mini State 2.jpg
    Mini State 2.jpg
    8.4 KB · Views: 9

eomereolsson

Veteran
Veteran
Joined
Sep 29, 2021
Messages
182
Reaction score
153
First Language
German
Primarily Uses
RMMV
Regarding your frog state: I don't know from which plugin the notetag <Sideview Battler: Frog> is (it doesn't seem to be from Yanfly's Buffs & States Core). But Yanfly has Tips & Tricks about both enemy and actor transformations. Maybe these help you?
Especially the Actor transformation one seems to concern itself with only altering appearance and stats according to the state, but leaving the baseline stats the same (which seems to be what you are after).

Regarding your mini state: from a cursory look I don't see any reason why this shouldn't work on enemy sprites. Have you actually tested it? Are there any messages on the console (F8) when you do?
 

Guy_Fightmaster

Veteran
Veteran
Joined
Aug 14, 2019
Messages
118
Reaction score
16
First Language
English
Primarily Uses
RMMV
Regarding your frog state: I don't know from which plugin the notetag <Sideview Battler: Frog> is (it doesn't seem to be from Yanfly's Buffs & States Core). But Yanfly has Tips & Tricks about both enemy and actor transformations. Maybe these help you?
Especially the Actor transformation one seems to concern itself with only altering appearance and stats according to the state, but leaving the baseline stats the same (which seems to be what you are after).

Regarding your mini state: from a cursory look I don't see any reason why this shouldn't work on enemy sprites. Have you actually tested it? Are there any messages on the console (F8) when you do?
Frog:
I looked at the Yanfly transformation options; however, for enemy transformation, it would require me to replace one enemy with another (frog enemy) and would not meet the "maintaining stats of affected enemy" desired effect unless I misunderstood it for some reason. For me, common eventing would be easier for the actor transformations than using the Yanfly option.

Mini:
When my Mini skill is used on an enemy, it does not reduce their size. It only works on actors. No messages are displayed via F8/console.

My knowledge of Java is minimal at best, but I believe the script call on Yanfly's site is different for actor transformations. When viewing the enemy transformation script on the site, I noticed the word "enemy" was used instead of the "battler" for enemy transformations.
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,583
Reaction score
2,928
First Language
English
Primarily Uses
RMMV
Frog:
I looked at the Yanfly transformation options; however, for enemy transformation, it would require me to replace one enemy with another (frog enemy) and would not meet the "maintaining stats of affected enemy" desired effect
Well, it wouldn't be that hard to store the original enemy's parameters into variables, then set the parameters of the new enemy to it. If no one else helps you out, I'll try to remember tomorrow when I'm less tired and I think I'll actually type correct code.

My knowledge of Java is minimal at best
Note that MV is programmed in JavaScript, not Java. Despite the similarity in names, they're two different languages.
When viewing the enemy transformation script on the site, I noticed the word "enemy" was used instead of the "battler" for enemy transformations.
You're correct, enemies don't have a battler member. Someone else might prove me wrong (because I'm not willing to poke at it for more than a few minutes :stickytongue: ) but I don't think you can do this natively. I think you'll need to have a plugin that adds functions to change and refresh the enemy's sprite size, then call those functions.

There's Yanfly's Animated Sideview Enemies, and there's another Animated Enemies plugin by someone on the forum (I don't recall who, but it'll come up with a Google).
 

Guy_Fightmaster

Veteran
Veteran
Joined
Aug 14, 2019
Messages
118
Reaction score
16
First Language
English
Primarily Uses
RMMV
Turan, I was unaware of the difference between Java and JavaScript. Thank you for pointing that out. Assistance with the scripting would be appreciated.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,583
Reaction score
2,928
First Language
English
Primarily Uses
RMMV
You'll need to decide on a plugin first, before someone can help you with accessing the script calls (if they're not in the instructions).
 

Guy_Fightmaster

Veteran
Veteran
Joined
Aug 14, 2019
Messages
118
Reaction score
16
First Language
English
Primarily Uses
RMMV
Ah, ok.
Frog:
Yanfly Transformation Option plugin utilizing variables as you suggested.

Mini:
Yanfly's Animated Sideview Enemies plugin.

Please let me know if anything else is required, and if you think these plugins are the best routes.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,583
Reaction score
2,928
First Language
English
Primarily Uses
RMMV
Frog:
Yanfly Transformation Option plugin utilizing variables as you suggested.
Code:
<Custom Apply Effect>
// Check if the user is an enemy.
if (user.isEnemy()) {
  // Archive the previous enemy ID.
  user._prevEnemyId = user._enemyId;

  // Store the enemy's parameters
  user._origParams=user.enemy().params;

  // Set the target enemy ID you want the enemy to change into.
  var transformEnemyId = 2;
  // Transform the user.
  user.transform(transformEnemyId);

  // Restore original parameters
  user._paramPlus.forEach((param, index) => param=user.enemy().params[index]-user._origParams[index]);
}
</Custom Apply Effect>
I think that should work, but I haven't tested it.
Mini:
Yanfly's Animated Sideview Enemies plugin.
Code:
<Custom Apply Effect>
if (user.isActor())
{
    user.battler().scale.x = 0.3;
    user.battler().scale.y = 0.3;
}
else
{
    user.scale.x=0.3;
    user.scale.y=0.3;
}
</Custom Apply Effect>

<Custom Remove Effect>
if (user.isActor())
{
    user.battler().scale.x = 1;
    user.battler().scale.y = 1;
}
else
{
    user.scale.x=1;
    user.scale.y=1;
}
</Custom Remove Effect>
Again, have not tested, it might require some kind of refresh call, but give it a shot.
 

Guy_Fightmaster

Veteran
Veteran
Joined
Aug 14, 2019
Messages
118
Reaction score
16
First Language
English
Primarily Uses
RMMV
Status update:


Frog State:
FROG state successfully transforms the enemy's appearance into the FROG ENEMY (ID 247), but it doesn't carry over the original enemy's parameters to the FROG ENEMY. FROG ENEMY screen-shot attached. Also, it doesn't revert to the enemy's original appearance or parameters when the state is removed (code I used below):

<Category: Ailment>

<toggleable state>

<Custom Apply Effect>
if (user.isEnemy()) {
user._prevEnemyId = user._enemyId;
user._origParams=user.enemy().params;
var transformEnemyId = 247;
user.transform(transformEnemyId);
user._paramPlus.forEach((param, index) => param=user.enemy().params[index]-user._origParams[index]);
}
</Custom Apply Effect>


Mini State:
As before, the MINI state successfully shrinks an actor and reverts their appearance to the original state when applied/removed. It doesn't alter enemy appearance. Code used below:

<Category: Ailment>

<toggleable state>

<Custom Apply Effect>
if (user.isActor())
{
user.battler().scale.x = 0.3;
user.battler().scale.y = 0.3;
}
else
{
user.scale.x=0.3;
user.scale.y=0.3;
}
</Custom Apply Effect>

<Custom Remove Effect>
if (user.isActor())
{
user.battler().scale.x = 1;
user.battler().scale.y = 1;
}
else
{
user.scale.x=1;
user.scale.y=1;
}
</Custom Remove Effect>
 

Attachments

  • Frog Enemy.jpg
    Frog Enemy.jpg
    78.7 KB · Views: 3

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,583
Reaction score
2,928
First Language
English
Primarily Uses
RMMV
FROG state successfully transforms the enemy's appearance into the FROG ENEMY (ID 247), but it doesn't carry over the original enemy's parameters to the FROG ENEMY.
I think I know why that didn't work. When the enemies get spawned as battlers, their parameters get taken out of the params array into the individual stats (that's why you reference, for example, b.def in a damage formula).

So take out the line after "Restore original parameters" and replace it with this:
Code:
  user.mhp=user._origParams[0];
  user.mmp=user._origParams[1];
  user.atk=user._origParams[2];
  user.def=user._origParams[3];
  user.mat=user._origParams[4];
  user.mdf=user._origParams[5];
  user.agi=user._origParams[6];
  user.luk=user._origParams[7];
Also, it doesn't revert to the enemy's original appearance or parameters when the state is removed
Well...if that's your entire note area, then certainly it doesn't revert back, because you don't have the Custom Remove Effect from the transform Tip & Trick. I didn't copy/retype it in my post above because I wasn't changing anything in it.
Mini State:
As before, the MINI state successfully shrinks an actor and reverts their appearance to the original state when applied/removed. It doesn't alter enemy appearance.
Just to make sure, the Animated Sideview Enemies plugin is installed correctly, and works otherwise? For example, set the plugin parameter to activate breathing on all of the enemies and make sure that works.
Otherwise, I think I'm tapped out there. I don't even use that plugin, so I've done about as much as I care to in following the code back and forth inside :stickytongue:

Hopefully you'll get a response from someone who's a little more familiar with it.
 

Guy_Fightmaster

Veteran
Veteran
Joined
Aug 14, 2019
Messages
118
Reaction score
16
First Language
English
Primarily Uses
RMMV
I think I know why that didn't work. When the enemies get spawned as battlers, their parameters get taken out of the params array into the individual stats (that's why you reference, for example, b.def in a damage formula).

So take out the line after "Restore original parameters" and replace it with this:
Code:
  user.mhp=user._origParams[0];
  user.mmp=user._origParams[1];
  user.atk=user._origParams[2];
  user.def=user._origParams[3];
  user.mat=user._origParams[4];
  user.mdf=user._origParams[5];
  user.agi=user._origParams[6];
  user.luk=user._origParams[7];

Well...if that's your entire note area, then certainly it doesn't revert back, because you don't have the Custom Remove Effect from the transform Tip & Trick. I didn't copy/retype it in my post above because I wasn't changing anything in it.

Just to make sure, the Animated Sideview Enemies plugin is installed correctly, and works otherwise? For example, set the plugin parameter to activate breathing on all of the enemies and make sure that works.
Otherwise, I think I'm tapped out there. I don't even use that plugin, so I've done about as much as I care to in following the code back and forth inside :stickytongue:

Hopefully you'll get a response from someone who's a little more familiar with it.
I'm very close to a resolution on the FROG state. I added the <Custom Remove Effect> like you suggested, and it worked to revert the appearance. Also, for clarification, please see FROG state code changes below. Did I put your recommended changes in the correct place? It does not currently work where it is at, and I tried moving it around a few times and didn't have any luck.

FROG State updated:

<Category: Ailment>

<toggleable state>

<Custom Apply Effect>
if (user.isEnemy()) {
user._prevEnemyId = user._enemyId;
user._origParams=user.enemy().params;
var transformEnemyId = 247;
user.transform(transformEnemyId);
user.mhp=user._origParams[0];
user.mmp=user._origParams[1];
user.atk=user._origParams[2];
user.def=user._origParams[3];
user.mat=user._origParams[4];
user.mdf=user._origParams[5];
user.agi=user._origParams[6];
user.luk=user._origParams[7];
}
</Custom Apply Effect>

<Custom Remove Effect>
if (user.isEnemy()) {
var transformEnemyId = user._prevEnemyId;
user.transform(transformEnemyId);
user._prevEnemyId = undefined;
}
</Custom Remove Effect>

MINI state Update:

Breathing works correctly for YEP Animated Side View. I will await a community response on the MINI state issue.

Regardless, I appreciate all your help JavaScript Jedi Master Turan. :D
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,583
Reaction score
2,928
First Language
English
Primarily Uses
RMMV
When you say "it doesn't work," what happens instead? The parameters are of the enemy they transformed into? How are you verifying that?

After the enemy transforms, press F8, go to the Console tab, and type in:
Code:
$gameTroop.members()[X].atk

$gameTroop.members()[X]._origParams[2]

and see what it returns each time. X will have to be replaced by the troop index of the enemy that transformed (this will be most easily tested by having one enemy in the troop and replacing X with 0).
 

Guy_Fightmaster

Veteran
Veteran
Joined
Aug 14, 2019
Messages
118
Reaction score
16
First Language
English
Primarily Uses
RMMV
When you say "it doesn't work," what happens instead? The parameters are of the enemy they transformed into? How are you verifying that?

After the enemy transforms, press F8, go to the Console tab, and type in:
Code:
$gameTroop.members()[X].atk

$gameTroop.members()[X]._origParams[2]

and see what it returns each time. X will have to be replaced by the troop index of the enemy that transformed (this will be most easily tested by having one enemy in the troop and replacing X with 0).
I attached the screenshot from the console using the commands you suggested.

Regarding the other issue, I meant to say the stats are not the original enemy's. They are the stats from the frog enemy (ID 247). I will use HP as an example. The enemy I tested the skill on is a test mob with 999,999+ HP.

When I turn it into a frog, it assumes the HP of the frog enemy instead of the test enemy. If I revert the enemy by casting the spell again, his appearance returns to normal, but he still has lowered stats from the frog enemy.

I'm trying to prevent the player from just casting frog on an enemy to one-shot it, but more importantly, the enemy should retain its original stats if the state's removed.
 

Attachments

  • Console.jpg
    Console.jpg
    49.8 KB · Views: 1

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,583
Reaction score
2,928
First Language
English
Primarily Uses
RMMV
You did not follow my instructions regarding replacing the letter X, which is why you're getting errors that there's no such thing as X.

I also don't think that what you're describing can be quite accurate. If there's an error in my code and the parameters are being replaced when the enemy transforms, it would be replaced both times - to the frog's stats, then back to the original stats when it transforms back.

There's...I hesitate to say "no way," but I think there's no way it would assume new stats when transforming one direction, then keep stats transforming the other direction. It just doesn't make sense.

Note that there's nothing in there to keep the enemy's current HP between transformed forms. It can be added, but it isn't there because you only asked for the enemy parameters (which is why I was asking how you were testing).

Add a line before the transform function that says
Code:
user._origHp=user.hp;

then after the transformation
Code:
user.hp=user._origHp;

And you'll put that in both the apply and remove effects.
 
Last edited:

Guy_Fightmaster

Veteran
Veteran
Joined
Aug 14, 2019
Messages
118
Reaction score
16
First Language
English
Primarily Uses
RMMV
You did not follow my instructions regarding replacing the letter X, which is why you're getting errors that there's no such thing as X.

I also don't think that what you're describing can be quite accurate. If there's an error in my code and the parameters are being replaced when the enemy transforms, it would be replaced both times - to the frog's stats, then back to the original stats when it transforms back.

There's...I hesitate to say "no way," but I think there's no way it would assume new stats when transforming one direction, then keep stats transforming the other direction. It just doesn't make sense.

Note that there's nothing in there to keep the enemy's current HP between transformed forms. It can be added, but it isn't there because you only asked for the enemy parameters (which is why I was asking how you were testing).

Add a line before the transform function that says
Code:
user._origHp=user.hp;

then after the transformation
Code:
user.hp=user._origHp;

And you'll put that in both the apply and remove effects.
Ah, I see where I failed to follow instructions. Good catch.

There is a miscommunication on my end. I'm not great at explaining things, which is one of my shortcomings so please bear with me. Refer to the attached screenshots.

"Enemy A" is the test enemy, and "Enemy B" is the frog enemy replacing the enemy affected by the "Frog" state. When "Enemy A" becomes "Enemy B," I would like "Enemy A" parameters/stats to carry over to transforming into "Enemy B" with one exception: when "Enemy A" becomes a "frog," the only parameter that should change is "attack" due to the "Frog" state "Trait: Parameter Attack * 25%" pictured below, it will take a penalty. So, in theory, the enemy's new "attack" parameter becomes "5," and all other parameters should stay the same, including "MHP".

As recommended, I tested the new script (assuming I added your changes correctly) utilizing the console commands you provided, replacing "ATK" w/"MHP." As you can see, "Enemy A's" "MHPs" changed when applying said transformation instead of staying the same, which is not the desired effect. They switched to "2k-something" and not "1" due to the "YEP_EnemyLevels" plugin. Again, I have no idea what I'm doing when it comes to JS, but I did my best when writing my "Frog" state script below:

New code below for review:

<Custom Apply Effect>
if (user.isEnemy()) {
user._prevEnemyId = user._enemyId;
user._origParams=user.enemy().params;
user._origHp=user.hp;
var transformEnemyId = 247;
user.transform(transformEnemyId);
user.mhp=user._origParams[0];
user.mmp=user._origParams[1];
user.atk=user._origParams[2];
user.def=user._origParams[3];
user.mat=user._origParams[4];
user.mdf=user._origParams[5];
user.agi=user._origParams[6];
user.luk=user._origParams[7];
user.hp=user._origHp;
}
</Custom Apply Effect>

<Custom Remove Effect>
if (user.isEnemy()) {
user._origHp=user.hp;
var transformEnemyId = user._prevEnemyId;
user.transform(transformEnemyId);
user._prevEnemyId = undefined;
user.hp=user._origHp;
}
</Custom Remove Effect>

Please let me know where I screwed up in writing the changes in the new script above, as I am not confident in my ability to add your recommended changes the way you would've. Thank you for being so patient.
 

Attachments

  • Console.jpg
    Console.jpg
    8.3 KB · Views: 4
  • Enemy A.jpg
    Enemy A.jpg
    62.1 KB · Views: 3
  • Enemy B.jpg
    Enemy B.jpg
    70.2 KB · Views: 3
  • Frog State.jpg
    Frog State.jpg
    85 KB · Views: 4
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,583
Reaction score
2,928
First Language
English
Primarily Uses
RMMV
My original code was correct, we just needed to refresh the battler after doing it. So:
Code:
<Custom Apply Effect>
// Check if the user is an enemy.
if (user.isEnemy()) {
  // Archive the previous enemy ID.
  user._prevEnemyId = user._enemyId;

  // Store the enemy's parameters
  user._origParams=user.enemy().params;

  // Store damage
  user._origHp=user.hp;

  // Set the target enemy ID you want the enemy to change into.
  var transformEnemyId = 2;
  // Transform the user.
  user.transform(transformEnemyId);

  // Restore original parameters
  user._paramPlus.forEach((param, index) => param=user.enemy().params[index]-user._origParams[index]);

  // Restore damage
  user.hp=user._origHp;

  // Apply changes
  user.refresh();
}
</Custom Apply Effect>

Then keep your Remove Effect the way it is, and just add the user.refresh(); at the end.
 

Guy_Fightmaster

Veteran
Veteran
Joined
Aug 14, 2019
Messages
118
Reaction score
16
First Language
English
Primarily Uses
RMMV
My original code was correct, we just needed to refresh the battler after doing it. So:
Code:
<Custom Apply Effect>
// Check if the user is an enemy.
if (user.isEnemy()) {
  // Archive the previous enemy ID.
  user._prevEnemyId = user._enemyId;

  // Store the enemy's parameters
  user._origParams=user.enemy().params;

  // Store damage
  user._origHp=user.hp;

  // Set the target enemy ID you want the enemy to change into.
  var transformEnemyId = 2;
  // Transform the user.
  user.transform(transformEnemyId);

  // Restore original parameters
  user._paramPlus.forEach((param, index) => param=user.enemy().params[index]-user._origParams[index]);

  // Restore damage
  user.hp=user._origHp;

  // Apply changes
  user.refresh();
}
</Custom Apply Effect>

Then keep your Remove Effect the way it is, and just add the user.refresh(); at the end.
New console screenshot attached. The top two console lines were from after the Frog state was applied to the Test enemy, and notice the original MHP didn't successfully carry over after the transformation. However, when the Frog state was removed as shown in the last two console lines, reverting the enemy to normal the MHP was restored.

Code with latest recommended edits below:

<Custom Apply Effect>

if (user.isEnemy()) {

user._prevEnemyId = user._enemyId;

user._origParams=user.enemy().params;

user._origHp=user.hp;

var transformEnemyId = 247;

user.transform(transformEnemyId);

user._paramPlus.forEach((param, index) => param=user.enemy().params[index]-user._origParams[index]);

user.hp=user._origHp;

user.refresh();

}

</Custom Apply Effect>



<Custom Remove Effect>

if (user.isEnemy()) {

user._origHp=user.hp;

var transformEnemyId = user._prevEnemyId;

user.transform(transformEnemyId);

user._prevEnemyId = undefined;

user.hp=user._origHp;

user.refresh();

}

</Custom Remove Effect>
 

Attachments

  • Console Screenshot.jpg
    Console Screenshot.jpg
    15.4 KB · Views: 1

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,583
Reaction score
2,928
First Language
English
Primarily Uses
RMMV
I guess my forEach function didn't do what I wanted (I just do not freaking get that thing...sigh...)

Replace that line with:
Code:
    for (var i=0; i<user._origParams.length; i++)
        user._paramPlus[i]=user._origParams[i]-user.param(i);
 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Why the heck do I keep comparing my games to ones made by huge companies? I'd love them to have that level of polish but I'm simply not good enough.
Hell of a day at the London Games Market! :D

1656892272017.png

Check out my haul!

Forum statistics

Threads
123,297
Messages
1,155,602
Members
161,713
Latest member
randymacalaster
Top