• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Scripting question (Duplicating existing item)

Minous

Well-known member
I am working on creating an alternate option for several class features, smite being the first on my list.

Is it possible to provide the user with a drop down of existing weapons, and then create a duplicate of whatever is chosen to then further modify the duplicate?

I was hoping to create adjustments for different class/feature abilities for easy printing.
 
Not a duplicate, exactly.

I can think of two ways to go about it (if I understand what you're going for), and which to use probably depends on how wide your choice of weapons is.

1: If it's a fairly narrow list, you could create an array which listed each valid weapon choice in a different row, then bootstrap each of those weapons with a condition that the ability select its corresponding row. Each of the bootstraps should have a Custom tag marking it as the weapon added by your new ability, so that other scripts can find the correct weapon and make whatever modifications you need.

2: If it's a big list you'll probably have to rely on the user to add the weapon itself, and then select the weapon you want to benefit using a chooser on the ability. In this method, you don't need to Custom tag it, because you can just transition from the chooser to the chosen directly. The drawback is that if the user removes the weapon you picked, there isn't a way to preserve your choice, and you'll be prompted to choose again.
 
My hope was to give a drop down of gear currently on the character.

So player adds adjustment, drop down of all weapons currently on the character populates, player selects their +1 cold iron battleaxe the script then should create a new version of the +1 cold iron battleaxe that I can then apply modifiers to including adjusting the title. The end result would be having two weapons on the character a +1 cold iron battleaxe and +1 cold iron battleaxe (Smiting) for example.
 
That's not something that you could do, although I think just toggling the adjustment on and off would handle things decently for comparing the two.
 
That's not something that you could do, although I think just toggling the adjustment on and off would handle things decently for comparing the two.

crap, figured that idea was too easy. Guess Ill have to stick doing it the hard way (Manually having two of each weapon)
 
My hope was to give a drop down of gear currently on the character.

So player adds adjustment, drop down of all weapons currently on the character populates, player selects their +1 cold iron battleaxe the script then should create a new version of the +1 cold iron battleaxe that I can then apply modifiers to including adjusting the title. The end result would be having two weapons on the character a +1 cold iron battleaxe and +1 cold iron battleaxe (Smiting) for example.
Thinking about this I do see a way but it will be a good amount of scripting. What you could do is have a Helper Weapon bootstrapped to the adjustment that has NO values (no tags no fields setup). Then pull all the values & tags from the selected weapon (ie +1 cold iron battleaxe) and push them to the Helper Weapon.

Getting the correct timing for all the different values/tags is going to be fun. I see some tags/values needing to be set very early and other will need to be set very late. But then you could have a smiting version and a normal weapon.
 
Thinking about this I do see a way but it will be a good amount of scripting. What you could do is have a Helper Weapon bootstrapped to the adjustment that has NO values (no tags no fields setup). Then pull all the values & tags from the selected weapon (ie +1 cold iron battleaxe) and push them to the Helper Weapon.

Getting the correct timing for all the different values/tags is going to be fun. I see some tags/values needing to be set very early and other will need to be set very late. But then you could have a smiting version and a normal weapon.

Kind of like how the cloned spell pick works? Ech, maybe, but like you said prone to extreme fiddlyness.
 
SC, I know I am going to regret asking this, but can you give a pointer on adding a helper weapon, and setting values on that specific copy of the helper weapon?

Ive not delved into that area much myself yet.
 
Kind of like how the cloned spell pick works? Ech, maybe, but like you said prone to extreme fiddlyness.
True. I should have added to get it work 100% correctly is going to take allot of testing (I assume several hours worth).

SC, I know I am going to regret asking this, but can you give a pointer on adding a helper weapon, and setting values on that specific copy of the helper weapon?

Ive not delved into that area much myself yet.
Take a look at the attachment. Its an example adjustment with the helper weapon and pulling the tags. The "fields" that hold values for bonuses (like weapon enhancements and weapon focus I leave to you to work out. :)
 

Attachments

Back
Top