Well, one thing that definitely won't work are your examples 4 and 5. The function @caethyril provided tries to convert the notetag to a number and compares whether it is greater to or equal to 1. If you throw a text in there, that will obviously cause problems. If you want to compare the text of the notetag to some other text, try the following:
This will be true if any actor in the party has at least one weapon equipped with the notetag
Your other examples should work fine, theoretically. However I don't think you altered the statements in a way that actually accomplishes what you are trying to accomplish. (That is a bit hard to tell as you only told us how you altered them and that the do not work as intended, but didn't tell us what you intended). You altered the second argument that gets passed to
For example the content of the notetag <x: 101>, when passed through
When passed through
I suspect you didn't want to alter how the notetag is converted to a number, but how that number in the notetag gets compared. That happens directly after that.
If you want to check whether at least one actor in the party has a weapon with 5 Strenght or more, then you would replace the 1 with a 5.
If you want to change how both numbers are compared, you can change the operator for that, too. Instead of >= put:
- <= for less then or equal
- == for exactly equal
JavaScript:
$gameParty.members().some(function(actor) { return actor.weapons().some(function(item) { return item && item.meta && item.meta.Strenght.trim() == 'Strong'; }); });
<Strenght: Strong>Your other examples should work fine, theoretically. However I don't think you altered the statements in a way that actually accomplishes what you are trying to accomplish. (That is a bit hard to tell as you only told us how you altered them and that the do not work as intended, but didn't tell us what you intended). You altered the second argument that gets passed to
parseInt(). This only alters to which number system the given text gets converted.For example the content of the notetag <x: 101>, when passed through
parseInt(item.meta.x, 10) would be the number 101 (1*100 + 0*10 + 1*1 or 1*10^2 + 0*10^1 + 1*10^0)in the decimal system (the normal number system that you are used to).When passed through
parseInt(item.meta.x, 2) it would still be the number 101, but in the binary system - or 5 in the decimal system(1*4 + 0*2 + 1*1 or 1*2^2 + 0*2^1 + 1*2^0).I suspect you didn't want to alter how the notetag is converted to a number, but how that number in the notetag gets compared. That happens directly after that.
JavaScript:
//[...]
parseInt(item.meta.Strenght, 10) >= 1;
//[...]
If you want to change how both numbers are compared, you can change the operator for that, too. Instead of >= put:
- <= for less then or equal
- == for exactly equal