Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
JakalX

Variables Help

Question

I am trying to use variables to set a door to be usable only after you've killed so many ghosts.

Each battle with a ghost adds one to [Variable001: Ghosts Killed] if you win

The door only works after [Variable001: Ghosts Killed] is at or above 5. There are five ghosts on the map. So, you would need to kill all ghosts.

It doesnt work. The door is two pages, one blank and one with the Conditional Variable checked and teleports you. Anything? Please, this is very essential to my game.

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Well as you describe it it's supposed to work, so there must be some detail you overlooked but there's no way to tell what unless we can have a direct look at the project. Maybe screens of the event's two pages might help.

Share this post


Link to post
Share on other sites
  • 0

Why did you set the second page to "Parallel Process"? It should be "Action Button" (or "Player Touch"). If this still doesn't work, I can only assume that the event supposed to increment your variable doesn't trigger properly. Use F9 to check if the variable does increment and if it has the correct expected value.

Share this post


Link to post
Share on other sites
  • 0

If you're using a custom battle system, it is possible that it does not support in-battle events. Does the message "You killed a ghost" show properly?

Share this post


Link to post
Share on other sites
  • 0

Well then, your event definitely doesn't trigger. I assume it must be because the system checks for events triggering at the beginning of each turn - and since the battle ends right when the last ghost is defeated, there's no new turn to check for it. Anyways it seems like a flaw in the core system so you should try something else. Maybe by triggering battles "manually", like with a parallel process randomly triggering battles at set intervals, and incrementing the variable in case of victory. Or even with ghosts showing as events on the map and triggering such battles whenever you come in contact with them.

Share this post


Link to post
Share on other sites
  • 0

i found how to fix it, the problem is as moonpearl stated that the core system checks it at the start of each turn and as your event can only trigger at the end of the battle it is voided, add this into a new script:

class Scene_Battle
 #--------------------------------------------------------------------------
 # * Determine Battle Win/Loss Results
 #--------------------------------------------------------------------------
 def judge
   # If all dead determinant is true, or number of members in party is 0
   if $game_party.all_dead? or $game_party.actors.size == 0
  # If possible to lose
  if $game_temp.battle_can_lose
    # Return to BGM before battle starts
    $game_system.bgm_play($game_temp.map_bgm)
    # Battle ends
    battle_end(2)
    # Return true
    return true
  end
  # Set game over flag
  $game_temp.gameover = true
  # Return true
  return true
   end
   # Return false if even 1 enemy exists
   for enemy in $game_troop.enemies
  if enemy.exist?
    return false
  end
   end

   #set up battle event
   setup_battle_event

   # Start after battle phase (win)
   start_phase5
   # Return true
   return true
 end
end

all i did was get it to run the event check procedure before finalizing the battle :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...