ScorchedGround

Blizzards most disappointed fan (More than ever)
Veteran
Joined
Apr 12, 2020
Messages
644
Reaction score
888
First Language
German
Primarily Uses
RMMV
Hello, looking for some help with a notetag from YEP_SkillCore:

For context; I want to create a skill that purges all "positive" states from an enemy.
This is the framework I have been working with:


JavaScript:
<After Eval>
let stateList = target._states;
for (i=0; i<stateList.length; i++) {
target.removeState(stateList[i]); i-=1;
}
</After Eval>

This worked in terms of removing EVERY state.





Obviously, I need a way to filter out any states that are not "positive".
My first approach was using metadata:

JavaScript:
<After Eval>
let stateList = target._states;
for (i=0; i<stateList.length; i++) {
if (stateList[i].meta.positive === 1) {continue;} else {target.removeState(stateList[i]); i-=1;}
}
</After Eval>

Note: All my positive states would be tagged with " <positive:1> "
But for some reason, it did not detect the metadata and just proceeded to remove every state
Note2: I also tried putting the 1 in the condition in quotation marks "1".





Then I tried using inherent data of states, in this case their "priority" parameter.

JavaScript:
<After Eval>
let stateList = target._states;
for (i=0; i<stateList.length; i++) {
if (stateList[i].priority === 8) {continue;} else {target.removeState(stateList[i]); i-=1;}
}
</After Eval>

Note: All my positive states would have their priority set to 8
But this did not work either.





So, is there something I did wrong or just missed?
Also, if there is a better way to approach a skill like this, please let me know.
 
Last edited:

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,833
Reaction score
2,170
First Language
EN
Primarily Uses
RMMZ
target._states returns a list of state IDs, not state objects. Also, if you're using plugins like YEP Auto Passive States then it won't include passives. I recommend target.states() instead! :kaohi:

Also, the default notetag values are stored as:
  • Strings for tags in the form <tag: value>;
  • true for tags in the form <tag>

Try one of these:
  1. Use <positive> for your State notetag, and this script call:
    JavaScript:
    target.states().forEach(function(state) {
      if (state.meta.positive) {
        target.removeState(state.id);
      }
    });

  2. Use <positive: 1> for your State notetag, and something like this for the script:
    JavaScript:
    target.states().forEach(function(state) {
      if (parseInt(state.meta.positive, 10) > 0) {
        target.removeState(state.id);
      }
    });
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
970
Reaction score
432
First Language
english
Primarily Uses
RMMV
state categories extension plugin. state notetag <Category: Buff> and then skill notetag <Remove State Category: Buff>

edit: @ScorchedGround that status under your profile name. 100% agree. blizzard failed for last time.
im done giving them extra chances.
 

ScorchedGround

Blizzards most disappointed fan (More than ever)
Veteran
Joined
Apr 12, 2020
Messages
644
Reaction score
888
First Language
German
Primarily Uses
RMMV
@caethyril
Ah you've saved me once again.
With your help I was able to make the skill work as intended.

And I was able to refresh my knowledge on metadata.

Also, the reason I used "._states" instead of "states()" was because i was initially browsing the console to find the right pointer to call. And it seemed like the "_states" attribute was the right one to go for.
When I tried putting that in the console, it returned me the states array of the object. I guess I was properly fluked then :kaophew:

@Tiamat-86
Good suggestion, however I don't own that plugin and I did not intend to spend 10 bucks for a single skill that I am using in a one-of battle.

Also, Blizzard screwed up so often lately and in such grave manner, that I decided to fully deinstall the launcher and all games and completely boycott them.

On top of that, they ruined Warcraft III along with my childhood memories of it.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
970
Reaction score
432
First Language
english
Primarily Uses
RMMV
ill still play the games that i payed for (once they get it working correctly) cus just a waste of money otherwise. but ill never pre-order or day1 buy any of their stuff ever again.
im not about to just stop playing starcraft just because of how much they f'ed up in the last few years.
its the same with square, not gonna stop playing FF6 and chrono trigger just because 7 out of their last 9 games were utter crap.

yanfly plugins are 1 of those thing where if going to buy any of them its better to just buy the full bundle.
honestly not actually a bad investment even if would only ever use half of them just because of the shear amount of options they add.
but ya $30 is still $30. (least not as bad as MZ plugin bundle at $100)
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,216
Reaction score
1,180
First Language
English
Primarily Uses
RMMV
On top of that, they ruined Warcraft III along with my childhood memories of it.
My God, Warcraft 3 is a childhood memory for you? Way to make me feel ancient...
 

Latest Threads

Latest Posts

Latest Profile Posts

i only have one decent song and i dont even think it fits for a video game
Update: I finished the combat arena! My goodness, it took a while! There were numerous little bugs to squash.
Maldra wrote on stramin's profile.
Hi regarding the 32 bit -> 64 bit
I am running on a 64 bit windows OS and tried doing this conversion. I converted all of the .exe files that I could find in the KADOKAWA\RPGMV folder using the 4gbpatch.exe file. However, after trying to access RPG Maker MV after this conversion, it simply will not load. Do you have any advice or any ideas?
****ing muscle memory: does anyone else habitually quit out of test play when they notice something they """HAVE""" to fix, in spite of the fact that you can now edit DURING test play?

...thousands of times...

...every day?
Does anyone recognize him? :kaocry:
pwkyiDa.jpg

And hi.

Forum statistics

Threads
115,928
Messages
1,094,140
Members
151,188
Latest member
yuangou
Top