Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
If I have a foreach (family)
I want to pick the closest other member of that same family and put it's values in the current foreach family member...
How do I pick the closest (or based on whatever) family member and distinguish it within that loop from the current iteration family member when they're both the same family? Within the loop only one is picked... if I say "pick all" will it break that loop?
What's the best way for family members to pick each other?
Develop games in your browser. Powerful, performant & highly capable.
for each family
set family variable var1 to 1
call function "check" param1 =self.x, param2= self.y
set variable var1 to 0(dunno if this will work)
on function "check"
family variable var1 does NOT equal 1
family pick closest to param1, param2
Oh I see basically run through twice... and have a flag to see if it's the one from the loop. Problem is you're still in the loop so within that loop only 1 family member can really be picked at a time... but a function frees that up and creates a new set?
If I have an event that says pick only THIS ONE member of a family...
then within that a sub-event that calls a function that picks from the same family... the picking starts over again within the function's events...hmmm.