Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

UPDATE: Managed to solve this by changing the 'includes' calls in isMHAllowedWithOffHandWtypeId and isOHAllowedWithMainHandWtypeId to 'contains' calls.

(2 edits) (+1)

While I'm glad you solved that issue, something about it doesn't add up here.

That function should be given an array from the item with a list of the unequippable wtypeIds in it. array.contains() isn't a function, which I why I used array.includes() instead. It would appear, however, that the item is not getting an array of disallowed wtypeIds, but is instead only getting a string, as string.contains() is a function that exists.

It appears the bug is caused because your item only has one disallowed wtypeId, so it was saved on the item as a string instead of an array. That means when you make an item that has more than one disallowed item with your changes, it will crash the game in the same way as it did before when using includes.

I will correct the way the notetag is being parsed, and upload an updated version shortly.

~Ramza


edit:
I can't find any fault with the note tag in the way it reads the tags to set the disallowed wtypes array. If you don't include the leading space before listing the numbers, it doesn't trigger the notetag at all, and if you include a space after the first number, it pushes a value of 0 to the disallowed weapon types array. Neither of these cause the crash. In the first case, the array would remain blank, as every weapon gets a blank array on database load, and in the second, it would simply disallow equipping whatever item this was with a barehand in the other hand.

I'm not sure why it's not saving the value correctly on your project, but the edit you made will certainly cause the same crash again if any weapon has more than one disallowed wtypeId on it. 

(1 edit)

Interesting.  I see that rpg_core.js has defined it as an additional property of arrays:


(+1)

Alright, well, maybe it'll continue to work then.

I'm still not sure why includes didn't work though. Since it is a default property of arrays, and that is what should be on the items, and more importantly, why it works fine in my test project, and at least one other project out in the wild.

But if this modification works for you, I guess we can leave it at that, lol.