Creating a standard instance and a unique instance of the same item

Started by wuggles57, December 16, 2013, 12:21:19 pm

Previous topic - Next topic

wuggles57

I use rpg maker vx ace

OK so I,m using two scripts to make weapons that have enchantments - note the scripts are 100% working they aren't the cause of the problem.
here they are:

http://forums.rpgmakerweb.com/index.php?/topic/7431-ses-instance-items-v13-february-17th-bugfix-for-anti-bloat-bugfix-for-main-script/ (a script that lets you take <unique> into note-tags to make items unique)
http://grimoirecastle.wordpress.com/rgss3-scripts/gameplay-scripts/runic-enchantment/ (a script that allows you to make a amour that will carry all traits over to the things it enchants)

To demonstrate the problem Im going to use the example of a hand ax a default item that Eric starts with in a new project.
If I just enchant a Hand ax by default every single Hand ax in the game will be enchanted because of the single instance.
If i make the Hand Ax unique the inventory will be extremely cluttered because everything can only be in a stack of 1.

I want a item that has any combination of runes to be unique and the just the item itself to be a general/shared instance and to be able to switch between the two.

I have very little coding experience and if it requires a whole lot of code I may just commission it because it really bothers me.
you can find a better description of the problem here with pictures because i don't know how to put pics on this site:

http://forums.rpgmakerweb.com/index.php?/topic/21017-modifying-an-items-instance-to-have-a-general-and-unquie-versions/


It also has been brought to my attention that i could just make a extra item for every combination of rune per wep/Armour but i would like to counter with 100 weps and armor and 50 runes that requires making 101,700,480,000 additional database entries  which is longer than the span of a human life if i could make a page/second so that won't work i have to find a way to manipulate the instances.

KK20

Unfortunately, we are mainly a community of XP users. I would look into it more if this wasn't VX Ace. It would probably have to look along the lines of this (this is just pseudocode):

class Weapon
 def equip_rune(rune_id)
    if self.runes.size == 0
     new_weapon = self.clone
     new_weapon.runes.push(rune_id)
     $database_weapons.push(new_weapon)
     $game_party.remove_weapon(self)
     $game_party.add_weapon(new_weapon)
    else
      self.runes.push(rune_id)
    end
 end

 def remove_rune(rune_id)
   return if self.runes.size == 0
   self.runes.delete(rune_id)
   if self.runes.size == 0
     $game_party.remove_weapon(self)
     $game_party.add_weapon($database_weapons[self.id])
     $database_weapons.delete(self)
   end
 end
end

I noticed your topic is fairly new on the other forums. I'd give it some time first and see what others respond with. Besides, you're better off getting an answer there than here.
   

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!