Spawning Unique Pawns from Single Blueprint

I’m not sure what the “issue” is…

The repeated name?
Just have the event that gets one at random remove that name from the array.

If you meant something else… let me know

Just a bit of advice… you can cut out a few conditions by just using a single check of the resulting integer from the random.

eg.

120231-setcondition.jpg

When you check if a thing is == or ! or so forth, it is returning a True/False boolean already. You don’t need to use that one to set another, you can just set it as the value.

Hi!

I’m still fairly new to Unreal, although I’ve made a few games in it now. Mostly things simple games like platformers, shooters, etc. I’ve started work on a new project now, that I want to see to fruition and maybe release for free or something just so I can have some of my work floating around.

The idea for the game is sort of similar to the old Summer Camp horror story type things, in which you’re a kid at a Summer Camp and there’s a murderer trying to get everybody. I’ve got a few curve balls in there so it isn’t as generic as I made it sound. I’m currently working on a blueprint which has worked about halfway to what I need it to do. It’s probably simplest to show you;

I’m attempting to create a number of unique pawns from a single script. The way which it is supposed to work is to give the pawn a name, then to determine whether or not that pawn is the murderer, depending on whether or not there is already a murderer out there. The issue is this;

(The red is to signify that the pawn is the murderer)
Now I know why this isn’t working, you don’t have to point it out. But as I said, I am still fairly new, I’ve been using Unreal for just over a year now, and this is my first more complicated sort of game. Is there a better (probably more obvious) way to achieve the goal I’m aiming for?

Just a bit of advice… you can cut out a few conditions by just using a single check of the resulting integer from the random.

eg.

120231-setcondition.jpg

When you check if a thing is == or ! or so forth, it is returning a True/False boolean already. You don’t need to use that one to set another, you can just set it as the value.


Sorry, I didn’t notice you were naming them in the spawned blueprint.
You will want to put that in the blueprint that spawns them …

In the Camper(?) blueprint, add a variable to store the name, make it Editable and Exposde - like this.

120233-spawning_with_name.jpg

.
Exposed variables can be set when you spawn the pawn -

120234-passing_on_create.jpg

.
And use that name in their Construct graph.

120235-showingname.jpg

.

I hope this didn’t just confuse things.