Too many branches + Multiple Subtracts based on bool

Hhorde
Tue, 11 Feb 2025 23:06:19 +0000
Programming & Scripting

Hi two questions:

Firstly is there a neater way to for something that has to do multiple boolean checks e.g multiple branches. Currently I check an array too what item is in a inventory slot. If the name of the item is true it will fire. If false It will move onto the next branch in a long list. Some checks has 20 items to go through and thus 20 branches which takes up lots of space. How can I Make this cleaner?

Then secondly depending on which boolean triggers each item costs a different amount of money. How can I set the money to a different subtract per each bool instead of having to make a seperate Substract and Set everytime.

When its just a few items this is okay. But I want to scale up to thousands of items and values which will take way to long to do each item like this and not enough space on the graph to track it all

6 posts - 5 participants