collapse collapse

 Community


 User Info




Willkommen Gast. Bitte einloggen oder registrieren.

 Partnerseiten

rpgvx.net

Das Forum ist offline

Autor Thema: (Tech) Waffe mit verbrauchbarer Munition  (Gelesen 1240 mal)

Offline Michel

  • Event-Jongleur
  • **
  • Beiträge: 57
(Tech) Waffe mit verbrauchbarer Munition
« am: Juli 20, 2009, 21:37:38 »
- Ich suche nach einem Script, mit dem ich
zB Pfeile brauche, um einen Bogen benutzen zu können.

- Mit dem Bogen soll ich keine Bolzen benutzen können, die sind für die Armbrust.

- Die Pfeile sollen je nach Art im Kampf eine spezifische Animation
zeigen zB Eispfeil und nach dem Angriff auch verbraucht werden.

Mit dem Script von cmpsr2000 habe ich mich schon auseinandergesetzt
und das Script ist eigentlich super, nur ich habe ein großes Problem damit.

Ich kann einfach kein Schild haben, weder im Inventar, noch im Equipment.
Habe im rpgrevolution-Forum geschrieben, da antwortet aber keiner.

Kennt ihr ähnliche Scripts?

Lg michel

« Letzte Änderung: Juli 20, 2009, 21:39:35 von Michel »

Re: Waffe mit verbrauchbarer Munition

fuzzy

  • Gast
Re: Waffe mit verbrauchbarer Munition
« Antwort #1 am: Juli 21, 2009, 07:48:11 »
Zitat
Ich suche nach einem Skript
- fängt schonmal sehr gut an.

Hm. Jetzt so aus dem Bauch heraus, wäre das erste was mir einfällt,
die Common Events die man mit einem Skill aktivieren könnte.
Also, du könntest per CE permanent abfragen lassen, ob eine Waffe
angelegt ist. Wenn ja kannst du dem Charakter dann einen Skill lernen lassen.
Der Skill löst über ein CE dann die Bedingung aus, dass wenn er benützt wird,
er ein Item, in diesem Fall Pfeile Kugeln oder Teddybären, abzieht aus dem Inventar.


Ich glaube das solche Methoden die über Events laufen,
besser, einfacher und schneller sind, als speziell eigene Skripts dafür.

lg, fuzz


Re: Waffe mit verbrauchbarer Munition

Offline Boogatie Roll

  • VX-Meister
  • ****
  • Beiträge: 676
  • Java[Spiele] Programmierer
    • BRolls Game Website
Re: Waffe mit verbrauchbarer Munition
« Antwort #2 am: Juli 24, 2009, 21:13:54 »
Mach den bogen als Waffe, die Pfeile als Item.
Dann machst du ein Commom Event das immer abfragt, ob Pfeile vorhanden sind.
wenn nicht, dann verlernt der Held den Bogenschuss (die technik) oder kann halt nicht angreifen.
Du musst vorher halt noch abfragen wer den Bogen hat.
Wenn aber Pfeile da sind, (bedingung item....) erlernt er den Angriff und Pfeile (also das Item) -1.
Mit verschiedenen Pfeilen gehts genauso.

Re: Waffe mit verbrauchbarer Munition

Offline Michel

  • Event-Jongleur
  • **
  • Beiträge: 57
Re: Waffe mit verbrauchbarer Munition
« Antwort #3 am: Juli 26, 2009, 18:23:43 »
Danke Leute für die Vorschläge!

Aber ich habe von Anfang an nach einem Script gesucht.
(Bin der Meinung, dass ein paralleles Common Event...
1) umständlich ist, weil man's selbst machen muss
2) viel belastender für den PC ist, meiner hat halt nur 256 RAM)

Aber das Warten hat sich gelohnt. Hab heute das meinen Wünschen entsprechende Script gefunden, ist erst vorgestern releast worden, hoffentlich funktioniert's.

http://www.rpgmakervx.net/index.php?showtopic=17709

Lg michel

Re: Waffe mit verbrauchbarer Munition

Offline Coin

  • Event-Jongleur
  • **
  • Beiträge: 69
Re: Waffe mit verbrauchbarer Munition
« Antwort #4 am: Juli 26, 2009, 20:02:15 »
kannst du den skript nich eifach mal driekt kopieren  und nich nur ein link zu der seite angeben?
ich hab mich da zwar mal registriert aber iwie hab ich das psw vergessen...
Don't wake, I'm working!

Re: Waffe mit verbrauchbarer Munition

Offline Kiige

  • a Lonely Artist Genre
  • Database-Verunstalter
  • **
  • Beiträge: 197
  • Mr. Anything is possible party rocket launcher
Re: Waffe mit verbrauchbarer Munition
« Antwort #5 am: Juli 26, 2009, 20:09:24 »
Hier is der link zu dem selben script bloß bei Revolution
dort muss man sich net anmelden ^^

http://www.rpgrevolution.com/forums/index.php?showtopic=33480

Aber hier nochmal das komplette script ^^
#===============================================================================
# * Ammo Requirements * - VX Edition
#-------------------------------------------------------------------------------
# Written by Ty/Synthesize
# Version 1.1.0
# July 24, 2009
#-------------------------------------------------------------------------------
# * This script is only compatible with RGSS2 *
#===============================================================================
# Begin Customization
#-------------------------------------------------------------------------------
module TysAmmoRequirements
  #-----------------------------------------------------------------------------
  # * General Settings *
  #-----------------------------------------------------------------------------
    # Un-equip actor weapon when out of ammo.
    Unequip_weapon_NoAmmo = true
  #-----------------------------------------------------------------------------
  # * Weapon Ammunition Settings *
  #-----------------------------------------------------------------------------
    # This sets how much ammo is needed for a specific weapon ID in the database
    # Syntax = {weapon_id => ammunition_cost}
    Weapons_ammo_cost = {4 => 1, 5 => 1}
    # This assigns Item IDs in the database to a weapon ID
    # Syntax = {weapon_id => item_id}
    Weapons_ammo_id = {4 => 21, 5 => 22}
  #-----------------------------------------------------------------------------
  # *Skill Ammunition Settings *
  #-----------------------------------------------------------------------------
    # This assigns the ammo cost for a specific skill ID
    # Syntax = {skill_id => ammo_cost}
    Skill_ammo_cost = {1 => 2}
    # This defines the Item ID used as ammunition for the Skill ID
    # syntax = {skill_id => Item_ID}
    Skill_ammo_id = {1 => 21}
  #-----------------------------------------------------------------------------
  # * Enemy Ammo Use Settings *
  #-----------------------------------------------------------------------------
    # This defines enemies that use ammunition. Simply put this tag in the 'Notes'
    # and the enemy will automatically use ammunition.
    Enemy_ammo_activate_string = "UseAmmo"
    # This defines enemy weapon/ammo names
    # Syntax: {enemy_id => "Name"}
    Enemy_ammo_name = {1 => "Jelly", 2 => "Arrow", 3 => "Pistol"}
    # This defines ammo cost when enemy uses skills
    # Syntax: skill_id -> ammo_cost
    Enemy_skill_cost = {1 => 5}
end
#-------------------------------------------------------------------------------
# Vocab Add-ons
#-------------------------------------------------------------------------------
module Vocab
  # Syntax: "[Actor_Name] used [ammo_cost] [ammo_name]"
  ConsumeAmmo = "%s used %s %s(s)!"
  # Syntax: "[Actor_Name] is out of [ammo_name}!"
  NoAmmo = "%s is out of %s(s)!"
  # Syntax: "[Enemy_Name] is out of [ammo_name}!"
  EnemyNoAmmo = "%s is out of %s!"
  # Syntax: "[Enemy_Name] used a [ammo_name}!"
  EnemyUsedAmmo = "%s used %s!"
end
#-------------------------------------------------------------------------------
# End Script Customization
#-------------------------------------------------------------------------------
# Begin Script
#-------------------------------------------------------------------------------
class Scene_Battle
  # Alias methods
  alias ty_ammo_requirements_attack execute_action_attack
  alias ty_ammo_requirements_start start
  alias ty_ammo_requirements_execute_action execute_action
  alias ty_ammo_requirements_execute_skill execute_action_skill
  #-----------------------------------------------------------------------------
  # Start:: Call a custom method
  #-----------------------------------------------------------------------------
  def start
    ty_set_enemy_ammo
    ty_ammo_requirements_start
  end
  #-----------------------------------------------------------------------------
  # Sets the enemy ammo requirement statistics
  #-----------------------------------------------------------------------------
  def ty_set_enemy_ammo
    @enemy_ammo = []
    @enemy_attack = -1
    for member in $game_troop.members
      total_ammo = $data_enemies[1].note.downcase.match('totalammo:(\d*)')[1].to_i
      @enemy_ammo.push(total_ammo)
    end
  end
  #-----------------------------------------------------------------------------
  # Reset Enemy Index if it is the actors turn
  #-----------------------------------------------------------------------------
  def execute_action
    # This is a VERY lazy way for using different enemy ammo counts.
    # When it's the enemies turn, add one to enemy_attack. This acts as a index
    # For emoving enemy ammo. It's an extremely simple and lazy way :x
    if @active_battler.is_a?(Game_Actor)
      @enemy_attack = -1
    else
      @enemy_attack += 1
    end
    ty_ammo_requirements_execute_action
  end
  #-----------------------------------------------------------------------------
  # execute_action_attack: Call an additional method, and then call the original code
  #-----------------------------------------------------------------------------
  def execute_action_skill
    # Call a custom battle method
    ty_execute_action_skill
    # Call the original battle method if still attacking
    if @active_battler.action.kind == 1
      ty_ammo_requirements_execute_skill
    end
  end
  #-----------------------------------------------------------------------------
  # execute_action_attack: Call an additional method, and then call the original code
  #-----------------------------------------------------------------------------
  def execute_action_attack
    # Call a custom battle method
    ty_execute_action_attack
    # Call the original battle method if still attacking
    if @active_battler.action.kind == 0
      ty_ammo_requirements_attack
    end
  end
  #-----------------------------------------------------------------------------
  # ty_execute_action_attack: This method performs the 'Attacking' with ranged weapon
  # check and removes the ammo needed, if it is present.
  #-----------------------------------------------------------------------------
  def ty_execute_action_attack
    # Check to see if the current attacker is the actor and is using a weapon that needs ammo
    if @active_battler.is_a?(Game_Actor) && TysAmmoRequirements::Weapons_ammo_cost[@active_battler.weapon_id]
      # Both checks clear, so perform Ammo adjustments
      # First we collect some end-user options, like ammo cost and ammo ID.
      gather_ammo_cost = TysAmmoRequirements::Weapons_ammo_cost[@active_battler.weapon_id]
      gather_ammo_item =  $data_items[TysAmmoRequirements::Weapons_ammo_id[@active_battler.weapon_id]]
      # Next we check to make sure the attacking actor has enough ammo
      if $game_party.item_number(gather_ammo_item) >= gather_ammo_cost
        # The check cleared, so perform ammo adjustments
        # Consume Ammunition
        $game_party.lose_item(gather_ammo_item, gather_ammo_cost)
        # Display text
        text = sprintf(Vocab::ConsumeAmmo, @active_battler.name, gather_ammo_cost, gather_ammo_item.name)
        @message_window.add_instant_text(text)
      else
        # Failed check, go into defense mode
        if TysAmmoRequirements::Unequip_weapon_NoAmmo
          @active_battler.change_equip_by_id(0,0)
        else
        text = sprintf(Vocab::NoAmmo, @active_battler.name, gather_ammo_item.name)
        @message_window.add_instant_text(text)
        @active_battler.action.kind = 1
        execute_action_guard
        end
      end
      # Perform a check to see if Active_Battler is a enemy and has ammo
    elsif @active_battler.is_a?(Game_Enemy) && $data_enemies[@active_battler.enemy_id].note.include?(TysAmmoRequirements::Enemy_ammo_activate_string)
      # Now we have to isolate the interger in the 'Note' string of the enemies
      # and then store the interger in a new local value for future use.
      enemy_ammo_cost = $data_enemies[@active_battler.enemy_id].note.downcase.match('ammocost:(\d*)')[1].to_i
      enemy_use_physical = true if $data_enemies[@active_battler.enemy_id].note.include?('usephysical')
      enemy_ammo_name = TysAmmoRequirements::Enemy_ammo_name[@active_battler.enemy_id]
      # Check to see if the enemy has enough ammo to attack
      if @enemy_ammo[@enemy_attack] >= enemy_ammo_cost
        # Check cleared, remove enemy ammo.
        text = sprintf(Vocab::EnemyUsedAmmo, @active_battler.name, enemy_ammo_name)
        @message_window.add_instant_text(text)
        @enemy_ammo[@enemy_attack] -= enemy_ammo_cost
      else
        # Check failed, put enemy in guard mode 
        if enemy_use_physical == false
          text = sprintf(Vocab::EnemyNoAmmo, @active_battler.name, enemy_ammo_name)
          @message_window.add_instant_text(text)
          @active_battler.action.kind = 1
          execute_action_guard
        end
      end
    end
  end
  #-----------------------------------------------------------------------------
  # ty_execute_action_skill: This method checks to see if the skill being used
  # requires ammunition.
  #-----------------------------------------------------------------------------
  def ty_execute_action_skill
    # Check to see if the current attacker is the actor and is using a weapon that needs ammo
    if @active_battler.is_a?(Game_Actor) && TysAmmoRequirements::Skill_ammo_cost[@active_battler.action.skill_id]
      # Both checks clear, so perform Ammo adjustments
      # First we collect some end-user options, like ammo cost and ammo ID.
      gather_ammo_cost = TysAmmoRequirements::Skill_ammo_cost[@active_battler.action.skill_id]
      id = @active_battler.action.skill_id
      gather_ammo_item =  $data_items[TysAmmoRequirements::Skill_ammo_id[id]]
      if $game_party.item_number(gather_ammo_item) >= gather_ammo_cost
        # The check cleared, so perform ammo adjustments
        # Consume Ammunition
        $game_party.lose_item(gather_ammo_item, gather_ammo_cost)
        # Display text
        text = sprintf(Vocab::ConsumeAmmo, @active_battler.name, gather_ammo_cost, gather_ammo_item.name)
        @message_window.add_instant_text(text)
      else
        # Failed check, go into defense mode
        text = sprintf(Vocab::NoAmmo, @active_battler.name, gather_ammo_item.name)
        @message_window.add_instant_text(text)
        @active_battler.action.kind = 0
        execute_action_guard
      end
      # Perform a check to see if Active_Battler is a enemy and has ammo
    elsif @active_battler.is_a?(Game_Enemy) && $data_enemies[@active_battler.enemy_id].note.include?(TysAmmoRequirements::Enemy_ammo_activate_string)
      # Now we have to isolate the interger in the 'Note' string of the enemies
      # and then store the interger in a new local value for future use.
      enemy_ammo_cost = TysAmmoRequirements::Enemy_skill_cost[@active_battler.action.skill_id]
      enemy_ammo_name = TysAmmoRequirements::Enemy_ammo_name[@active_battler.enemy_id]
      # Check to see if the enemy has enough ammo to attack
      if @enemy_ammo[@enemy_attack] >= enemy_ammo_cost
        # Check cleared, remove enemy ammo.
        text = sprintf(Vocab::EnemyUsedAmmo, @active_battler.name, enemy_ammo_name)
        @message_window.add_instant_text(text)
        @enemy_ammo[@enemy_attack] -= enemy_ammo_cost
      else
        # Check failed, put enemy in guard mode 
        text = sprintf(Vocab::EnemyNoAmmo, @active_battler.name, enemy_ammo_name)
        @message_window.add_instant_text(text)
        @active_battler.action.kind = 0
        execute_action_guard
      end
    end
  end
end


Ist wohl geklärt.

Closed.
MfG, Colo
« Letzte Änderung: August 03, 2009, 03:25:41 von Colonios »
KleX und Ich über Zombies
Spoiler for Hiden:
KleX:
aber findest du nicht, dass man manchmal, um eine illusion zu erschaffen die logik etwas nach hinten schieben muss?
z.B. bei zombiefilmen. da sind immer ca 100x mehr zombies, als in der stadt menschen gelebt haben. aber es wäre ja langweilig, wenn nach der hälfte des films keine zombies mehr da sind

Kiige:
weil Zombies Herdentiere sind
Zombies wandern aus städte aus, in denen kein leben mehr existiert

KleX:
herdentiere *lach* xD

 


 Bild des Monats

rooftop party

Views: 3682
By: papilion

 Umfrage

  • Wer soll das BdM gewinnen?
  • Dot Kandidat 1
  • 3 (25%)
  • Dot Kandidat 2
  • 1 (8%)
  • Dot Kandidat 3
  • 2 (16%)
  • Dot Kandidat 4
  • 0 (0%)
  • Dot Kandidat 5
  • 6 (50%)
  • Stimmen insgesamt: 12
  • View Topic

 Schnellsuche





SimplePortal 2.3.3 © 2008-2010, SimplePortal