Instance Items
This script introduces the concept of “instance items”. In order to understand what an instance item is, you need to first understand what a “template item” is.
All of your database items, weapons, and armors are called “template items”.
That is, they serve as templates for in-game items.
An instance item is simply an instance of a template. For example, you design weapon ID 1 in your database and call it a “Short Sword”. This is a template of a Short Sword; everytime you receive a Short Sword in-game, you receive a unique “instance” of this template. Two Short Swords in your inventory are treated as two individual entities that have nothing to do with each other besides both being based on the Short Sword template.
It is important to note that this script simply provides instance item functionality. Additional add-ons are required to provide various features such as equip levels, equip affixes, and so on.
There are several known issues with the script. I have discussed them at the bottom of this post. Read through them to see if they affect you, and some ways they can be resolved.
Download
Script: download here
Add-ons
A list of add-ons that add more functionality to your games. It will be updated continuously. You can have your script added to this list by leaving a comment.
- Item Affixes – add prefixes and suffixes to your equips
- Item Rarity – add colours to your equips based on rarity
- Selchar’s Equipment Level Base + Leveling by Exp
- Selchar’s Weapon Durability
- Selchar’s Equip Evolve By Exp
- Feldherren’s SnapDragon – turn actors into new equips!
Patches
- Patch for Yanfly’s Ace Equip Engine
- Patch for Falcao’s Mana Stones Enchantment
- Patch for Emerald’s Equipment Sets
Installation
In the script editor, place this script below Materials and above Main
You should place this below any equip-related scripts, such as my Core Equip Slots or Yanfly’s Ace Equip Engine.
Usage
This script is plug and play for the most part as I’ve set up some default values.
Instance Mode
You can determine what type of objects allow instances or not in the configuration by changing its “instance mode”. For example, you can disable instances for items so that they stack as normal.
These are the default values I have picked:
Items - false Weapons - true Armors - true
Currently, if instance mode is ON for that category of items, all items will be treated as instances.
Event Changes
The following event commands behave differently if instance mode is on.
When I say “item” I refer to weapons, armors, and items.
- When you gain an item using events, new instances will be added to the inventory.
- When you lose an item using events, it follows “template discard” rules. For example, if your event says to “lose 1 short sword”, then the engine will simply look for ANY instance item that is based on the short sword. The same applies to equips if you include equips.
- When you use the “change equipment” event command, the engine looks for the first instance of the specified equip.
Developers
This script serves as a framework for all instance items. Currently, it only supports item, weapon, and armor instances.
The goal is to allow developers to write their own scripts that require “unique” items very easily without having to worry about how to actually implement it.
This script is designed so that you only need to focus on two things
- The RPG module, which contains the template weapons, armors, and items.
- the InstanceManager module, which handles everything related to instances.
A simple script would first load note-tags from the RPG objects and store them with the templates. For example, suppose we want to give all instance weapons a random attack bonus. We start by defining the max possible bonus a weapon could receive.
class RPG::Weapon < RPG::EquipItem def attack_bonus 50 end end
Now, we make it so that whenever an instance weapon is created, a random bonus will be applied to its attack. The InstanceManager provides several “setup” methods available for you, depending on what kind of object you’re working with:
setup_equip_instance(obj) - use this for any equips (weapons or armors) setup_weapon_instance(obj) - use this only for weapons setup_armor_instance(obj) - use this only for armors setup_item_instance(obj) - use this only for items
Since our example is applying a random flat bonus to an instance weapon, we would alias the weapon setup method.
module InstanceManager class << self alias :th_random_weapon_bonus_setup_weapon_instance :setup_weapon_instance end def self.setup_weapon_instance(obj) template_obj = get_template(obj) th_random_weapon_bonus_setup_weapon_instance(obj) obj.params[2] += rand(template_obj.attack_bonus) end end end
Note the use of the get_template
method in the setup. obj
is an instance weapon that we are creating.Our data is stored with the template weapon, so we need to get it first before we can use it. After you have your template, you can easily get the data you need to apply to your instance object.
And that’s it! Your instance weapon now has a random attack bonus. You can verify this by adding the same weapon to your inventory multiple times and checking their parameters in the equip menu.
This is a very simple example, but its goal is to demonstrate how to modify your instance objects. The rest of the game will just see it as another item or equip.
Known Issues
There may be a few issues that will occur due to the way the items are stored. If you find more issues, you can report them on my issue tracker.
is there a way to make this compatible with Falcao Pearl ABS? when i use the item instance script with the abs script “tools” wont work on objects that have note-tag requirements. i’m making a survival rpg and i really need to get the unique items durability working.
the game works fine without the item instances, example use a pick to break rocks, scythe to cut through tall grass. but when i add the item instance code none of the tools work..
it’s like they aren’t part of the database at all anymore(not sure if that’s the point of this script or not) like like my stone ax ID is 2 in my weapon list but when i use it i will not work unless its a monster or object that doesn’t have this note-tag Enemy Kill With Weapon = a,b,c where a,b,c is the weapon ID in the database in my case it would be Enemy Kill With Weapon = 2(my stone ax)
like i said it works fine without item instance but i really would like to have durability be a thing, i a huge fan of games like diablo, dark-souls and survival games where you have to watch your hunger, sleep or any type of aliments. any help would be appreciated
Hey Hime, would it be possible to make a patch that would allow for the use of notetags to make certain things not follow the instance items behavior? Like could I designate something like runes to stack with a notetag or something?
I’m just getting back into RPG maker vx ace and understand that not many people still use it so I’d understand it if you’re not interested in helping.
Hey Hime, I’ve been using this script for a while and so far I love it! I have run into one problem, however. When this script is paired up with Kread-Ex’s Asagi Gun License script, some odd behavior occurs.
Namely, the problem I have is that, upon equipping ammunition to a character, only 1 piece of ammunition is displayed on said character. This, I assume, is due to the change in how weapons stack with your script. In addition, skills that require ammunition fail to work altogether, as they cannot be used even when ammo is equipped.
One possible work around may be to use notetags to toggle whether certain items can stack or not? I’m new to ruby so I don’t know if that is a valid work around or if that’s even easy to do, but if it isn’t horrible to fix, could you see if a patch is possible?
Thanks ahead of time,
Evstellar
Sorry for so soon of an update, but perhaps it may be easier to just find a way for the ammo script to count every instance of the ammo items?
Is it possible to designate an item as the ammo instead of a weapon?
No, not in that script at least. One designates a weapon as ammo so that it can be equipped and used. I simply like the strategic aspect of having to select an ammo type ahead of time and being locked into said choice.
is there a way to have this script combined with the level up script give weapons and armor skills upon level up? That’s what I was really hoping to get out of these kind of scripts but I’m not a scripter. I do love this script though. Perfect for upgrading weapons.
What level-up script?
Well now I can’t find it but it was a script that let your weapon learn skills as they leveled up. Like if you had a Fire Sword it could look like
level 2 learns Fire Slash, level 5 learns Fireball, etc.
Though I’m sure that would be quite complicated to make.
Also sorry for really late reply. I thought it would email me when/if someone replied.
Was it one of Yami’s scripts that allowed you to “equip” skills to your weapons?
hm. could have been I suppose. I don’t really use Yami’s scripts, but I could’ve stumbled upon it. Sorry I can’t remember. I’ve been searching through scripts and forums looking for mini game ideas. My brain is frazzled.
also now I have an issue regarding this line at the end of a fight.
item = actor.equips.find {|obj| obj && obj.template_id == item.template_id
Do you mean the game crashes? See if there’s a compatibility issue with another script.
well now I think I’ve figured it out. I was trying to remove equipment from the characters via an event, but it didn’t work right and after the first battle after that i got that error. But, when I used the event to unequip the weapons and then remove them from the inventory I didn’t get the error again.
I’m having trouble setting things up to be honest i don’t know anything about scripting
I hope you or someone could help me.
Every time i level up my character i get this error
Name error occurred
uninitialized constant TH_Instance @note =~ TH_Instance::Equip::Ext_Exp_Curve_Regex ? @exp_curve = $1 : @exp_curve = TH_Instance::Equip::Default_Exp_Curve if @exp_curve.nil?
@exp_curve. It’s Line 84 of the Instance Equip Leveling by Exp Script
i don’t know what caused it… i only have Yanfly’s Scripts, Instance Equip Leveling by Exp Ver. 1.03 and it’s prerequisites installed
That’s strange. I didn’t write the script so I can’t be certain what might be the issue, but usually uninitialized constant means you didn’t install a pre-requisite. TH_Instance is probably defined somewhere in one of the pre-reqs. Maybe you can list what those pre-reqs you’ve installed are.
For those who want to use Hime’s instance items and Kread-Ex’s runic enchantment together. All you have to do is place Kread-EX’s traits namer and runic enchantment below Hime’s instance items and all scripts that affect instance items.
You do not need Kread-EX’s individual equipmennt as long as you have instance items. I hope this helps anyone that wants to use instance items plus runic enchantment.
Thanks for the note!
Hi Hime, it’s not the first time that I thank you for all your scripts! Thanks you… again! 😀
There is an issue of this script when i’m using also DC2 Weapons script. To understand better this problem i suggest you to see this my topic when I explain with a video 🙂 http://forums.rpgmakerweb.com/index.php?/topic/41214-ace-compatibility-between-yanfly-equip-engine-instance-item-new-error/#entry408771
I have posted my response to the forum topic that is linked.
I have a lot of items (Not armor, not weapons) I know if items=true on the Script, all Items will be turns instance items. But I want turn only one item… What I do?
for example. A herb(item) if I gain two herbs more I want to have four places on my inventory, but if I gain bullets(item) and gain more I want to have only one place.
Hey excuseme for my english, this is not my languaje! Thanks!
Unfortunately, instances are applied to all items in a single category (eg: all items, all weapons, or all armors)
Is this something that could be done with a few small edits(relatively) or does it require a complete overhaul? I’m trying to set this up for a friend, but I can’t seem to figure out how to make the game not think that an item is instanced. Is it possible or should I just give up since rewriting the hole thing would mess with the durability script he is using?
I think it should be possible with some edits. You just need to make it so that the item will tell you whether it should be instance or not, and then make sure that you’re handling the item properly. I couldn’t think of a way to do it cleanly though.
I know it’s an old message but hopefully you’re still around;
I noticed a “Unique Items” script by Eshra, which is somewhat based off this script (it actually needs one of your scripts to work), but it doesn’t work quite as nice and smooth (for me at least), which uses a notes tag to determine which Item need to create an instance; I was thinking, could you kinda “reverse” that and create a tag for items in this script?
ps: I’m actually willing to commission this edit, if you can do it.
Tsukihime,
Do you know or have any script with the same function of this, but for Skills?
In order to make “Instance Skills”?
No, I was thinking of making instance skills but wasn’t sure what would be a good way to implement it.
If you do it, please, i’ll be really glad to know.
I’m thinking about a strategy way of battle through skills instead of only attack/magic based characters. So it will be really good to costumize with grathnode (https://grimoirecastle.wordpress.com/rgss3-scripts/gameplay-scripts/grathnode-install) and something else. If you do it, i’ll be forever thankful to you. xD
Great script, but a have a problem using your Actor creation system. After I create the char and confirm, I get this error:
Script “instance items” line 500: NoMethodError ocurred.
undefined method “size” for nil:NilClass.
Does this occur in a new project with only Actor Creation, Custom Database, and Instance Items?
I’m using various Yanfly scripts (Core,battle,more equips,), Item affixes and random affixes.
Does the error still occur with yanfly’s scripts commented out?
Work well without Yanfly’s scripts. I will try one by one to see
which causing conflict. Thanks for your time.
So, I wrote a script that makes use of Instance Items, if you want to add it to your list: Snapdragon, found here https://github.com/Feldherren/vxace-snapdragon.
I have not played Tactics Ogre but the mechanic sounds pretty cool. I’ve added it to the list.
How about inheriting features as well? For example if you use snapdragon on a “death knight” your weapon may have a certain chance of causing death.
Actually doable, as long as the equipment you link to that class has the feature already.
In this case, Death Knights could have their own version of the sword with the Atk State: Death (at whatever percentage) feature attached, or otherwise somehow cause instant death. An instance of that sword would be made, inherit name and stats from the unit, and take everything else from the base sword, instant death included.
That said, has to be on the base equipment item ahead of time. I’d have to copy someone’s implementation of defining features through parsed notebox strings to arbitrarily add features on to the base weapon. Certainly seems doable.
Hi, i want to use instance Item script with Falcao alchemy system, but the first one doesn’t run. When i click on menu > item, it appears this system error:
What error? Did you forget to post a link to picture?
I’m sorry, my fault.
Here it is:
http://i.imgur.com/r2WUx8w.png
Are you using an existing save file? This script does not support old save files.
🙂 it’s true 😀 Thanks!
Hello there! I have an issue with this script that I was hoping you could help with. I’m making a game using Falcao Pearl ABS Liquid v3, along with Selchar’s Equipment Level Base. It works, except whenever I equip or deequip a weapon, it then gets duplicated in my inventory. After a short time, I could have up to six or seven of the same weapon cluttering up the menu. However, when I de-equip and re-equip the weapon, the duplicates disappear again.
I understand other users have had similar problems in the past, but I was just hoping you could offer some insight. If it helps, I tried removing Selchar’s leveling scripts and just using Pearl ABS and Instance Items, and the duplication problem remained.
Any advice you could offer would be a great help. Thanks in advance!
Seems like an issue with Pearl ABS. I will need a demo with only Pearl ABS and instance items setup demonstrating the issue.
I’ve just emailed you the demo. I hope you can figure out what’s going on!
Not sure if you saw my email reply but I was unable to reproduce the issue and will require additional instructions.
I’m so sorry about that! I sort of forgot that my email existed there for a while. I’ve sent a reply with more detailed instructions, as I finally figured out exactly what does it on a consistent basis. Thanks for the help!
Hi! First, awesome job! This script help a lot, it’s possible to do a bunch of things with it! Second, would you mind make a compatibility patch? Because your script and Falcao’s script Mana Stones Enchantment are everything I’ve ever wanted to my project, but they don’t work well togheter :/ When I put them (no matter wich order they are), the enchantment scene shows as if there isn’t any socket slot. I’ve tested both scripts in an fresh project and i’m pretty sure it’s imcompatibility. Would you please, please make some patch or help me figure out a way to solve this problem?
Thanks in advice!
Almost forgot it, this is the script’s link: https://falcaorgss.wordpress.com/2012/10/20/falcao-mana-stones-enchantment/
Set up a new project and use the “Contact me” form to send me the link.
I would love to see a patch to make Falcao’s Mana Stones compatible at well. I’m messing with the code myself (I’m new to scripting this stuff), but I would love a “professional” fix!
Patch has been added to the download section. Refer to this post for info and video demo of the results.
Hi there I was wondering if you could help me a little bit, I’m using this script and I also have some flacao scripts installed. one of falcaos scripts is an action RPG system and you have to press a button on the map to go to a scene where you can equip weapons and armour and things. But my problem is every time I pick up something your script creates 2 versions of the item and was wondering if there is anything I can do? thanks in advance.
I’d have to see what that script is doing to determine how to address it.
Could you please make is so I could pick specific items to not be affected by this script instead of just categories? A simple note tag / comment would suffice. I love this system but it conflicts directly with “Instance Items.” I’ll even pay for the snippet!
What are you trying to do that requires only certain items to be instances?
Tools like hookshkot, bow to cut grass, falco’s interactive tools.
Sorry for double post. The problem is the template item doesn’t seem to be noticed by the ID. I know it is your script and falco’s that clash because in a new blank game his works but when I add your script it stops working.
Please send up a demo showing the issue. When a category doesn’t use instances, it will use the template ID. However, if those tools are set up as weapons or armors and then treated as items, then there may be issues.
This looks very useful… except for the fact that I cannot set specific armor pieces to be instanced. A quick look over the script and it seems like a simple matter to enable this functionality, and I plan to run a test later when I get a chance. Are there any known issues regarding this? Thanks.
Correct, either all armors are instances, or none are. I have not seen any reports.
How is this supposed to replace FP Inventory? It doesn’t seem to accomplish the same thing at all, and actor inventory still doesn’t work with any Limited Inventory scrips.
FP inventory provides instance items and some other item-related features. This script provides instance items and allows for other item-related features.
If actor inventory doesn’t work with other scripts then that’s because the other scripts don’t expect actors to have inventories.
I’m using the Pearl ABS System. After putting this script, every weapon and armor that i pick up, don’t appears in the pop up… I need a little help =S
What popup?
The pearl abs comes with a pop up script system. When an enemy drops an item, and you step into it, you pick up the item, and shows an pop up.
This is such a great script! Thanks!
But I have one question:
How can I display the item drop in a text message?
Like when you get an item there should appear a message "Fiery Axe gained" and it should depend on what affix the instance item got.
Is there a way to do that?
Ah and one more question:
Is it possible to change the item icon when getting a specific affix?
Like when you get a "Axe of Fire" the icon of the item should change to that icon what is selected for " of Fire"-suffix in database.
It is not built into the script, but it is not hard to write some logic to change the item's icon.
The message simply displays the name of the item, so you'll have to figure out a way to change the name before it is displayed.
Thanks for the fast reply 🙂
but since I'm a noob at scripting it is hard for me to write some logic to change the item's icon.
Also I'm using the random affix addon so I can't know which affix the item will get.
This script would be perfect if u helped me with those 2 things 🙂
You should ask on one of the forums to see if someone can help you.
I have a question; forgive me if this is noobish.
I want to use this script, and all its addons (affixes, rarities), but I want it so that only weapons you find in chests and off enemies are instance'd and affixed. So, like…you can buy an "Iron Axe" from a merchant in-town, and it will just be a standard Iron Axe. But, if you get an Iron Axe off an orc outside of town, it might be a "Mighty" Axe or an "Infernal" Axe. Maybe it's possible to turn off the script using script calls before a shop event, and turn it back on afterward? hmm.
By default no affixes are applied. You would need to install a script that will add affixes. If you already have one, then you will need to consult the author on how to have it only apply it only for specific cases.
Great script!
I'm wondering how can i make what i call 'instance-chains'. Let me explain:
Right now i have some equipment called the same but having different params and whatnot and also have different etype. So they're equippable in different slots.
But then based on some note-tags they're all linked.
When i give one of the items then linked ones are searched for and added aswell to the party. If you lose one of those items, you lose all the linked ones too. If you equip one in a slot then the linked dissapears until you unequip it.
The concept is that they act as if they were the same item but you were able to equip it in different slots.
But how can i do this with instances?
Because it's just not a matter of searching the first matching instance and adding/deleting it. As an example let's say i use equipment level system:
– I want that the 'linked-instances' shares the same level
– So if you remove one instance the linked ones that should be removed should be the one with the same exp as the removed one
I hope you can understand me with my broken english :/
The problem that you are trying to solve is possible without instance items, so you should first look for a script that will provide the linking functionality. Ideally, the linking script could be extended to provide support for instance attributes such as level, exp, or any other custom attributes that you've added to your project.
Thanks for your fast answer! ^^
The problem is that i need instance items.
I'm trying to make a system simillar to materia system from ff7 but instead of equipping the 'materias' to another equipment i want the materias itself be equiped as equipment. But they still have to be independent from each other in order to be able to level those up.
Without the instace items i already got the linked equipment but when i decided to integrate the instance items to be able to add the equipment leveling system i came to this forementioned problem.
Right now (without instance items)
(example names)
fire(etype=1) <==linked==> fire(etype2) etc
So if i equip fire(etype=1) i lose it but fire(etype2) too and such. And when i unequip it both items are returned. So they act as one only armor.
What i want (and i'm trying with no luck)
(example names)
fire(etype=1)(ins.=1) <==linked==> fire(etype2)(ins.=1) etc
fire(etype=1)(ins.=2) <==linked==> fire(etype2)(ins.=2) etc
So if i equip fire(etype=1)(ins.=1) i want to get rid of this one and the linked fire(etype2)(ins.=1) but leave untouched fire(etype=1)(ins.=2) and fire(etype2)(ins.=2)
This way i can implement levels and if fire(etype=X)(ins.=1) levels up then the rest of fire(etype=X)(ins.=1) can be leveled up aswell but leave the entire fire(etype=X)(ins.=2) with it's actual level
I don't know if this is clear enough (even for me it's now hard to understand xD)
Right now i'm trying modifying 'def gain_item' method to affect everything even the action of give or take an item to the party. So if an event gives me one 'materia' i get all the linked. But as i saed with no luck since using instance items.
You should raise it on the issue tracker and post code showing what you've done since you already have a working linking system.
Ok i will thanks. Let me prepare the explanation a bit better 🙂
The link is disable =\
The link has been updated.
For Instance Items
I was opening a chest with a 'Dagger' in it.
" Line 649: Nomethoderror occurred.
undefined mehtod '[]' for Nil:NilClass "
is what I get :(.
Line 644 – 654
#—————————————————————————–
# New. Adds the instance item to the appropriate list
#—————————————————————————–
def add_instance_item(item)
container = item_container(item.class)
container[item.template_id] ||= 0 < — Line 649
container[item.template_id] += 1
container[item.id] = 1
container_list = item_container_list(item)
container_list.push(item)
end
How is your chest set up?
Does it occur in a new project?
Just the script I wanted but… a question:
Is it possible to make some items stackables? and where if that's already possible where in the script is that?
Thanks in advance…
No, they're either instances or they're not.
I'm not sure whether this should go under Item Affixes or here, since it pertains to writing a new script using Instance Items, but the script would be rather similar to Item Affixes and is an issue I'd probably have with it, too.
So I'm looking to write a particular script to implement sacrificing actors to generate new weapons (or armour) with stats dependent on the sacrificed unit.
If you're familiar with Tactics Ogre, think 'Snapshot' or 'Snapdragon', depending on whether you're thinking of LUCT or TKOL. If you're not familiar with it, it's an item/spell that permanently turns the target (in Tactics Ogre, always the user) into a sword which inherits stuff from the user like its name or some of its stats.
Looking at existing scripts, it seems like one way to go about this is similar to your Item Affixes script, except with an actor instead of armours-as-prefixes/suffixes. This looks like it will work, but I'm running into issues working out how to actually make the equipment.
I mean, let's say I have a tag on a class (or actor, or enemy) that says 'when using snapdragon on an actor with this class (or actor, or enemy), use this weapon/armour as template for the snapdragon item'. Say battlers have a function 'snapdragon' that handles getting the tag, giving the party a copy of the equipment the snapdragon weapon/armour is based on as specified in the tag, removing the target from battle and/or the party, and anything else necessary.
What I'm having issues with is working out how to get the particular instance of the equipment that was just created, so I can add the sacrificed unit to it. How do I get that object?
I guess I'm basically asking 'how would I use set_prefix(equip, id) if I just wanted to give the player an item with a prefix from a chest?'
Or am I barking up the wrong tree and should I be doing something else instead?
You should make your request on the issue tracker. The comments section is unsuitable for discussion.
Okay, that seems to work perfectly. Thank you very much.
One last thing, and not a request for a patch; am I right in guessing this probably won't work with the event command to choose a Key Item, and even if so, certainly won't work with Kread-EX's 'More Item Choices' script?
If that's the case, how difficult do you think it would be for a relative-newcomer to scripting to write a patch? That is, modifying something that works with the normal inventory to instead work with inventory as implemented by Core: Inventory, Actor Inventory and (maybe? Not sure if it would be relevant) Instance Items.
That largely depends on how those scripts work. I've made it so that if you asked the party whether they have an item or not, it would check all the party members' inventories. Similarly, if you gain or lose an item, the leader would be the one that handles it.
If it doesn't work, then you'd have to go and figure out how it's trying to reference this data.
Okay. So long as it's not an unexpected issue. In this case Actor Inventory is actually a good substitute – previously I didn't want to dump character-specific equipment in the general inventory, but that's solved by the existence of Actor Inventory.
I don't know if this is intended, though: attempting to use the normal event-based force-equip command results in a similar error:
Instance Items:613:in 'find_instance_item' : undefined method `find' for nil:NilClass (NoMethodError)
from Instance Items:479:in 'change_equip'
from Game_Actor:223:in 'change_equip_by_id'
from Ace Equip Engine v1.06:732:in 'command_319'
from Game_Interpreter:197:in 'execute_command'
from Game_Interpreter:103:in 'run'
from Game_Interpreter:500:in 'command_117'
from Game_Interpreter:197:in 'execute_command'
from Game_Interpreter:103:in 'run'
from Game_Interpreter:60:in 'block in create_fiber'
Actor inventory will require a patch as well due to the way actors are searching for equips (they are checking their own inventory, not the party inventory which no longer exists).
The instance items script was written with the assumption that the party held the inventory, and therefore any scripts that change this would not be compatible with it.
I've updated the actor inventory page with a link to the patch (properly linked this time)
Okay, now your utility: change equip script is disagreeing with Instance Items?
Game_Interpreter:1411:in
eval' : undefined method
find' for nil:NilClass (NoMethodError)from Instance Items:479:in 'change_equip'
from Utility: Change Equip:102:in 'equip_armor_by_etype'
from (eval):1:in 'command_355'
from Game_Interpreter:1411:in 'eval'
from Game_Interpreter:1411:in 'command_355'
from Game_Interpreter:197:in 'execute_command'
from Game_Interpreter:103:in 'run'
from Game_Interpreter:500:in 'command_117'
from Game_Interpreter:197:in 'execute_command'
from Game_Interpreter:103:in 'run'
from Game_Interpreter:60:in 'block in create_fiber'
Sorry if this is getting annoying. I have a 'gift' for finding issues with stuff.
That was expected. Actors already have methods called "weapons" and "armors" which refers to their own equips, but the party uses the same names to refer to inventory stuff. Patches would be required for that and basically EVERY script that tries to access inventory because of the naming conflicts.
That utility script was written assuming the party held an inventory, not actors, so I would say that is not the right script for your project.
Has it updated? The version on Dropbox linked from Core: Inventory here hasn't updated since the July 27th 2013 version.
Here's the error I'm getting:
Instance Items patch:78:in
gain_item' : wrong number of arguments (3 for 2) (ArgumentError)
gain_item'from Actor Inventory:87:in
from Actor Inventory:153:in
gain_item'
trade_item_with_party'from Actor Inventory:165:in
from Game_Actor:243:in
block (2 levels) in release_unequippable_items'
each'from Game_Actor:241:in
from Game_Actor:241:in
each_with_index'
block in release_unequippable_items'from Game_Actor:241:in
from Game_Actor:239:in
loop'
release_unequippable_items'from Game_Actor:239:in
from Game_Actor:293:in
refresh'
init_equips'from Game_Actor:125:in
from Ace Equip Engine v1.06:537:in
init_equips'
init_equips'from Instance Items:454:in
from Game_Actor:44:in
setup'
setup'from Skills Replace Skills:28:in
from VE MP Level:446:in
setup'
initialize'from Game_Actor:27:in
from VE MP Level:439:in
initialize'
initialize'from Actor Inventory:113:in
from Game_Actors:20:in
new'
[]'from Game_Actors:20:in
from Game_Interpreter:1251:in
command_320'
execute_command'from Game_Interpreter:197:in
from Game_Interpreter:103:in
run'
command_117'from Game_Interpreter:500:in
from Game_Interpreter:197:in
execute_command'
run'from Game_Interpreter:103:in
from Game_Interpreter:60:in `block in create_fiber'
This isn't quite occurring immediately when I start the game (new game, for testing); the game has just about enough time to change a variable to set something visible before it runs into this error when normally the player would be naming a character. I'm not doing anything with items at this point.
I am always forgetting to copy scripts from RPG Maker into my text file. The script is now updated with the appropriate changes.
With the patch and instructions for script ordering, I seem to now be having issues with gain_item wanting two arguments (original behaviour?/instance items behaviour) and the version for Actor Inventory, which requires three arguments for dropping an item in a specific actor's inventory.
Update Core Inventory
Am I missing something? There's a line about 'this patch' on the Core Inventory post, but the patch doesn't seem to be there.
Forgot to link it. It's there now.
Hm. This should have been a reply to your reply to my post.
At any rate, no, I'm not loading a save game. I've always been starting a new game after adding any scripts.
Since the above post suggests a patch is required for compatibility between Instance Items and your Actor/Core inventory scripts, that's probably it.
Are you likely to write such a patch any time in the immediate future?
I can do it by the end of the week.
A patch was written for the Core Inventory script to support instance items. You can get it at the Core Inventory post under "Compatibility patches"
I started a new project and added your Core Inventory, Actor Inventory, Actor Inventory Screens, and Instance items ( in that order). When an item is added I get
Tsuki Instance:1199:in
add_instance_item' : undefined method
[]' for nil:NilClass (NoMethodError)I have tried putting the Instance items script above Actor Inventory and also above both Core Inventory and Actor Inventory. In that case I don't get a crash but the items are not instanced.
My question is are your Core Inventory and Actor Inventory scripts compatible with your Instance Items script?
No, a patch will be required for instance items to work with core inventory.
I appear to be having a few issues with this script, but I'm not sure what's causing it.
Of scripts that seem immediately relevant, I'm currently using Yanfly's Ace Equip Engine, Instance Items, Core – Inventory, Actor Inventory, in that order. I'm also using a lot of other scripts like GTBS, Kread-EX's Custom Weapon Formulas script, and so forth. Are there any known incompatibilities with this, beyond GTBS (which works with a patch)?
My first issue is that Instance Items does not appear to work. Everything still stacks. The order I'm placing scripts in currently is the only order that doesn't crash the game when trying to add items via event command, or doesn't cause attempting to equip items that should be equippable to fail silently – you can see the item in the equip screen, you can select and attempt to equip it, and nothing ends up in the slot. That isn't what's happening with the script in its current location.
Currently, it's just crashing the game when I try to equip anything by any means.
Instance Items:613:in
find_instance_item' : undefined method
find' for nil:NilClass (NoMethodError)from Instance Items:479:in
change_equip'
on_item_ok'from Scene_Equip:122:in
from Ace Equip Engine v1.06:1290:in
on_item_ok'
call'from Window_Selectable:212:in
from Window_Selectable:212:in
call_handler'
call_ok_handler'from Window_Selectable:331:in
from Window_Selectable:322:in
process_ok'
process_handling'from Window_Selectable:297:in
from Window_Selectable:276:in
update'
block in update_all_windows'from Scene_Base:95:in
from Scene_Base:93:in
each'
update_all_windows'from Scene_Base:93:in
from Scene_Base:49:in
update_basic'
update'from Scene_Base:41:in
from Scene_Base:14:in
main'
run'from SceneManager:23:in
from Main:25:in
block in <main>'
call'from Acezon - F12 reset fix:48:in
from Acezon – F12 reset fix:48:in `block in rgss_main'
Is it likely I've missed any essential part of setup, or could this be incompatibility with other things? I am using other scripts, and will be able to provided a full list if necessary, but any issue I've faced today has been related to Instance Items.
No, the only setup involved is determining whether something should be treated as instances or not. It could be due to compatibility issues. It could be that you are loading from a save game which originally didn't have instance items and therefore it's failing.
Anyone using Kread-Ex's Alchemical Synthesis script will find that synths don't apply to instancable items. This plugin fixes that issue. If there is an issue, reply to this here, unless Hime has a problem with it.
http://www.roguedeus.com/Stuff/RDeus%20-%20Synthesis%20Instances%20Plugin.rb
Posting questions about the particular plugin on the issue tracker would probably be easier to address.
Now works perfectly ^_^
thanks ^_^
thanks i’ll try the way you say.
only a Little question: i have to place at the end of the script or i have to replace something?
Just place it at the end.
Gaining instance items has been re-done so that it is simply adding or removing an object from a list. Counts are stored separately (using template ID’s again, but does not actually “gain” any templates).
Hi thanks for your beautiful script. I have a little question for you.
when i use conditional branch that require a armor or a weapon with this script doesn’t work anymore.
I belive it’s because the id of the istance weapon or armor it’s different from the id of the template used for the conditional branch.
how can i resolve this problem?
thanks and sorry for My bad English.
I don’t have a proper solution for this, but you can try this for now
https://github.com/Hime-Works/Requests/issues/118
The script crashes when you create a new weapon, newly added to weapon database file. The instance script doesn’t seems to be able to handle newly created items.
Also, it basically duplicate one item into two. One is the original, one is the instance item. I think you should add a method to remove the original item and keep the instance item.
Thanks!!
I don’t understand what you mean by “create a new weapon”. Do you mean when an event gives you a weapon? That works for me.
Yes, that’s the point of the script. It takes the original template, duplicates it, and then calls it an instance. If I remove the template (ie: the original), how do you expect to create more instances if the template has been removed?
Oh….. It is just that when you gain an item. The original item is still kept in your inventory while the script generate an instance item just like the original item.
When you use equipment leveling script, and trying to level up original item. The script would crash.
Sorry, I am not sure what you mean by “original” item. Are you talking about template items? If so, they should not appear in your inventory because my script has made it so that your inventory should only contain instance items.
When you gain an item, for example, from an event, you’re not supposed to lose another item. If you have a hand ax in your inventory, and you gain another hand ax, you will then have two hand axes.
I don’t know which equip leveling script you’re using, but if you’re using the one that selchar wrote, you should post a bug report in the appropriate thread. I cannot guarantee compatibility with anyone else’s instance items scripts.
I fixed the double duplication script by commenting our one of the line in your script.
Copy and paste from rpgmaker forum:
I don’t get why for your instance item script:
line 500 and 501:
th_instance_items_gain_item(new_item, 1, include_equip)
th_instance_items_gain_item(item_template, 1, include_equip)
Why keeping a copy of template item when instance item is already created? Since the new instance item already have the attribute of the template item. Wouldn’t it be better to just to remove the template item from even showing up?
How would you count items efficiently?
instance item is more useful for weapon/armor than for items. I think most of the people are going to use this script for weapon/armor customization than for item usages.
I mean, if someone wants to know how many short swords you have in your inventory, how would you determine that?
I guess not, because I commented out the part that keeps the template item.
But why is it even needed? I think having template item would cause more script incompatibility issues than benefit it brings.
I could store the count separately I suppose, independent of the template items/weapons/armors. I would have to overwrite more methods, but it means I don’t actually gain a template of the item.