I reduced whole problem to the bone, it is part of yanfly Buffs & States Core plugin
Notetag:
<Custom Respond Effect>
var BleedID1 = 63;
target.addState(BleedID1);
</Custom Respond Effect>
State 63 has 5 turns duration.
My problem is, actor get hit, and he should receive state 63. Nothing visually happen.
Problem is he "probably" receive it "somehow" because on second hit, he receive status ID 63 with double turns (so 10 turns) probably first one during first attack + second one.
Second hit works fine with all turn counter, overlay, icon. But first one do not applied state correctly.
I am missing something obvious. Something like target.refresh to display effect immediately after respond phase?
A few possible issues I can think of. First, why do you have the var BleedID1 code for the state infliction? I think you can just put 63 in the addState ID code. I'm not sure if the current setup is hurting anything, but it seems inefficient.
Also, a lot of Yanfly's plugins were updated when MV upgraded to 1.3.0. An older version may not work properly anymore, so I'd check to make sure that your plugins are as current as possible.
I'm not sure about the use of a variable to hold the State ID without an object to call it (you could confirm whether this is the problem by using target.addState(63); and seeing if that fixes anything), but my instinct, based on the fact that it seems to be applying the state without the correct visuals is that you need to do a refresh command on the actor or his status after applying this. Offhand I don't know the syntax for doing this, but Yanfly does use the "refresh" in a lot of his Lunatic Mode code in his Tips & Tricks videos, so you could almost definitely find it by watching some T&T's.
Thank you both,
reason why I use ID is because in my real script there is some math (it can lead into few different results based on variables). Math part working without fault, but I wanted to pinpoint source of problem - which is missed state visuals, not the math part and it is not necessary to include few dozens math lines not related to problem here 🙂.
With target.addState(63); it results into same problem - no visual for first state connect.
In fact, the real state effect is skipped for first state apply too (negative HP regenereation) - but it somewhere stores turns and add them to second apply (as I use add turn policy). Second try of the same state connect correctly, with effect and visual and turns counted from both cases.
I will keep looking inside T&T' videos, I had no luck with refresh actor syntax yesterday.
edit: I am using last updated plugin versions, same pro RPG maker libraries.
Solved.
If I call first state from Yanfly action sequence, visuals works, If it is called from editor traits table it works without visuals. Since it is planned to be called via action sequence (trait calling was used just for testing purposes) it is fine enough for me 🙂. Thank you all for your time.