Overlap auto-picks object instance?

Get help using Construct 2

Post » Sun May 26, 2013 10:54 pm

Before I get into another LONG-winded explanation of what I'm trying to do in an area of my game, I just need to (re?)confirm a couple of things about overlapping and containers.

1. When Object1 overlaps an instance of Object2, does that instance of Object2 automatically get Picked?
2. If Object3 is in a container with Object2, when Object2 is overlapped, does Object3 also get picked simultaneously?

Thanks!
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,631

Post » Sun May 26, 2013 11:04 pm

Objects in a container are picked together irrespective of overlap...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Sun May 26, 2013 11:07 pm

@Pixel perfick - The overlap event is generally irrelevant in question 2...I just needed to make sure that picking one will pick the other if they're both in a container. That way I'm avoiding needless extra instructions.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,631

Post » Sun May 26, 2013 11:15 pm

Yeah they created, destroyed and picked together, basically treat as one object...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Mon May 27, 2013 1:19 am

Excellent. That's what I thought.
So then, moving more specifically towards my game...
I have a series of object instances ("Ping") that are created at the image points of the instances of object "Node". Each Ping instance has an OriginIID instance variable and is given the IID of the Node at which it was created. Each Ping is then extended in width until they either...
1. overlap a wall (action: Destroy) or
2. overlap another instance of Node (action: store the IID of Node to OriginIID).

Thus...
0. Every Node instance has an Array contained with it.
1. Node(0) creates x instances of Ping.
2. Ping(x) extends in a compass fashion...up to four directions.
3. When Ping(x) overlaps with Node(1), the Array that is contained with Node(0) will receive (via Push) the IID (stored in OriginaIID instance variable) of Node(1).

This way, when the Enemy overlaps Node(0), it will be able to pick from the available directions that it can go...in this case, whichever direction Node(1) lies. Since the IID of Node(1) is contained in the Array of Node(0), I can easily plot a path for it via Pathfinding.

But...I'm hitting snags and I'm trying to refine/eliminate the causes to why it's not working.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,631

Post » Mon May 27, 2013 2:31 am

On a similar note:
When I create an instance...
For Each Node | Create Object Ping
...do any sub-events pick that instance of Ping for the duration of that interation of the For event?
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,631

Post » Mon May 27, 2013 5:39 am

[QUOTE=Rhindon] On a similar note:
When I create an instance...
For Each Node | Create Object Ping
...do any sub-events pick that instance of Ping for the duration of that interation of the For event?[/QUOTE]

Yup. Objects are automagically picked on creation, any subsequent actions will refer to them.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Mon May 27, 2013 6:04 am

@vee41 - Thank you, sir! :) And, "automagically"? *grins* You've been hanging around @Yann, haven't you? heh heh
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,631

Post » Mon May 27, 2013 10:46 am

[QUOTE=Rhindon] vee41 - Thank you, sir! :) And, "automagically"? *grins* You've been hanging around Yann, haven't you? heh heh[/QUOTE]

I've been automagicking things for 15 years, so no, I wouldn't say Yann has been influence for me in that regard ;)
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Mon May 27, 2013 10:16 pm

@vee41 - Hmmm... :) Maybe he bummed it off of you. The thief. lol
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
112
S
20
G
8
Posts: 741
Reputation: 13,631

Next

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, anty21ro, Magistross and 18 guests