Still problems with addressing the right object.

For questions about using Classic.

Post » Fri Mar 19, 2010 2:03 pm

Well the last thread got "solved" but I didn't get any wiser.

My previous post:

[quote="falconshield":2hymaqia]I have a similar question:

I tried to make a function where you can push boxes around in grid movement. I didn't get very far before I noticed that the events addresses ALL of the boxes instead of the one I'm actually colliding with. Which means that when I'm pushing a box one direction, it's actually pushing all of the boxes in the same way.
In MMF2(which I have some experience with) it automatically targets the right one and the others are left alone.

What can be done to fix this? Or, what would be a more affective way to achieve the push-function?

Link to .Cap-file:

[url:2hymaqia]http://falconshield.com/spel/dungeon%20construct.cap[/url:2hymaqia][/quote:2hymaqia]

I tried to switch between objects in the event-sheet but that didn't help. Also Construct just crashed when I tried PixelRebirth's example.

What's wrong with this?
B
1
G
2
Posts: 3
Reputation: 631

Post » Fri Mar 19, 2010 2:58 pm

[quote="falconshield":37n35nv3]Well the last thread got "solved" but I didn't get any wiser.

My previous post:

[quote="falconshield":37n35nv3]I have a similar question:

I tried to make a function where you can push boxes around in grid movement. I didn't get very far before I noticed that the events addresses ALL of the boxes instead of the one I'm actually colliding with. Which means that when I'm pushing a box one direction, it's actually pushing all of the boxes in the same way.
In MMF2(which I have some experience with) it automatically targets the right one and the others are left alone.

What can be done to fix this? Or, what would be a more affective way to achieve the push-function?

Link to .Cap-file:

[url:37n35nv3]http://falconshield.com/spel/dungeon%20construct.cap[/url:37n35nv3][/quote:37n35nv3]

I tried to switch between objects in the event-sheet but that didn't help. Also Construct just crashed when I tried PixelRebirth's example.

What's wrong with this?[/quote:37n35nv3]

You probably need to use the latest unstable version (in announcements), not the stable one on the website.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Fri Mar 19, 2010 3:58 pm

Read the wiki article on conditions to fully understand how to address the objects you want.

The basic way events work is to pick an object you want to affect (or as you put it, address) by using conditions. For example, any SpriteA actions in a 'mouse is over SpriteA' event will only affect the SpriteAs under the mouse. If you want to affect just one object, you need to think of the condition or conditions that will pick just that instance. It's a different way of thinking compared to scripting or programming languages - first isolate the instances with conditions, then do something to them - but it becomes natural with some practice.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Mar 19, 2010 6:39 pm

Yeah I managed to solve it eventually. However a bunch of other issues came up so I'm trying different solutions atm. Thanks for the answers!
B
1
G
2
Posts: 3
Reputation: 631


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests