Main Menu
  • Welcome to The RPG Maker Resource Kit.

Why does this event page not work?

Started by Grafikal, May 17, 2009, 02:54:05 AM

0 Members and 1 Guest are viewing this topic.

Grafikal



I should say that it's not that it doesn't work, but it just doesn't work while the player is by himself or if the whole party gets wiped at the same time. How in the hell can I get these events to run before the game decides "OH WELL FUCK IT, HE DIED AND I DON'T FEEL LIKE PROCESSING THAT EVENT PAGE"?

I've tried loads of different combinations of the event page and its conditions. I've tried to have the span at Battle, Turn and Moment. I've tried the conditions set with a switch so it's constantly checking but even still, the game decides to straight to game over. I've tried removing the condition to check if the state "incapacitated" is inflicted and instead set the conditions to run the event if the character's health drops below 1% or 0%. That doesn't work. I've tried setting them each at Battle or Moment. I would assume moment occurs at the very moment that the conditions are fulfilled but that's just BS.

It works when a character dies and there are other alive characters. However, that's not the point. It's supposed to kick in right when the character dies to revive him.

Span:
QuoteInterval during which the event contents are allowed to run.
Battle: Run only once in battle, even when conditions are met.
Turn: Run only once per turn, even when conditions are met.
Moment: Repeat while conditions continue to be met.

Can I slow down how fast the game decides to jump on game overs? Like force it to check the event page then continue? Also, I've tried the same events in a common event running on parallel and that didn't work either. I'm getting so frustrated. ._.

Falcon

Not 100% sure, but the death state might remove any other states. Check that.

Grafikal

#2
I have, when I check on the incapacitated state, it removes everything except for itself and Ironwill, which is the one I made. I kind of figure on the solution being very simple since this event page is seriously basic stuff.

I know it works as is, it just doesn't work with a single actor in a party or if the whole party dies in one attack. Like, I think the 'spans' only check the conditions during the player's turns and not during the enemy's turns because I've tested this with another actor in the party (making it 2 actors) and having the first one die with Ironwill state. So after the attack on him kills him and the beginning of my turn has begun, he's effectively situated at 1HP and not incapacitated and no Ironwill anymore. So that's why I'm assuming the 'spans' will check the conditions at the beginning of a player's turn instead of the exact moment that the conditions are met during the enemy's turn just before it's over.

Falcon

Oh, if it's a problem of the event processing after the actor dies, and therefore the game over triggers before the event runs, you're screwed. Only a script could change that.

Zylos

It's entirely possible, and I think I know a LONG way of doing it. I don't know the exact code, but just add an if then statement to where it would normally call a gameover if all the players are dead in the Game_Battle script. Have it check if any of the characters has the state, and if no one does, then else it over to game over. Modern can probably show you how in zero seconds, but if not, I can attempt to do it tomorrow.




Grafikal

:O I love you Zylos. Lol, I was about to post asking if there was a script-bit to add somewhere to do something like that. Thanks for answering me before I asked :)

modern algebra

#6
Just the way battle processing works. Basically, the method is:



     return if judge_win_loss            # Determine win/loss results
     update_scene_change
     if @target_enemy_window != nil
       update_target_enemy_selection     # Select target enemy
     elsif @target_actor_window != nil
       update_target_actor_selection     # Select target actor
     elsif @skill_window != nil
       update_skill_selection            # Select skill
     elsif @item_window != nil
       update_item_selection             # Select item
     elsif @party_command_window.active
       update_party_command_selection    # Select party command
     elsif @actor_command_window.active
       update_actor_command_selection    # Select actor command
     else
       process_battle_event              # Battle event processing
       process_action                    # Battle action
       process_battle_event              # Battle event processing
     end


As you can see, the process_battle_event won't be run if judge_win_loss is true. And judge_win_loss returns true if the entire party is dead. Sorry.

To fix it, the best way is to alter judge_win_loss. Something like this plugged in below Materials and above Main might work:

class Scene_Battle
  alias molg_jdg_winls_grfkl_irnwill_13dd3 judge_win_loss
  def judge_win_loss
    if $game_temp.in_battle
      if $game_party.all_dead?
        $game_party.members.each { |actor| return false if actor.states.include? ($data_states[i]) }
      end
    end
    molg_jdg_winls_grfkl_irnwill_13dd3
  end
end


I would need to test though. Some of the other stuff might mess up after all before it ever gets to processing. I imagine it will actually.


EDIT::

Hey look it's Zylos. He basically said what I just did.

Grafikal

#7
Lol, that worked.......Kind of. So just as the screen was fading away into a game over, I noticed that it became the player's turn and also the actor was at 1HP and no states affected (Like how it should be) except for the fact that... it still went to a game over :P

Edit~
Also it seems to have ignored that the event for the battle processing was checked so that Win or Lose you would continue. So since I lose, it stops at the game over instead of just popping me back onto the map.

modern algebra

:P

Well, if you wanted, I could just make the Iron Will stuff happen in that script and avoid the event altogether.

Grafikal

._. haha. This is true. I was kinda hoping for just a line that would place checking those events in a higher priority than checking if all party members are dead. But if you want to do it, then by all means, absolutely. lol.