Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Working with item names and name modifiers #88
Comments
|
It can get complicated working with multiple scripts that modify item names. Especially when they are continuously being updated(durability/item charges), or has the potential to be updated at any time(levels, and apparently your item affixes script). It wasn't easy to think of a way to combine my Level/Durability script names but I eventually managed. I even made an allowance for affixes, tho I was thinking they would be applied at item creation and not through a scriptcall. It will certainly get more complicated, but taking a look, I think the easiest solution would be to apply the level name suffix and durability name suffix at the end of your update_affix method if the appropriate script is detected. More or less the more scripts made that modify names, the trickier it can get, I agree with that. I'll see if there is anything that can be done with my own scripts as well, simply applying your method to mine when your script is detected should do the trick, but there's only 1 way to find out. |
|
I had a few problems with renaming with my leveling script(obviously), but managed to fix it. In my script I have the following method.
I was able to resolve my issues by making the modifications with the $imported hash, however it only works with this method in your script commented out.
I make my changes to @name, after grabbing it either from the template, or from in this instance @affix_name. Defining a method for name as you did has it's consequences where windows who reference item.name use the method, and not the @name instance variable. That's what I was able to figure out. |
|
Solution described here |
|
Instance Items has been updated to provide a If you ever need to re-build the name, call the |
Say you had several scripts that modify an equip's name.
My item affixes adds prefixes and suffixes.
http://himeworks.wordpress.com/2014/01/13/item-affixes/
Selchar's got a couple level and durability scripts that also modifies the item name to add a level indicator or a durability indicator.
This can easily result in messed up names.
For example, you might have something like
Shining Sword of Shining +3 (5/5)initially, but hen you change the suffix and maybe end up withShining Sword +3 (5/5) of ChaosI don't know if that's possible, but right now I don't think there's a standard way to write names, so the order in which name modifiers are added could be problematic...
There should probably be a way to define this order, so that your names look like
PREFIXBASENAMESUFFIXLEVELDURABILITYand so on. String formatitng might be useful here, so you could literally say you want
But how can that be made more extensible.