JereKuusela / valheim-infinity_hammer

The Unlicense
5 stars 6 forks source link

set_invulnerability Does Not Toggle #55

Closed Ser-Loras closed 2 months ago

Ser-Loras commented 6 months ago

Not sure if this is by design or just some kind of oversight, but using the command hammer_config set_invulnerability does not toggle the setting, like basically all of the other hammer_config commands for binary settings do.

The only way I have found to enable invulnerability is to use the command hammer_config set_invulnerability On. Weirdly, it seems the "On" modifier is also case sensitive. If I use "on" instead of "On" invulnerability is not enabled. "True" or "true" also do not work.

Using just hammer_config set_invulnerability by it self seems to just return a message indicating the current state, without toggling it. To disable invulnerability I have been using, hammer_config set_invulnerability Off, but I have just discovered that hammer_config set_invulnerability followed by any string of text other than "On" will actually set invulnerability to Off. So to recap:

hammer_config set_invulnerability = no change, prints a message indicating whether invulnerability is On or Off hammer_config set_invulnerability On = turns invulnerability On hammer_config set_invulnerability off = turns invulnerability Off hammer_config set_invulnerability on = turns invulnerability Off hammer_config set_invulnerability True = turns invulnerability Off hammer_config set_invulnerability sdflkasdf = turns invulnerability Off

This is pretty convoluted, and it took me quite some time to figure out. If this is intended, it might be good to add some more detailed information to the documentation. I'd really like if set_invlunerability worked as toggle like most the other config options though, so that I can easily bind it to a single key for quick use.

JereKuusela commented 6 months ago

Invulnerability has now multiple options, so it's not just a toggle anymore.

But I can see if I can make it toggle if the currently active value is given again.

JereKuusela commented 2 months ago

Latest version allows doing this:

hammer_config set_invulnerability On/Off/Damaged/Worn

or hammer_config set_invulnerability On/Off