0 Favourites

Overlap auto-picks object instance?

  • 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!

  • Objects in a container are picked together irrespective of overlap...

  • 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.

  • Yeah they created, destroyed and picked together, basically treat as one object...

  • 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.

  • 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?

  • 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?

    Yup. Objects are automagically picked on creation, any subsequent actions will refer to them.

  • vee41 - Thank you, sir! :) And, "automagically"? *grins* You've been hanging around Yann, haven't you? heh heh

  • vee41 - Thank you, sir! :) And, "automagically"? *grins* You've been hanging around Yann, haven't you? heh heh

    I've been automagicking things for 15 years, so no, I wouldn't say Yann has been influence for me in that regard ;)

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • vee41 - Hmmm... :) Maybe he bummed it off of you. The thief. lol

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
167 14,515
DMT2005's avatar
DMT2005
Unread hot topic
0 Favourites
[Plugin] instance bank2
85 18,373
rexrainbow's avatar
rexrainbow
Unread hot topic
123 14,874
Zebbi's avatar
Zebbi