random object

Get help using Construct 2

Post » Sun Jul 16, 2017 8:11 pm

hopefully someone can help me with this, i have an object that when the timer reaches 0 it will create the object then set a path via pathfinding to a random object with the variable "Village" but unfortunately all it does is create an object but i cant find any way of setting it to a random object

please help this noob :(
B
15
S
5
Posts: 134
Reputation: 1,617

Post » Sun Jul 16, 2017 8:33 pm

If I understood you correctly, put the objects you want in a family and make "Village" a variable for that family. After that use System->Pick Random Instance

EDIT:
Just noticed you don't have a license for the full version so I think you can't use families. In this case, try something like this:

Local number = x

> Set Local number to round(random(x))

Local number= 0
System-> Pick Random Instance (object 1)

Local number= 1
System-> Pick Random Instance (object 2)

Local number=2
System-> Pick Random Instance (object 3)
"If you don't build your dream, someone else will hire you to build theirs"
B
12
S
3
G
1
Posts: 57
Reputation: 913

Post » Sun Jul 16, 2017 9:14 pm

@vvalt hey thanks for the reply, i do have a personal licence but its on steam :) lucky the object is part of a family and so is variable

so if i did

system -> pick random instance
family = "Village"

then object pathfind to family.x.y it would work?

update. ive done exactly what you said and it works a treat :) thanks a bunch for your help
B
15
S
5
Posts: 134
Reputation: 1,617


Return to How do I....?

Who is online

Users browsing this forum: plinkie, Syazanie Amirin and 4 guests