Weapon/Armor Randomization

I haven't ever looked into it, but if you link me the script I can take a look some time.
Yanfly's is at http://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/steal-item/
Try... putting this snippet below both scripts.

Spoiler
Code:
class Scene_Battle < Scene_Base  def stolen_item_text(target)    stolen_item = target.result.stolen_item    target.remove_stealable_item(stolen_item)    case stolen_item.kind    when 1 # Item      YEA::STEAL::STEAL_ITEM_SFX.play      item = $data_items[stolen_item.data_id]      $game_party.add_item(item.id,1)    when 2 # Weapon      YEA::STEAL::STEAL_WEAPON_SFX.play      item = $data_weapons[stolen_item.data_id]      $game_party.add_weapon(item.id,1)    when 3 # Armour      YEA::STEAL::STEAL_ARMOUR_SFX.play      item = $data_armors[stolen_item.data_id]      $game_party.add_armor(item.id,1)    when 4 # Gold      YEA::STEAL::STEAL_GOLD_SFX.play      $game_party.gain_gold(stolen_item.data_id)      fmt = "\ei[%d]%s%s"      value = stolen_item.data_id.group      return sprintf(fmt, Icon.steal_gold, value, Vocab.currency_unit)    end    text = sprintf("\ei[%d]%s", item.icon_index, item.name)    return text  endend
Awesome! works just dandy in initial testing, you sir are genius!! 😀
I can't seem to figure out this error message:

 error.bmp
di you tested it on a new game or a loaded game? if it's a loaded game, try it on a new game... these scripts are not friendly to saved games made before they were implemented...


else you might have not set-up the rarities correctly
Well, idk what I did to mess it up, but I just re-downloaded the script. Working fine now. Thanks for the help tho 🙂
Ahh here's another attractive feature perhaps you could add, much like the animation id....do you think it would be all too difficult to change the weapon icon if you get a prefix like say "Flaming" and well you have an iconset with a nice icon to use.

Since i'm using Battle Symphony it would be cool for a flaming weapon icon to be used when your character swings his/her weapon.
I'm not certain this works with mob drops using the XAS Hero Scripts.

This is the code that processes drops.  Is there a simple solution for this?

#===============================================================================
# ■ XAS_BA_Item_Drop
#==============================================================================
module XAS_BA_ItemDrop
 
  #--------------------------------------------------------------------------
  # ● Defeat Process
  #--------------------------------------------------------------------------               
  def make_treasure(enemy)  
      treasure = nil      
      return unless $game_player.passable?(self.x,self.y,0)
      for di in enemy.drop_items
           next if di.kind == 0
           next if rand(di.denominator) != 0
           if di.kind == 1
              treasure = $data_items[di.data_id]
              tr_id = treasure.id
           elsif di.kind == 2
              treasure = $data_weapons[di.data_id]
              tr_id = treasure.id
           elsif di.kind == 3
              treasure = $data_armors[di.data_id]
              tr_id = treasure.id
           end
           break if treasure != nil
       end   
       if treasure != nil
          command = RPG::MoveCommand.new
          command.code = 14
          command.parameters = [0,0]
          route = RPG::MoveRoute.new
          route.repeat = false
          route.list = [command, RPG::MoveCommand.new]         
          page = RPG::Event:😛age.new
          page.move_type = 3
          page.move_route = route
          page.move_frequency = 6
          page.priority_type = 1
          page.trigger = 1
          page.through = true
          event = RPG::Event.new(self.x, self.y)
          event.pages =
          event = RPG::Event.new(self.x, self.y)
          token = Token_Event.new($game_map.map_id, event)
          token.icon_name = treasure.icon_index
          token.treasure = [di.kind,tr_id]
          token.treasure_time = 120 + XAS_BA::TREASURE_ERASE_TIME * 60
          token.jump_high(0,0,20)
          token.force_update = true
          token.move_speed = 6
          $game_map.add_token(token)
       end  
  end  
end

#===============================================================================
# ■ Game Event
#===============================================================================
class Game_Event < Game_Character
  include XAS_BA_ItemDrop
 
  #--------------------------------------------------------------------------
  # ● Update Treasure Duration
  #--------------------------------------------------------------------------               
  def update_treasure_duration
      return if @treasure_time == 0
      @treasure_time -= 1
      self.erase if @treasure_time == 0
  end
 
end
Ahh here's another attractive feature perhaps you could add, much like the animation id....do you think it would be all too difficult to change the weapon icon if you get a prefix like say "Flaming" and well you have an iconset with a nice icon to use.

Since i'm using Battle Symphony it would be cool for a flaming weapon icon to be used when your character swings his/her weapon.
That'd be pretty easy. Consider it done eventually!

I'm not certain this works with mob drops using the XAS Hero Scripts.

This is the code that processes drops.  Is there a simple solution for this?
There's nothing in that portion that gives the item to the party. I can take a look if you can link the script.
Perhaps I'm just overlooking it, but how exactly do you differentiate which is a prefix and which is a suffix? The demo has them under one list, is is simple how they're named?
Perhaps I'm just overlooking it, but how exactly do you differentiate which is a prefix and which is a suffix? The demo has them under one list, is is simple how they're named?
You set it in the notes for the item. For example, affix 1 in the script might say "cracked", so you set it as a prefix in the notes. You can set it as a suffix if you want, but it would come out as "Short Sword Cracked" instead of "Cracked Short Sword" for example. Same deal with suffixes, you set it to say "of flaming" or whatever, and set it as a suffix in the notes. Otherwise you get a "of Flaming Short Sword" if you set it as a prefix.
the list is general for all fixes... you differentiate them using the notetags I believe...
Thanks guys!
Okay, So I'm having problems and I don;t know if its a noob error, or one of yanfly's scripts getting in the way.

I have it set to <PREFIX1 100> So it should always give this item the prefix right? Well it doesn't I think I know why but I'm not 100% sure.

I use Yanfly's Extra Drops, But I have used the normal way to add items and the Extra Drops way, neither one of them work.

I also use her: Victory AfterMath, Which shouldn't effect that, I think. I also have randomized equipment false to test this situation, do I need it to true? If you can;t see a reason why it still wouldn;t work, I'll list all the scripts I am using of hers.

EDIT:

When I buy it from the shop now cause I have that enable I get:

RKkVPRX.png


EDIT2:

Okay so I actually need to do the script calls if I want to have monsters drop the stuff? Do you think you could have it, or modify both yanfly's and your script so where her <drop W1: y%> To where it'll call that script if it get "chosen".

Because I plan to have the levels mean almost nothing, it would be up to the items you get to progress. Or something like that anyways. If you could look at it to see if it would be too much work or not. If it is don't worry about it. I just would like to know if I could make those two scripts compatible effectively.

Also, Wonderful script Vlue, wish I wasn't such a noob and knew how to use it properly. 

EDIT3: Actually using the script to give it to myself through an NPc 9Like in your demo) Is making it do the same thing, except on this line instead: eval(script) (1411)

EDIT4: Well I got the script and the normal drops working again, all I had to do was re-download the script, I must have accidentally made a change I wasn't supposed to. But still having the problem with the drop extra note from yanfly it doesn't want to seem to work with it, it just gives me a normal hand axe.

<drop w1: 100%> Gives me a normal handaxe.

I even tried this: draop w"add_weapon(1,1)": 100% I knew that wouldn;t work but I tried it anyways lol. Do you think there is a way around this without actually editing the code?

Edit again lol:

Okay so the normal way doesn't work. Making the enemy drop a hand axe without the notetag. Perhaps its yanflys equip engine or maybe menu?

Edit againx2: It was victoy aftermath, I don't know what is doing it but you could please check for me?

Here is the link: http://yanflychannel.wordpress.com/rmvxa/battle-scripts/victory-aftermath/
error2.bmp

If you set POOL_RARITY = true and use notetag <ATK 10> you get an error message when that item drops.

EDIT: Also, if you have POOL_RARITY = true and only put Prefixes in your notebox, you get a similar error on line 679.

EDIT#2: In a brand new game with only this unaltered script installed, I was unable to get the basic notetags to work at all.
Okay, So I'm having problems and I don;t know if its a noob error, or one of yanfly's scripts getting in the way.


I have it set to <PREFIX1 100> So it should always give this item the prefix right? Well it doesn't I think I know why but I'm not 100% sure.


I use Yanfly's Extra Drops, But I have used the normal way to add items and the Extra Drops way, neither one of them work.


I also use her: Victory AfterMath, Which shouldn't effect that, I think. I also have randomized equipment false to test this situation, do I need it to true? If you can;t see a reason why it still wouldn;t work, I'll list all the scripts I am using of hers.


Edit againx2: It was victoy aftermath, I don't know what is doing it but you could please check for me?


Here is the link: http://yanflychannel.wordpress.com/rmvxa/battle-scripts/victory-aftermath/
Using that script, I still don't have any problems getting the items to randomize correctly. What else could have caused it?

attachicon.gif
error2.bmp


If you set POOL_RARITY = true and use notetag <ATK 10> you get an error message when that item drops.


EDIT: Also, if you have POOL_RARITY = true and only put Prefixes in your notebox, you get a similar error on line 679.


EDIT#2: In a brand new game with only this unaltered script installed, I was unable to get the basic notetags to work at all.
Boo, I never accounted for pool rarity usage when there was no affixes to work with. It has been fixed up on the pastebin now!


Also added was the ability to have affixes change the icon of the item using :icon
If I put the W/A Script after aftermath I was able to produce the randomness of it. However it doesn't show it in her victory spoils its just a chat window.

Also I sent you an email, in there it is better detailed of what I would like and if its possible. Theres a few things I'd llike you to look at, I can copy/paster it here instead if you wish.

EDIT: I just tested it a few times. Here is what happens:

zKsyTPg.png


And then it total skips over the Victory Spoils Scene. Did you get it to work 100% or does yours do the same thing? If yours works just fine, would you mid telling me where you put your script relative to where it would be in-between yanfly's Scripts? I can create a quick demo for you to show you what I'm doing script wise.

Also another note: Is it possible for you to a add a option to your sleek popups to support your W/A Random? I would like to have it pop up when I'm using the script call in chests and everything else. Lol
Thanks! Vlue the man!
If I put the W/A Script after aftermath I was able to produce the randomness of it. However it doesn't show it in her victory spoils its just a chat window.

Also I sent you an email, in there it is better detailed of what I would like and if its possible. Theres a few things I'd llike you to look at, I can copy/paster it here instead if you wish.

EDIT: I just tested it a few times. Here is what happens:

And then it total skips over the Victory Spoils Scene. Did you get it to work 100% or does yours do the same thing? If yours works just fine, would you mid telling me where you put your script relative to where it would be in-between yanfly's Scripts? I can create a quick demo for you to show you what I'm doing script wise.

Also another note: Is it possible for you to a add a option to your sleek popups to support your W/A Random? I would like to have it pop up when I'm using the script call in chests and everything else. Lol
I thought you said it wasn't working all together, not just not working with Aftermath! I already a snippet for compatibility there on uh... page 2.

It goes W/A, Aftermath, Fix

Code:
module BattleManager  def self.gain_drop_items    drops = []    $game_troop.make_drop_items.each do |item|      if RANDOM_ENEMY_DROPS        if item.is_a?(RPG::Weapon)          item = $game_party.add_weapon(item.id, 1)        elsif item.is_a?(RPG::Armor)          item = $game_party.add_armor(item.id, 1)        else          $game_party.gain_item(item, 1)        end      else        $game_party.gain_item(item, 1)      end      drops.push(item)    end    SceneManager.scene.show_victory_spoils($game_troop.gold_total, drops)    set_victory_text(@victory_actor, :drops)    wait_for_message  endend
As for the other thing, that came with the update earlier today. There's an option (false by default (at least now it is)) that makes the event commands trigger a popup.

Original thread: https://forums.rpgmakerweb.com/threads/weapon-armor-randomization.14771/