Associating problems.

For questions about using Classic.

Post » Mon Oct 27, 2008 6:20 pm

I have an event like this:


and my play area looks like this:


and i have the little green scanner: that is running around and scanning the area.

What i want is; when the scanner overlaps one of the brown boxes, the corresponding grey box is selected.

ps. I'm using the new "IOJ Client" for uploading my images, and its AWSOME! When you press printscreen you get to select a part of the screen with a selection box, and then you just get the link! Incredibly easy!
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Tue Oct 28, 2008 1:19 am

Do you mean you want 'marker' to be 0 for when it's not overlapping? You could just set it to 0 in an Always event just above it.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Tue Oct 28, 2008 9:28 am

No. My event does not work, that's the problem. I want to "draw" a map of the surroundings by activating the correct markers.
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Tue Oct 28, 2008 8:47 pm

Because you're using 'Compare values' in the system condition (by the looks of it), the values returned will be for the first instances only, and it won't pick any of the objects meeting the condition (it just compares the raw numbers). The 'For each object' condition should solve this, you can try adding 'For Each box' or 'For Each marker' just after the overlap condition. (Not sure which object to use, depends on what you're doing)
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Tue Oct 28, 2008 10:13 pm

Thank you very much! that worked perfectly! Now i have a new question. I have and event lookning like this: . Pressing space would create the scanner object, and start the loop "scan" for a bunch of times. The loop moves the scanner around for a while, activating the correct markers. The problem is, it seems like the loop is activated before the object is created. The first time i press space the scanner is created, but nothing else happens, but the second time i press space, when the scanner is already there it works like it should. If i create the scanner in a separate event it works on the first time. (so i have a workaround, but its a pretty serious problem if the actions are triggered in the wrong order.)
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Tue Oct 28, 2008 10:20 pm

Objects don't really count as created until the event finishes. Use your workaround - when the fastloop is triggering, the object's in it's quasi-existing state. You can use the created object normally in the same event, but triggering a loop and using it in other events before the end of the event will not work as you expect.

It's a strange quirk of the engine but also a fairly well-known one - it has to work this way I'm afraid (it's involved in a number of bug fixes that involved crashing events).
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

Post » Tue Oct 28, 2008 10:27 pm

Thats okay i suppose. We just have to write it somewhere in the wiki about creating objects so that people knows about it (or in the wiki about loops)
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Tue Oct 28, 2008 11:38 pm

i have nothing good too say butt
[quote="Ashley":1mx797s4]EDIT (this should be): [u:1mx797s4]quazi[/u:1mx797s4]-existing state.[/quote:1mx797s4]
xD
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests