bug?

New releases and general discussions.

Post » Thu Nov 08, 2007 11:15 pm

I don't know what I'm doing wrong, if that. I even tried using my own UIDs, instead of Construct's. I think this is a bug.

[url:1i2mp0jr]http://www.freewebs.com/jonnymataza/arrow.cap[/url:1i2mp0jr]
B
2
S
1
G
5
Posts: 31
Reputation: 1,462

Post » Fri Nov 09, 2007 2:00 am

I got it to work, without using UIDs though.

I'm unsure whether this solution is helpful to you at all (not sure where exactly you intend to take this), but regardless.

***File Removed***

EDIT: I had another look. Try this one, it uses UIDs and should be what you're after. :)

http://www.fileshack.us/get_file.php?id ... arrow2.cap
B
2
S
2
G
5
Posts: 108
Reputation: 1,866

Post » Fri Nov 09, 2007 2:23 am

Just in regards to whether it is a bug or not. It seems as though, whether by design or not, using the 'Compare' condition under the system object to compare two values doesn't allow for an action relative to a specific object.

In other words, if there are multiple instances of an object, and you wish to compare say, their UID, or their X position, using the 'Compare' condition will only ever return said values for the first instance of that object. (Or at least, my testing leads me to believe this is true)
B
2
S
2
G
5
Posts: 108
Reputation: 1,866

Post » Fri Nov 09, 2007 3:41 am

Thank you Glamthaus, this is exactly what I was trying to accomplish :D . I think it is more inconvenient, than anything else, that you can't select object instances after using a compare value condition. It might just me still try to move on up from MMF though :P .
B
2
S
1
G
5
Posts: 31
Reputation: 1,462

Post » Fri Nov 09, 2007 4:22 pm

The first file you posted works correctly so long as you use the 'Compare unique ID' condition in the sprite object itself, not just compare values. This will test every sprite instance, which is what you want.

'Compare values' has one simple job: to compare two numbers. That's it. It doesn't care what the numbers are or mean, it just compares them. In this case in order to work out each value, it doesn't know which object you want, so yes, it uses the first object. This is by design.

A second workaround is to explicitly tell Construct you want to do a 'Compare values' for every sprite instance. You can add a 'For Each object' condition above it to do this, eg:

+ For Each 'Sprite'
+ (Compare values) Sprite.UID equal to Arrow('parent')

However, this basically is a long way of writing what the Sprite's built-in 'Compare UID' condition does, so you may as well use that.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 5 guests