<After Eval>
// Reduce Water
user._Water -= 15;
user.setStateCounter(8, user._Water);
</After Eval>
I suggest you start a new thread with this, and make sure to include every notetag of each skill or state that's involved. Screenshots especially of the state would be a good idea, too.I'm sure I already asked this, like several years ago, but I need help again.
$gameActors[3].hpRate <= 0.35
I have an enemy drop which, when the player opens it, gives a slightly random reward. In order to do this, I use a common event which runs the random variable etc. for each individual instance of this item.
However, once you have opened the drop and seen what you've got, it sends you back to the map. If you have another similar drop (highly likely) you have to press esc to get back to the Main Menu, then Item. Boring. If you have several it becomes quite tedious.
Is there a bit of code which will force open the Item menu?
I thought of:
Is this possible?
- using a second variable to count how many of the item the player has,
- then a conditional with the count being equal to or greater than 2 so that when the first one has been opened there is a reason for re-opening the menu
- tell the player how much they got with the first instance
- force open the Item Menu
- the common event then runs again.
- Once the count is less than 2 (i.e. only one left) then the 'else' branch just tells the player how much they got and finishes.
Thank you.
SceneManager.push(Scene_Item);
SceneManager.push(Scene_Menu);
SceneManager.push(Scene_Item);
<Custom Apply Effect>
user._miragestacks = user.miragestacks || 0;
user._miragestacks += 1;
user._miragestacks = Math.min(user._miragestacks, 3);
user.setStateCounter(10, user._miragestacks);
</Custom Apply Effect>
<Custom React Effect>
if (!this.isRecover() && value >= 0) {
value = 0;
defender._miragestacks -=1;
defender.setStateCounter(10, defender._miragestacks);
if (defender._miragestacks < 1) {
defender.removeState(10);
}
}
</Custom React Effect>
What exactly does this mean?for some reason, the skill doesn't stack up the state
if (!user.getStateCounter(10))
{
user.setStateCounter(10, 0);
user.clampStateCounter(10, 0, 3);
}
user.addStateCounter(10, 1);
What exactly does this mean?
Do you not see the counters appear on the state icon at all? That's probably a plugin parameter issue.
Do you see the counter but it doesn't change when you use the skill more times? What number does it show?
Code:if (!user.getStateCounter(10)) { user.setStateCounter(10, 0); user.clampStateCounter(10, 0, 3); } user.addStateCounter(10, 1);
defender.StateCounter(10) -= 1
<Custom React Effect>
if (!this.isRecover() && value >= 0) {
value = 0;
defender.addStatecounter(10, -1);
defender.setStateCounter(10, 0);
if (defender.getStateCounter(10) < 1) {
defender.removeState(10);
}
}
</Custom React Effect>
Yes, there's nothing in this code that could allow you to change the counters on multiple people at the same time. You would have to intentionally loop through the party members and adjust each one.The other issue I have is that this state can also be applied to allies, so far when in battle the custom variable seems to be created on its own for each character(if a character gets hit only that character counter is decreased instead of lowering all of them)
Somewhat unintuitively, they are the same. There's no difference between using user or target, the only difference is origin.So that makes me a bit weary of the user. should I leave it like that or add target.
I misunderstood from the documentation how the clamp worked. I thought it was a setting the state would remember, but it's something that is done when you execute it.Edit: Test your code, without changing it at all and putting it in the Custom Apply Effect, the skill stacks now but it goes past 3, so the clamp is not working
if (!user.getStateCounter(10))
user.setStateCounter(10, 0);
user.addStateCounter(10, 1);
user.clampStateCounter(10, 1, 3);
You're doing at least a bit of logic wrong, although it should still result in things happening.also I changed the Custom react to this...And is not lowering the counter when hit. I'm sure I'm doing something wrong but I don't know where
Right here, why are you counting down the counters by one just to blow all the stacks and set it to 0?Code:defender.addStatecounter(10, -1); defender.setStateCounter(10, 0);
This looks like it should work. Is the damage getting correctly set to 0?<Custom React Effect> if (!this.isRecover() && value >= 0) { value = 0; defender.addStatecounter(10, -1); if (defender.getStateCounter(10) < 1) { defender.removeState(10); } } </Custom React Effect>
Anyhow, making that change:
This looks like it should work. Is the damage getting correctly set to 0?
If it doesn't work at all, you should check that your plugins are in the correct order and such.
That would do it.found a couple of novice errors, user.miragestacks instead of user._miragestacks
That doesn't do anything. JavaScript doesn't care about spaces between operators.and also no space between the -=1
If you got it working, it doesn't really matter. Just be careful, if you're going back to the method using a user variable, of what I said in my first reply about making sure you clear it.However now I'm wondering why the one you provided is not working... it should but for some reason it isn't, maybe the addStateCounter is not working as intended???
if ($gameVariables.value(140).includes('28'))
{
do something
}