Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Luna Engine MV

A script that modifies RPG Maker MV UI easily · By Archeia

Question with Yanflys, Buffs & States Core Custom counters.

A topic by Jeremy.90 created Sep 06, 2019 Views: 995 Replies: 16
Viewing posts 1 to 4

Hello all,

So I was wondering, does anyone know of a way to add  Yanflys Buffs & States Core, into the ymls so that the custom counters appear? 

The image on the left,  is using code from the demo project to display states, but doesn't pick up the custom counters, the other image is when you have an ally targeted, which it does display them. I figured since it seemly seems, able to display through the right image, there must be a way to make it be displayed over the normal state display.


Developer

The sample project is now updated :) https://archeia.itch.io/luna-engine-mv/devlog/99255/luna-engine-version-110-is-u...

(1 edit)

From the looks of it, this only displays the turn counter.  

What I was originally asking about was, the counters used as like variables that comes  from http://www.yanfly.moe/wiki/Buffs_%26_States_Core_(YEP).

Using codes like: 

"// Defaults user's combo stacks to 0.

user._comboStacks = user._comboStacks || 0;

// Get the current number of stacks. Min 0, Max 10.

var stacks = user._comboStacks.clamp(0, 10);

// Set the combo counter for the state.

user.setStateCounter(stateId, 'x' + stacks);"

It would create like a custom variable, in a state which is very useful and would display the number on the state like in my original images, I'm not sure how hard, or if it is possible, to make compatible with Luna, but if you were able to or show how, it would be very appreciated, I've spent hours trying, but don't really know how. 

Also seems to not like http://www.yanfly.moe/wiki/Auto_Passive_States_(YEP).

Developer

There is nothing with Passive Auto States and it's something we used for the Queens Demo, Dragon Hunting. However, we provide a generalized function, not something niche like state stacking. 

Have you tried this in the vanilla sideview project and see if it displays on the original state display? Because if it's showing up during targeting, you could reuse that code instead on normal state display?

Developer

Okay, we looked into it more and it's not really related to Luna, but here's a compatibility patch:

1. Use this on your config: 

battler.getStateCounter(stateId)

2. Use this snippet. Add it in either LunaSnippets or a new JS file.

Game_BattlerBase.prototype.stateCounters = function() {
    var values = []
    for (var stateId in this._stateCounter) {
        values.push(this._stateCounter[stateId])
    }
    return values
}

Thank you for looking into this more, also I was trying a bunch of things, but how exactly do I add that into the config?

Like should it be under the BattlerStateCounter: ?

Then, config: 

                   battler.getStateCounter(stateId)

Sorry still trying to figure out how to use this.

Developer

Hi Jeremy, I accidentally gave you wrong instructions and I apologize!

You need a second text element in a grid like the turn counter. So in short, Flat out copy and paste the turn counter and replace the item list with the config!

Are you able to get like a screen shot of the code or something? 

I feel like I've tried doing this and many other ways and still either I'm doing it wrong or something still not right.

Developer

Hi Jeremy, here you go https://archeia.itch.io/luna-engine-mv/devlog/102236/luna-engine-version-113-update

Nice! having a quick look at it and it seems to work. One thing I noticed tho, with the one you used to test it, you have 'x' + stacks, if you make one that just uses the "stacks", without any kind of symbol or word, it will not appear, tho simple fix is just '' +, leaving it blank.

I don't want to be a bother or anything, you have been a big help with making this work already, but from the looks of it, yanflys autopassivestates does not work with luna, the states only appear after actions. Idk how hard it would be to make work, or even if its just something needed to be added into the yml, but if you could look into it that would be great, if its not something you want to look into, could let me know and i'll figure out other ways to go about it.

Developer (2 edits)
Nice! having a quick look at it and it seems to work. One thing I noticed tho, with the one you used to test it, you have 'x' + stacks, if you make one that just uses the "stacks", without any kind of symbol or word, it will not appear, tho simple fix is just '' +, leaving it blank.

Is a setting in Yanfly not Luna? We double checked and Yanfly has a tutorial for it.


We'll check Auto Passive States again but we know it worked when we tried it out.

Like it works, its just that they wont be displayed on the Luna states setup. At least for me.

Developer

What is the priority of your passive states in database?

Just the default 50, i tried with other amounts and no difference, I also tried it in the latest 1.1.3 template, incase it was something in mine, that was messing with it, but they don't appear in that either for me, so maybe there is something missing?

Developer

Can you try this? Install in plugin manager

https://www.dropbox.com/s/jizm6v41c93frxi/BattlerStatus_DisplayStates.js?dl=0

That looks to be the same plugin as the one in the template, called "Untitled-3", which is what makes the state counters work good, just the autopassivestates don't display at start of battle still tho.

(1 edit)

Hello again, so hopefully one of my last questions on this topic, but is it easy to add into the script that if a buff doesn't have a turn count it will not display a number?

At the moment, if a buff doesn't have an auto-removal time, it will display as just 1, like the image below, which can make it confusing when, you see others that do wear off next to it, becomes hard to tell if that one will also wear off, even tho it wont.

  


Edit:

So I've found that, the turn counter is displaying the duration in turns, even if it is set to none, which is why it will display 1 turn since thats the default for duration, which makes sense since the code is only checking the duration id.

So if it was possible to add onto the script something like  if auto-removal time = none, turn counter null or something like that, I've been trying to put this into the script myself, but not knowing how to code I have not gotten far with it.