Jump to content

Item has tags - 2 variations I came across


BFT2020

Recommended Posts

What is the difference between the two?

 

requirement name="!ItemHasTags"

 

requirement name="ItemHasTags"

 

I understand what happens with the bottom example.  If the tag was perkSkullCrusher, then the effect would only apply to items that has that tag.  Does the top example mean the opposite?  Does it mean it applies to everything but perkSkullCrusher?  Or is this just a typo I found in the code?

Link to comment
Share on other sites

Note that telric only told you about the general use of "!" in many programming languages, something you seem to have known already. And yes, this surely is the most logical explanation. But verified it isn't.

 

Have you seen this used anywhere in vanilla or in a mod ? If yes, why not try it in game if it works as expected?

 

Edited by meganoth (see edit history)
Link to comment
Share on other sites

Yes, in Hidden Strike perk.  It is used with perkSkullCrusher tag so if it works as intended, swinging a sledgehammer should not grant you any bonuses.  I will probably test it out later to verify.

 

I missed it the first time I was looking at the hidden strike code and thought it only applied to items with that tag.  I noticed it later and confirmed it was not preventing other weapons from using that perk.

Link to comment
Share on other sites

A lot of the requirement checks can be used in this way, not just the item tags. You can do:
            <requirement name="!EntityHasMovementTag" tags="walking"/>

for example... I use this to apply an idle animation to my modded entities. Sometimes it doesn't work for some requirements, but the invert="true" parameter usually works if the ! does not.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...