Start random quest

In my game, quests are given to the player randomly. Each type of quest has its own blueprint, whose parent is Quest.

For example, I might have WalkingQuest, JumpingQuest and CollectingQuest, which all have the parent Quest.

How can I get an instance of a random one of these subclasses?

Extension: My actual use will be getting a weighted random Quest, so being able to get them in a list or something would be useful.

Hi there,
If your quest list is stored in a form of array variable, you can use the node called random array item.
Can you give more details about your quest list?

image

Well my issue is really that I don’t have a quest list. I just have a load of blueprints whose parent is Quest.
I can’t create an instance of each one and put them in a list because you might have to complete the same quest more than once!
Maybe I could get a list of pointers to classes? And dereference the pointer??
I basically just need something which I can plug into “Create New Object from Class”

What exactly is stopping you from putting the classes in an array as suggested above, they all inherit from Quest after all.

My own incompetence! I’m new to this as you can tell but making an array of class objects does in fact work perfectly.

2 Likes