Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Zamknięty przez: Ayene
Pon 07 Lut, 2011 07:49
Ilość zabitych bestii w zmiennej
Autor Wiadomość
tracersgta 




Preferowany:
RPG Maker VX

Pomógł: 45 razy
Dołączył: 10 Sty 2011
Posty: 612
Skąd: mam wiedzieć?
Wysłany: Nie 16 Sty, 2011 16:46
Ilość zabitych bestii w zmiennej
Chcę zrobić questa, żeby po zabiciu 10 szczurów quest został zrobiony.
Więc warunek ze zmienna jakaś tam musi wynosic 10 aby przelacznik quest 3 zostal dany na ON. A jak zrobić żeby po zabiciu jednego szczura do zmiennej dodala się 1 wartość?
________________________
I'm a tiger! I roar. I hunt, I climb, I eat, I wash, I sleep!

Gość, jeżeli pomogłem daj "Pomógł" ;-)
 
 
 
Angius 

Nie wkurzać



Preferowany:
RPG Maker VX

Pomógł: 104 razy
Dołączył: 30 Paź 2010
Posty: 1276
Skąd: wROCK
Wysłany: Nie 16 Sty, 2011 16:57
Ustawiasz w walce, że przegrana nie kończy gry, a potem jeśli walka jest wygrana ustawiasz, żeby dodawało +1 do zmiennej.
I żeby np. zakończyć questa nie musisz stosować dodatkowego przełącznika, wystarczy, że ustawisz warunek zmienna=10
________________________
"Na trolla pewne są tylko dwie pewne metody, jedna samopowtarzalna i druga, wymagająca przeładowania ręcznego."


 
 
tracersgta 




Preferowany:
RPG Maker VX

Pomógł: 45 razy
Dołączył: 10 Sty 2011
Posty: 612
Skąd: mam wiedzieć?
Wysłany: Nie 16 Sty, 2011 20:52
3 wątpliwości.
1 to chcę że jak bochater przegra bitwę to chcę żeby zginął! A to zaprzecza temu!
2 to dostaje się 1 wartość od WALKI a nie od PRZECIWNIKA. A co jeżeli jest ich 3 w grupie? Zaliczy to jako 1.
3 daje walki losowe. Nie ma bitew w zdarzeniach.
________________________
I'm a tiger! I roar. I hunt, I climb, I eat, I wash, I sleep!

Gość, jeżeli pomogłem daj "Pomógł" ;-)
 
 
 
RATI 




Preferowany:
RPG Maker VX

Pomógł: 16 razy
Dołączył: 12 Cze 2010
Posty: 72
Skąd: Lubin
Wysłany: Nie 16 Sty, 2011 21:23
Użyj poniższego skryptu:

Spoiler:

Kod:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/    ◆          Battle-Related Counters - KGC_BattleCount2           ◆ VX ◆
#_/    ◇                  Last Update: 2008/04/13                           ◇
#_/    ◆                    Original Version by KGC                         ◆
#_/    ◆                  Version 2 by Mr. Anonymous                        ◆
#_/-----------------------------------------------------------------------------
#_/  This script processes a number of battle-related counters, such as Battle
#_/   Count, Victory Count, Escape Count, and more. Due to the nature of this
#_/   script, it's use is up to the creator.
#_/=============================================================================
#_/                          ◆ Event Commands ◆
#_/  These commands are used in "Script" function in the third page of event
#_/   commands under "Advanced".
#_/
#_/ * reset_battle_count
#_/    Resets the battle counter. 
#_/
#_/ * get_defeat_count(EnemyID, VariableID)
#_/    Retrieves the amount of a specified defeated enemy and stores it in the
#_/     given variable.
#_/
#_/ * get_dead_count(ActorID, VariableID)
#_/    Retrieves the amount of times a specified actor has "died" and stores it
#_/     in the given variable.   
#_/
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_

#==============================================================================#
#                            ★ Customization ★                                 #
#==============================================================================#
module KGC
  module BattleCount
   
    # Note: The value to the right of each of these is the in-game variable you
    #  desire to have these counters stored in.
   
    #                       ◆ Battles Counter ◆
    # Retrieves the current battle count and stores it in the given variable.
    BATTLE_COUNT = 16
   
    #                      ◆ Victories Counter ◆
    #   Retrieves the current amount of victories and stores it in the given
    #     variable.
    VICTORY_COUNT = 17
   
    #                       ◆ Escapes Counter ◆
    # Retrieves the amount of escapes and stores it in the given variable.
    ESCAPE_COUNT =18
   
    #                       ◆ Losses Counter ◆
    # Retrieves the amount of loses and stores it in the given variable.
    LOSE_COUNT = 19
   
    #                ◆ Total Defeated Enemies Counter ◆
    # Retrieves the total amount of defeated enemies and stores it in the given
    #  variable.
    TOTAL_DEFEAT_COUNT = 20
   
    #                    ◆ Total Deaths Counter ◆
    # Retrieves the total amount of times the party has died (by member) and
    #  stores it in the given variable.
    TOTAL_DEAD_COUNT = 21   
   
  end
end

#------------------------------------------------------------------------------#

$imported = {} if $imported == nil
$imported["BattleCount"] = true

#==============================================================================#
#                               □ KGC::Commands □                              #
#==============================================================================#

module KGC
 module Commands
  module_function
  #--------------------------------------------------------------------------
  # ○ Reset Battle Count
  #--------------------------------------------------------------------------
  def reset_battle_count
    $game_system.reset_battle_count
  end
  #--------------------------------------------------------------------------
  # ○ Aquire Battle Count
  #--------------------------------------------------------------------------
  def get_battle_count=(count)
    $game_variables[KGC::BattleCount::BATTLE_COUNT] = count
    return count
  end
  #--------------------------------------------------------------------------
  # ○ Aquire Victory Count
  #--------------------------------------------------------------------------
  def get_victory_count=(count)
    $game_variables[KGC::BattleCount::VICTORY_COUNT] = count 
    return count
  end
  #--------------------------------------------------------------------------
  # ○ Aquire Escape Count
  #--------------------------------------------------------------------------
  def get_escape_count=(count)
    $game_variables[KGC::BattleCount::ESCAPE_COUNT] = count
    return count
  end
  #--------------------------------------------------------------------------
  # ○ Aquire Lose Count
  #--------------------------------------------------------------------------
  def get_lose_count=(count)
    $game_variables[KGC::BattleCount::LOSE_COUNT] = count
    return count
  end
  #--------------------------------------------------------------------------
  # ○ Aquire Specified Defeated Enemy
  #     enemy_id    : Enemy ID
  #     variable_id : Variable ID
  #--------------------------------------------------------------------------
  def get_defeat_count(enemy_id, variable_id = 0)
    count = $game_system.defeat_count(enemy_id)
    $game_variables[variable_id] = count if variable_id > 0
    return count
  end
  #--------------------------------------------------------------------------
  # ○ Aquire Total Defeat Count
  #--------------------------------------------------------------------------
  def get_total_defeat_count=(count)
    $game_variables[KGC::BattleCount::TOTAL_DEFEAT_COUNT] = count
    return count
  end
  #--------------------------------------------------------------------------
  # ○ Aquire Dead Count
  #     actor_id    : Actor ID
  #     variable_id : Variable ID
  #--------------------------------------------------------------------------
  def get_dead_count(actor_id, variable_id = 0)
    count = $game_system.dead_count(actor_id)
    $game_variables[variable_id] = count if variable_id > 0
    return count
  end
  #--------------------------------------------------------------------------
  # ○ Aquire Total Dead Count
  #--------------------------------------------------------------------------
  def get_total_dead_count=(count)
    $game_variables[KGC::BattleCount::TOTAL_DEAD_COUNT] = count
    return count
  end
 end
end

class Game_Interpreter
  include KGC::Commands
end

#==================================End Class===================================#

#==============================================================================
# ■ Game_System
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # ○ Open Global Variables
  #--------------------------------------------------------------------------
  attr_writer   :defeat_count             # Defeat Count
  attr_writer   :dead_count               # Dead Count
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------
  alias initialize_KGC_BattleCount initialize
  def initialize
    initialize_KGC_BattleCount

    reset_battle_count
  end
  #--------------------------------------------------------------------------
  # ○ Reset
  #--------------------------------------------------------------------------
  def reset_battle_count
    battle_count  = 0
    victory_count = 0
    escape_count  = 0
    lose_count    = 0
    @defeat_count = []
    @dead_count   = []
  end
  #--------------------------------------------------------------------------
  # ○ Reset Battle Count
  #--------------------------------------------------------------------------
  def battle_count
    reset_battle_count if $game_variables[KGC::BattleCount::BATTLE_COUNT] == nil
    return $game_variables[KGC::BattleCount::BATTLE_COUNT]
  end
  #--------------------------------------------------------------------------
  # ○ Reset Victory Count
  #--------------------------------------------------------------------------
  def victory_count
    reset_battle_count if $game_variables[KGC::BattleCount::VICTORY_COUNT] == nil
    return $game_variables[KGC::BattleCount::VICTORY_COUNT]
  end
  #--------------------------------------------------------------------------
  # ○ Reset Escape Count
  #--------------------------------------------------------------------------
  def escape_count
    reset_battle_count if $game_variables[KGC::BattleCount::ESCAPE_COUNT] == nil
    return $game_variables[KGC::BattleCount::ESCAPE_COUNT]
  end
  #--------------------------------------------------------------------------
  # ○ Reset Lose Count
  #--------------------------------------------------------------------------
  def lose_count
    reset_battle_count if $game_variables[KGC::BattleCount::LOSE_COUNT] == nil
    return $game_variables[KGC::BattleCount::LOSE_COUNT]
  end
  #--------------------------------------------------------------------------
  # ○ Reset Defeat Count
  #     enemy_id : Enemy ID
  #--------------------------------------------------------------------------
  def defeat_count(enemy_id)
    reset_battle_count if @defeat_count == nil
    @defeat_count[enemy_id] = 0 if @defeat_count[enemy_id] == nil
    return @defeat_count[enemy_id]
  end
  #--------------------------------------------------------------------------
  # ○ Add defeat Count
  #     enemy_id : Enemy ID
  #--------------------------------------------------------------------------
  def add_defeat_count(enemy_id)
    reset_battle_count if @defeat_count == nil
    @defeat_count[enemy_id] = 0 if @defeat_count[enemy_id] == nil
    @defeat_count[enemy_id] += 1
    $game_variables[KGC::BattleCount::TOTAL_DEFEAT_COUNT] = @defeat_count[-1]
  end
  #--------------------------------------------------------------------------
  # ○ Calculate Total Defeat Count
  #--------------------------------------------------------------------------
  def total_defeat_count
    n = 0
    for i in 1...$data_enemies.size
      n += defeat_count(i)
    end
    return n
  end
  #--------------------------------------------------------------------------
  # ○ Reset Dead Count
  #     actor_id : Actor ID
  #--------------------------------------------------------------------------
  def dead_count(actor_id)
    reset_battle_count if @dead_count == nil
    @dead_count[actor_id] = 0 if @dead_count[actor_id] == nil
    return @dead_count[actor_id]
  end
  #--------------------------------------------------------------------------
  # ○ Add Dead Count
  #     actor_id : Actor ID
  #--------------------------------------------------------------------------
  def add_dead_count(actor_id)
    reset_battle_count if @dead_count == nil
    @dead_count[actor_id] = 0 if @dead_count[actor_id] == nil
    @dead_count[actor_id] += 1
    $game_variables[KGC::BattleCount::TOTAL_DEAD_COUNT] = @dead_count[-1]
  end
  #--------------------------------------------------------------------------
  # ○ Calculate Total Dead Count
  #--------------------------------------------------------------------------
  def total_dead_count
    n = 0
    for i in 1...$data_actors.size
      n += dead_count(i)
    end
    return n
  end
end

#==================================End Class===================================#

#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● Add Battle Count
  #--------------------------------------------------------------------------
  alias post_start_KGC_BattleCount post_start
  def post_start
    $game_variables[KGC::BattleCount::BATTLE_COUNT] += 1
    post_start_KGC_BattleCount
  end
  #--------------------------------------------------------------------------
  # ● Define Battle Count
  #--------------------------------------------------------------------------
  def battle_count
    return $game_variables[KGC::BattleCount::BATTLE_COUNT]
  end
  #--------------------------------------------------------------------------
  # ● Battle End
  #     result : Battle Result (0:Victory 1:Escape 2:Lose)
  #--------------------------------------------------------------------------
  alias battle_end_KGC_BattleCount battle_end
  def battle_end(result)
    #unless @battle_count_added
      case result
      when 0  # Victory
        $game_variables[KGC::BattleCount::VICTORY_COUNT] += 1
      when 1  # Escape
        $game_variables[KGC::BattleCount::ESCAPE_COUNT]  += 1
      when 2  # Lose
        $game_variables[KGC::BattleCount::LOSE_COUNT]    += 1
      end
      # Add Dead Enemy
      $game_troop.dead_members.each { |enemy|
        $game_system.add_defeat_count(enemy.enemy.id)
      }
      #@battle_count_added = true
     #end
    battle_end_KGC_BattleCount(result)
  end
  #--------------------------------------------------------------------------
  # ● Execute Action
  #--------------------------------------------------------------------------
  alias execute_action_KGC_BattleCount execute_action
  def execute_action
    last_exist_actors = $game_party.existing_members

    execute_action_KGC_BattleCount

    # Add Dead Actor
    dead_actors = last_exist_actors - $game_party.existing_members
    dead_actors.each { |actor|
      $game_system.add_dead_count(actor.id)
    }
  end
end

#==================================End Class===================================#
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/  The original untranslated version of this script can be found here:
# http://f44.aaa.livedoor.jp/~ytomy/tkool/rpgtech/php/tech.php?tool=VX&cat=tech_vx/base_function&tech=battle_count
#_/=============================================================================
#_/  Version2 brought to you by Mr. Anonymous.
# http://mraprojects.wordpress.com
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_

________________________
https://www.facebook.com/...122840511098876 - dołącz do grupy gry Magiczna Wieża[VX] na fb i śledź na bieżąco postęp prac nad projektem :P
 
 
tracersgta 




Preferowany:
RPG Maker VX

Pomógł: 45 razy
Dołączył: 10 Sty 2011
Posty: 612
Skąd: mam wiedzieć?
Wysłany: Nie 16 Sty, 2011 21:30
Może byś jakąś instrukcję podał.
________________________
I'm a tiger! I roar. I hunt, I climb, I eat, I wash, I sleep!

Gość, jeżeli pomogłem daj "Pomógł" ;-)
 
 
 
Wyświetl posty z ostatnich:   
Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene