How to Set multiple bools (to T or F) by using only 1 Set node?

XxNotAGamerxX
Sun, 09 Jun 2024 23:58:49 +0000
Blueprint

I want an easy way to Set a list (Array) of Bools to True or False, by using only one Set node - so that I do not have to use a chain (list) of individually named Set nodes. Is it possible?

I.e. I don’t want to have to drag multiple named Set nodes and chain them (as shown in the black comment box).

I dont want Set chains because Im giving the code to help someone, and I want them to be able to reuse my code setup, without them having to drag in their named Set nodes for their [unknown number of bools] - because then my code would need blank space for their potential # of Set nodes.

Thus I want to use Index 0 of an Array; the user checks it to be True (or False), and I want all Bools connected to the Array to be Set to copy whatever Index 0 says (True or False). (And I feed the Array into a Function that does internal checks, without having to declare the name of each Bool.)
** (So the user still has to drag in Get nodes of their Bools (and connect to my Array, which feeds into a Function. But [Get] takes up less space than Set nodes, and they can drag their Get onto my Get, to do a simple replace - keeping pin freeways connected.)

1. So what is an alternate Set node for bools (without naming each bool)?

2. If I use an Array, I think there is a node for Arrays that feeds the Array in and spits the updated value back out to the Left (at its Input pin), thus without needing an Output Variable pin. But Im unsure how to do that. (The pic shows my exploration of Node guesses.)

Goals: make the code easy to copy/paste in other people’s BPs:

I don’t want to use CastTo.

I can use a Function or Macro inside a CharBP, but I dont want to have to declare the name of each Bool. I want a wildcard way to Set every Bool that the user connects to the Array.

Perhaps I can use Enums (for a list of 0 or 1 values) - only if you show me the code (remind me)? But I thought that using Bools would be easier for new people to understand a True/False value.

I think I bought an asset that has extra Bool nodes, but can’t use it since I need the code to be shareable.

Thank you.

1 post - 1 participant