Compare different instances' instance variables?

Get help using Construct 2

Post » Sat Dec 01, 2012 5:40 am

If I have an object of Car and I have a blue instance and a red instance and I want to compare the cost of each car to the other, is there any easy way to do this?

I would do it by "Pick instance with UID" which will isolate the red car and then store the Car.Cost into a global variable "tempCost". Then I will have to again "Pick instance with UID" to isolate the blue car and then compare the "tempCost" variable to the Car.Cost.

Is there a way to more directly compare Car.Blue.Cost to Car.Red.Cost? Thanks
Posts: 102
Reputation: 1,738

Post » Sat Dec 01, 2012 8:28 am

Another method is to actually put the Car into a family (just call it 'FCar' or something)
and then you can have a condition which picks what Car(s), and another to pick what FCar(s) specifically, even though they are the same object.. it's just a way of differentiating two separate 'pickings' for the same set of actions.. (so you can have one action that only applies to the picked Car, and another action that only applies to the picked FCar)

This way's a bit confusing though, it sounds like your way would be all that's needed for the task.keepee2012-12-01 14:44:03
Posts: 469
Reputation: 4,683

Return to How do I....?

Who is online

Users browsing this forum: cotteux, erickson400, Joannesalfa, makkancs, PatrikTT, runningtech and 3 guests