Run common event when enemy gets a state applied?

● ARCHIVED · READ-ONLY
Started by Taladro-Senpai 8 posts View original ↗
  1. So what I want to do is, when in battle, if an enemy gets a 'Scared' state, for example, run a common event that gives a random value to a variable, and plays a sound according to the value, right after the state is applied (if it's 1, play sound1; if it's 2, play sound2; etc.)

    I tried using a troop event page to check each turn if the enemy is 'scared' and call the common event. But for some reason no sound plays at all. I don't think the common event is the problem because I tried calling it at the start of the battle and it worked.

    Any scripts or anything that can help me do it? Another important thing is that I have different enemy types with different 'scared' sounds, so I would have to check for each enemy individually.

    By the way, sorry for the bad english, not my first language, and I'm using the spanish translation of RPGMaker.
  2. there are issues with states not updating correctly sometimes.
    how long does it last?
    can you post a picture of the procedure?
  3. All right, here's every event in the troop and each common event assigned to it. The first two common events run correctly (GuardAppear and GuardDeath), and play a sound when a guard appears and when it dies. The last event corresponding to the 'Intimidated' state doesn't work, even after setting it to 'Moment', as it doesn't play any sound. I set the state to last 1 turn, but if it could last longer while playing the sound only once (when the state is applied) it would be perfect. Hope these images work.

    Troop Event and Common Event 01
    troopevent01.png

    commonevent01.png

    Troop Event and Common Event 02
    troopevent02.png

    commonevent02.png

    Troop Event and Common Event 03
    troopevent03.png

    commonevent03.png
  4. condition is set to "Don't Run", "run" as in "execute", not "run away"
    set the condition to watch for "alive" (since you're adding it anyways), and the span to "turn" instead of "moment".

    also, you can set the "death" state to pop "alive" when it's added.
    that way you wouldn't need to remove "alive", because that'd happen automatically when "death" is added, since you can't pull a Schrodinger and be both alive and dead.
  5. gstv87 said:
    condition is set to "Don't Run", "run" as in "execute", not "run away"
    set the condition to watch for "alive" (since you're adding it anyways), and the span to "turn" instead of "moment".




    (...........who made that translation? dear God.... ¬¬ )
    Wow, didn't know about that. Now I changed it and it kinda works, I turned On a switch at the start of battle to use as a condition, and set the span to 'Turn'. Now the sounds play when Intimidated, but only after the turn has ended and I've already chosen an action for the next turn. Is there any way to run the common event inmediatly after the state is applied? A script or something?
  6. the battle flow is tricky to intercut with other events.
    if you want the effect to play right after the state is added, you'll have to hook up into that function and call the procedure from there.
    that'd totally shift you from battle event to plugin, because scheduling a common event from there would cause it to run at the end of that processing cycle, so it wouldn't be after the fact either.

    you could potentially come up with a handshake system that'd toggle switches on and off controlling the flow, but I don't know how messy it would become if you try to expand it.
    if it works in small scale and you can't find a plugin for it, you'd better design the whole set of encounters first, and establish that system for that set alone, set it in stone and not change it.
  7. that's what I was talking about.
    a scheduled common event always runs after any battle events have run, which run (or not) at the beginning of the turn (I can't remember)
    so, it wouldn't happen right after the fact.