"First Make sure the Global Variable Values are text and returns the Sprite Names when you randomize it."
1) Make a Family and add all the sprites that you want to create.
2) Add an Instance Variable in the Family called "Signature" (or anything you want) returning a Text value.
3) In the Project Bar , set the Instance Variable "Signature" of each sprite the same as their name.
4) Make this event :
Condition: Pick by comparison.... Global Variable = Family.Signature
Action: Create Object : Family at (X,Y)
Lets say I have: apple|orange|banana in my Fruit_family.
The sprites are called apple, orange and banana respectively.
Also I created a text variable: Random_Pick=""
At the beginning there is a draw = pick either: apple, orange or banana.
All is good, that all works I get the desired output when using output value to text.
At this moment when I draw orange I get Random_Pick="orange"
Now I would like for the Fruit_family to spawn the orange that I the system has randomly picked at the beginning at a certain location.
I did as you suggested, added "Signature" Instance Variable to the Fruit_family, and named each of the objects as their sprites:
apple=apple, orange=orange, banana=banana
Then I added the compare 2 values, and compared: Random_Pick=Fruit_family.Signature.
Then create object Fruit_family on specified layer and location.
From what I understand, the system is now looking if the Random picked fruit is present in the family signature and if it is, it is spawning a random object from that family, and not the exact fruit that was picked at random at the beginning.
So I am getting random spawns every time, so when the pick is apple I get a random object spawn instead of the spawning apple.
Its a shame that there is no further optional branching after selecting the create object Family ---> pick specific object in that family to create.
Will try the other option regarding caling the function in a couple of hours.