Event applied states not displaying message

Hi!

I have a common event, which applies states too enemies.

However, the message set too be displayed upon state application does not show.

is there any way I can manually write too the battle log?

Thanks!
I'm not sure if it's necessary to try to write straight to the battle log in this instance, but I could be wrong. If you could post screenshots of the specific state page and common event, it would be easier to troubleshoot.
I have a common event, which applies states to enemies.


However, the message set too be displayed upon state application does not show.
Is it a common event or a troop event?
If it's a common event, then it needs to be called from inside the battlescreen - parallel processes are stopped during all screens, that includes the battle screen.


And you might have a problem targeting the event command from a common event - because in the common event you have to target an enemy index that has no identification in it. Check which indes the enemy has when using the command in a troop event, and make sure that the command in the common event is targeted to that specific index. If you target an enemy that doesn't exist, then nothing will happen...
Let me explain this a bit more clearly, with screenshots.

My state:



common event:



skill that calls it:



using it:



but than it just goes too this:

I think it might be because the Change Enemy State event call is really only for use in Battle Events. Since you seem to be focusing all enemies anyway, try first switching the call to "Entire Troop" rather than an individual enemy.

If that still doesn't work, try this in a script call:

Code:
if !$game_troop.members.empty?  $game_troop.members.each do |member|    member.add_state[51] # set this to the corresponding state ID  endend
I think it might be because the Change Enemy State event call is really only for use in Battle Events. Since you seem to be focusing all enemies anyway, try first switching the call to "Entire Troop" rather than an individual enemy.

If that still doesn't work, try this in a script call:

if !$game_troop.members.empty? $game_troop.members.each do |member| member.add_state[51] # set this to the corresponding state ID endend
I'm applying a different state too each enemy.

(enemy 1 gets state 51, enemy 2 gets state 52, enemy 3 gets state 51, and so on)

otherise i'ld just make the skill apply the state
Ohh, ok, gotcha! In that case, do this: 

if !$game_troop.members.empty? $game_troop.members.each do |member| state_num = 8 # set this to the number of states you have s = rand(max=state_num) # randomize which state is applied member.add_state[50+s] # add the state endendIf you want it to select between specific states (ie. only A1 and B1) narrow the range and group those states together.
Now i get this error.

script 'Game_interpereter' like 1411: ArgumentError occured

wrong number of arguments (0 for 1)

also, that script seems too be adding a random state too each enemy

Instead of random, I want it too be alternating between enemies. like enemy index 1 gets 51, enemy index 2 gets 52, enemy index 3 gets 51, etc.

ie: enemy index 1 gets state 51, enemy index 2 gets state 52, enemy
So after spending a bunch of time looking through code trying to find out why the state text doesn't show up when applied through a common event, I came up with a much easier way to do what you want :S.

Just put this line into the Formula: line of your skill:

b.add_state(52 - (b.index % 2)); 0Set the state you want to apply to the first enemy as 51 and the state you want to apply to the next enemy as 52. It will then cycle between the two states and add them to all enemies.
I actually decided too not use this skill in the end.

But this information will surely prove useful later, thanks!
just because it bugs me every time I read it,


too = as well. Drop an o every time you write it (the word is to, not too), because you're making me concentrate on your mis-spelling rather than your issue.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/event-applied-states-not-displaying-message.18301/