Weapon/Armor Randomization

Vlue

Talent Extraordinaire
Member
Joined
Mar 13, 2012
Messages
589
Reaction score
378
First Language
English
Primarily Uses
Updated the script so you can set item name color based on whatever affix was last applied. Rarity at a glance, woo woo.


Made possible by using the :color symbol when setting up your affixes, like...


:color => Color.new(0,255,0)


for green! Quick reference, it goes Color.new(r,g, B) where r,g,b are between 0-255


Grab the updated script and enjoy!
 

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
Just wanted to pop in really quick and say you are awesome sauce for making (and updating) this script. Even more so for making it work off monsters.

Thank you!
 

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
Question:

I ran into a odd bug, armor doesn't seem to save and disappears after the save file is loaded. Would this be something I'm doing?

Edit:

I'm using mostly Yanfly scripts and battle symphony.
 
Last edited by a moderator:

Vlue

Talent Extraordinaire
Member
Joined
Mar 13, 2012
Messages
589
Reaction score
378
First Language
English
Primarily Uses
Only thing I can see is... are you using some kind of savefile script? And if so.. linky, I'll take a look.
 

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
You know, I was racking my brain on to what possibly be causing this error and you got it in one shot. I am using a script that changes the appearance of the save file menu. Once I commented that out, your script started working perfectly again. So I guess that would bring me to this (and one other request) if possible.

~The name of the script is called EST Sukoden save/load and it is found here, is there something that can be done to get each other to play nice?

~Also is it possible to have this work with Yanfly's victory aftermath and display under the "victory spoiles" instead of the text box? No big deal really if you can't.

In any case thanks for find out and responding so quickly!
 
Last edited by a moderator:

Vlue

Talent Extraordinaire
Member
Joined
Mar 13, 2012
Messages
589
Reaction score
378
First Language
English
Primarily Uses
That script is written interestingly... well, it looks pretty anyways. Place my script below it and change line 343 of it from 

class Scene_Load

to

class Scene_SuikoLoad

As for the aftermath thingy... I'll look into it~ Provided I don't forget... remind me if I don't reply in a timely (or untimely) fashion.
 

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
Awesome and quick support for a script? -Check

Great attitude about helping other people -Check

Damn dood, is there anything you can't do? Your fix worked like a a charm btw, so thanks again for taking all this time to help us out!
 

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
Hey Sir Vlue!

Was just checking in to see if you used your super awesome chocolaty covered skills to find out a fix too Yanfly aftermath yet.
 

Vlue

Talent Extraordinaire
Member
Joined
Mar 13, 2012
Messages
589
Reaction score
378
First Language
English
Primarily Uses
Whops, knew there was a reason I said to remind me. What do you mean, like instead of the text box saying what items you want it go all ding an... wait no this isn't item popup, don't know why I thought it was.... Uhm.. what do you mean? It doesn't display the item names right under victory spoils? 
 

ShinGamix

DS Style 4Ever!
Veteran
Joined
Mar 18, 2012
Messages
3,905
Reaction score
451
First Language
April Fools
Primarily Uses
N/A
Now if I could just have it randomly name the item itself it would be perfect. but it's damn close now.
 

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
Hey there!

Sorry for the misunderstanding, hopefully I can clear it up! Both scripts actually talk to each other very well save for the loot menu. With victory aftermath, the loot rewarded looks like this. When yours and vicotry are combined, loot only appears in a text box now (where the people talk). I was just wondering if it would be possible to restore what is pictured.

Thanks dood!
 

Vlue

Talent Extraordinaire
Member
Joined
Mar 13, 2012
Messages
589
Reaction score
378
First Language
English
Primarily Uses
Aye, that was easy as I thought (after knowing what it really was you needed!)

Just put this at the bottom of my script (which should stay below Aftermath)

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
 

lucofthewind

Suikoden FanBoy
Veteran
Joined
Dec 11, 2012
Messages
213
Reaction score
17
First Language
English
Primarily Uses
Sir,

I have heard of the legendary politeness of our friends up North, and you sir have exceeded it. Thank you so much man, it means a lot!
 

TheBrogrammer

Arving Startist
Veteran
Joined
Apr 2, 2012
Messages
235
Reaction score
25
First Language
English
Primarily Uses
Getting a little problem when I try and apply a feature to a weapon.  Here's what I'm adding to the script:

6 => { :name => "Frosty ",
:SatkP => 30,
:features => 31, 4, 0},
And the error message I get is this:

Script 'Weapon/Armor Randomizer' line 129: SyntaxError occured.

unexpected ',', expecting tASSOC
:features => 31, 4, 0},
Am I doing something wrong?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
I think this:

:features => 31, 4, 0}

should be

:features => [31, 4, 0]}
 
Last edited by a moderator:

Fernyfer775

Veteran
Veteran
Joined
Oct 6, 2013
Messages
1,317
Reaction score
818
First Language
English
Hi there!

First of all, I wanted to say you are AMAZING!

This script is so awesome!

I was just wondering though, if this is at all compatible with:

"Coelocanth's item crafting system" -- http://rpgmaker.net/scripts/319/

Is there a way to make that script, and your script work together?

Thanks! :D
 

Vlue

Talent Extraordinaire
Member
Joined
Mar 13, 2012
Messages
589
Reaction score
378
First Language
English
Primarily Uses
Try replacing line 629 of that script “$game_party.gain_item(item, 1)” with these new lines:


$game_party.add_weapon(item.id, 1) if item.is_a?(RPG::Weapon)


$game_party.add_armor(item.id, 1) if item.is_a?(RPG::Armor)


$game_party.add_item(item, 1) if item.is_a?(RPG::Item)
 

Allerka

Veteran
Veteran
Joined
Dec 31, 2012
Messages
289
Reaction score
71
First Language
English
Primarily Uses
Hey Vlue, this script is frigging amazing, and you will absolutely get a copy of my game for free when it's complete if I keep using it. Everything seems to be working great thus far, and I'm trying to get a vastly more extensive affix database setup.

In the meantime, though, a couple things.

1: This is more just a question of how the script the works, as far as assigning an affix. In the notes for a given weapon/armor, we throw in the tags for each affix we want to add, along with the "odds" of it. Obviously, we could add a whole bunch of affixes that add up to way higher than 100%, so how does it decide? Even if an affix has a rarity of 100 (i.e. 100% chance), it might not get picked if there's other affixes listed. Would it be best to think of it like a lottery system, and the rarity is the number of "tickets" placed in the pool the system draws from (not counting all the "nothing" tickets that might get put in, too)? I just wanna make sure I have a comprehensive grasp of how this works so I can fine-tune the rarity on prefixes properly.

2: Is there any way to make it so that weapons/armor purchased from a shop be randomized as well? I see that currently this system doesn't apply and anything purchased is stock (unless I just happened to buy 60 hand axes and NONE of them got an affix :p ). Although, this does give me an idea for a psuedo-crafting system, i.e. you talk to a blacksmith or something, give him a stock item (plus crafting materials?), and he gives you back a randomized item. Think that might be something doable?

Thanks!

EDIT: Actually, further testing has shown that the percentage-based stats boosts don't seem to be working, other than attack power. For example:

            14 => { :name => "Sturdy ",

                   :SdefP => 5,

                   :SpriceP => 10,},

Is one of my entries. The item should boost the character's DEF by 5%, correct? But if I go to the equipment screen, there's no visible change to the stats (It looks like, say, "20 -> 20" on the equipment screen). The price change takes effect, but not the stat change. Not sure if I'm doing something wrong, but since I want all my affixes to basically be percentage-based (as opposed to flat buffs/debuffs), this is fairly important, heh. Any thoughts?
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
At first look, it seems like it checks for all affixes and try to apply them one by one... but it seems like once it gets 1 affix done, it stops checking the others... 

For example:

<affix1 50>

<affix2 50>

<affix3 100>

it checks for affix1 first, if it doesn't get picked it proceeds to affix2, if it doesn't get picked too it proceeds to affix3... 

so It's not the same as a lottery ticket chance...

for your problem with the bonus, since it's quite small (5% of 20 is supposedly 1), but the game might be rounding it down to 0 for some reason... try it on higher values of base defense...

@Vlue: I think it's better to let it have multiple affixes... that way you stay true to the rarity being the actual percent of having the affix... 

Else you might wanna just change it into an affix pool, where the user adds the possible affixes and their "weight"... 

ex:

<affix1 1>

<affix2 2>

So this means to add affix1 once to the pool, and affix2 twice... then you just pick a random affix from that pool... this way we know when we set-up that affix1 has a real 1/3 chance to be picked while affix2 has 2/3 chance...

but doing so, we should also be able to add a "blank" affix so that if we can have the chance of not having an affix

But as you see, working with a pool is more complicated than just allowing multiple affixes to be applied which is just removing the break command from the methods like this one:

break if add_affix(item, $~[1].to_i, false) if rand(100) < $2.to_iso it will be

Code:
add_affix(item, $~[1].to_i, false) if rand(100) < $2.to_i
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 1, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,072
Members
137,578
Latest member
JamesLightning
Top