• 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

Help creating Item that can be assigned to any slot.

Greetings and thank you for the consideration and assistance.

I am attempting to create an Item (a wondrous Item for now,) that can be assigned to any Magic Item Slot via a drop-down bar. Getting the bar to appear is easy, just using the item selection option in the Editor. The difficulty lies in finding a suitable Eval Script that will assign the Chosen Item Slot to the Hero.

What I want is something that works very similar to the Magic Tattoos. However I do not wish to create a second set of phantom slots for this item. I want it to take up one of the actual Item Slots. If I select Shoulders, then equip a cloak, it should cause an error.

If someone could help me on what script is required to perform the assignment after the user chooses the field, I might be set.

the Script for tattoos looks like this:

PHP:
[spoiler]
      perform field[usrChosen1].chosen.pulltags[ExtraSlot.?,Hero]
      perform forward[ExtraSlot.?]

and the eval rule for them like this: 


      ~Finished if nothing is selected
      validif (field[usrChosen1].ischosen = 0)

      var searchexpr as string
      var index as number

      searchexpr = "Custom.Tattoo & "
      index = 0

      searchexpr &= tagids[Hero.?]

      foreach pick in hero from BaseMagicI where searchexpr
        index += 1
        nexteach

      if (tagis[Hero.EqpRing] <> 0) then
        validif (index <= 2)
      else
        validif (index <= 1)
        endif
[/spoiler]

But that is too specific to Tattoos, and I do not want to assign ExtraSlots.


I have the list of Slots. I have tried mimicking several scripts, without any success.

I believe I need some way of pulling the tag from [usrChosen1] then:
perform field[usrChosen1].chosen.assign[*Not Sure Wat to Put Here*]

I've messed with Hero.BaseMagicI , Component.ItemSlot , & seveal similar variations.

Perhaps a dirtier way is possible, by creating some kind of Matrix/Array with symbolic values, then using an If/Then to use the Values to assign the various Slots (isEqpBody, isEqpEyes, isEqpFoot, etc). However I'm not really sure how to configure that either.

Any advice is much appreciated.
 
Sorry I missed this thread earlier.

Doesn't just the very first line of that code by itself do what you want?

That should place the correct Hero.Eqp? tag onto the item that's running this script to make it count as that type of item.
 
Back
Top