How do I - make random object to appear automatically ?

Get help using Construct 2

Post » Sat Apr 08, 2017 1:51 pm

Does anyone can help me to make random object to appear/show up automatically ? :cry:

so here we go, the game is about restaurant.

this is how it works:
people coming in automatically as layout started, then when people stops, the order pop up automatically above the head and the order that pop up is random.

the bold line is the problem because I already tried many ways to make it works but nothing happened.
I have also been tried to search it first through forum to find if there is any topic that could solve my problem but I found none.

I don't post any example capx because that's the only problem that i can't solved yet, so I guess no use to post one.

Please some advice from anyone in the forum
Great person aren't made by praise and laugh but insult and tear
B
13
S
3
Posts: 37
Reputation: 863

Post » Sat Apr 08, 2017 2:38 pm

Hey Dark,

Start with a global variable called 'CustomerCount'.
All of your customers that come in should have a variable called 'Number' and another called 'Seated'.

When a customer is spawned you attach a the Customer Count number to it and add 1 to the variable (so each customer has a unique number).

When that customer sits down make the 'Seated' Variable 'Yes' or '1' to mark him/her as ready to order.

Choose your way of using a timer, timer behaviour, dt, every X seconds etc and then pick a random customer like this (these are the conditions).

Pick all Customer object (pick all is from the system menu)
Customer object is seated (Click on the object and then compare the variable)
Pick a random Customer object (pick random again from the system menu)

(The above picks all the customers, then refines the search to only customers that are seated and then picks a random one of those to call for the order).

The add the action to the conditions:

Customer spawn object (Order bubble) at image point over the head.
ImageImage
B
130
S
23
G
7
Posts: 1,078
Reputation: 13,280

Post » Sat Apr 08, 2017 2:59 pm

GenkiGenga wrote:Hey Dark,

Start with a global variable called 'CustomerCount'.
All of your customers that come in should have a variable called 'Number' and another called 'Seated'.

When a customer is spawned you attach a the Customer Count number to it and add 1 to the variable (so each customer has a unique number).

When that customer sits down make the 'Seated' Variable 'Yes' or '1' to mark him/her as ready to order.

Choose your way of using a timer, timer behaviour, dt, every X seconds etc and then pick a random customer like this (these are the conditions).

Pick all Customer object (pick all is from the system menu)
Customer object is seated (Click on the object and then compare the variable)
Pick a random Customer object (pick random again from the system menu)

(The above picks all the customers, then refines the search to only customers that are seated and then picks a random one of those to call for the order).

The add the action to the conditions:

Customer spawn object (Order bubble) at image point over the head.


ok @GenkiGenga, will do it first then I'll post again if it works or not and thank you for your advice :)
Great person aren't made by praise and laugh but insult and tear
B
13
S
3
Posts: 37
Reputation: 863

Post » Tue Apr 11, 2017 10:12 am

Alright, problem is solved.

To @GenkiGenga, THANK YOU VERY MUCH, actually it's already done yesterday but I just got time to post in the forum.

So, I guess this topic should be closed by now.
Great person aren't made by praise and laugh but insult and tear
B
13
S
3
Posts: 37
Reputation: 863


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests