Help with "Pick Object With Highest Variable"

For questions about using Classic.

Post » Tue Mar 31, 2009 8:59 pm

I need some help with the "Pick Object With Highest Variable" action. I made a simple cap with three instances of a sprite object. The objects each have a private variable called cSpeed, set to 1, 2 and 3 respectively. Then, during the startup, I call "Pick Object With Highest Variable" and tell it too look at the objects' speeds. Then I set a text object to the cSpeed of the object that was selected.

It seems like it should be simple enough, but nothing happens. The text field never changes. If I put a message box action after the "Pick Object With Highest Variable" condition, it never fires. I feel like I'm missing something here.

Pick Object With Highest Variable Cap

Thanks for the help
B
4
G
3
Posts: 21
Reputation: 942

Post » Tue Mar 31, 2009 9:23 pm

They all have 'destroy on startup' attribute ticked.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Tue Mar 31, 2009 9:44 pm

[quote="Rich":b91hr3q1]They all have 'destroy on startup' attribute ticked.[/quote:b91hr3q1]


Ah yes, yes...... :oops: so sorry for that..... That one little box makes a big difference apparently. Thanks for taking the time to check out the file and for the response.

Now things work pretty well when I start the cap with three character objects created at startup. However, when I spawn the characters as we've learned about in the platform tutorial, things don't go so well. At runtime, I create three character objects and assign them cSpeeds of 1,2 and 3 and I can see that each character has the correct cSpeed, but the "Pick Object With Highest Variable" action picks the character with cSpeed = 1.

Static and Spawning Characters
B
4
G
3
Posts: 21
Reputation: 942

Post » Tue Mar 31, 2009 9:52 pm

It works if you do it on any other tick than the start of layout one.

I think this is a bug, so submit it to the tracker :).
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests