cacotigon's Recent Forum Activity

  • Unfortunately, there really isn't an elegant solution to being able to easily do subconditions / actions across each distinct instance between collidee and collider in an On Collision based on a single Family at this time.

    You can get around this by duplicating the Family. So you have OriginalFamily and DuplicateFamily with the same set of collidable objects.

    Then you can do:

    OriginalFamily On Collision DuplicateFamily : Actions

    While this solves the problem of being able to access both objects distinctly in the same descending subevent tree, you lose access to behaviors and instance variables that belong to OriginalFamily when referring to the DuplicateFamily collision instance.

    I've gotten around this somewhat through the use of "System Pick nth instance". In this approach, you pick each one in a separate subevent and save off the information you need to local variables. For example, let's say you had a list of monsters (Ogre, Troll, Imp, Al Sharpton, etc), all of which belong to family called Monsters. You needed X/Y and a custom Family variable called Life. Your code would look similar to this:

    <img src="https://dl.dropboxusercontent.com/u/12667027/Construct%202/IdenticalObjectCollision/MonstersExample.png" border="0" />

    Make sense?

  • Ashley, I can understand that. I created a PinFamily whose objects have attributes:

    IsPinned (bool)

    Owner (UID)

    ImagePtName (string)

    Then I just have a single statement that repositions any objects on layout in PinnedFamily with IsPinned = Enabled.

    That way whenever I spawn an object I want pinned, I can just set those attributes on the object, and the game will handle pinning them.

    Thanks!

  • Ashley,

    Could you please explain to me how the "On Collision Event" works internally?

    For example, hypothetically, let's say that I have Event Sheet 1:

    Obj1 On Collision Obj2 : Do some actions

    Event Sheet 2:

    Obj2 On Collision Obj1 : Do some actions

    If I assume that the events in both sheets are run as a single concatenated logic loop, would it be correct to assume that the collision detection stores a dictionary of prior checked collisions for objects? In this manner, Event Sheet 2's collision check cost would be minimal.

    The reason that I ask is because I have two ways of handling collision detection at this point.

    My original way was more modular, all objects belong to EntityFamily which has a local var called CollidedFn, which is a link to a function. All collision detection was centralized in a single CollisionEventSheet which would do something along the lines of:

    On EntityFamily Collided with EntityFamily : Call EntityFamily.CollidedFn which would hand off the collision to the object's collision routine.

    However, each object (which is represented in my project by a single event sheet) could also have an:

    On Object CollidedWith EntityFamily : Do something (note that this is Object-specific)

    However, if we're not tracking existing checked collisions in a single "loop cycle", having this On Collision statement repeatedly could get very computationally expensive.

    I'm just trying to look for best practices here.

    Thanks,

    -- Cacotigon

    P.S. I might be thinking about this the wrong way, are "On Events" different from regular events in the game loop? Are they maybe like delegate triggers?

  • Bingo! That's it! Was not aware of this change. I'll just make it a rule to always have a "StorageLayout" where at least one instance of every object is already initialized.

    Thanks Pixel perfick.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As was demonstrated in the capx example, the start of Layout was already the first event in the event sheet. *Even* if it wasn't the first event linearly in the sheet itself, think about it. On Start of Layout is defined as the condition that occurs when the layout begins, I would think the layout would get initialized before objects were created on said layout.

    The whole point of doing Destroy ChildObj in the "On Start of layout" is to get rid of the troublesome fact that we are required to include one instance of every object on a layout, something which I recall the makers of Construct having stated in the past that they would eventually like to rectify.

  • The only way to get pin to work again after mirroring its parent is to manually unpin the object, update its position to the image point again, and repin it. So the image points themselves appear to be mirroring correctly, but the pinned objects are not following suit. Pinned objects *will* follow any other type of motion / rotation / etc.

    In the unlikely even that a change of this type could potentially break legacy projects which depend on mirror not updating the pinned object's position, could we at least have a Pin Option when an object is pinned along the lines of "Respect Parent Mirroring"?

    I'm using the workaround currently, but the problem with this is that I have some objects which have N number of image points and the objects that are pinned are also fairly dynamic (mostly belonging to families but occasionally different), having to reset this stuff all the time can get kind of frustrating.

    Link to .capx file (required!):

    Pin Mirror Capx

    Steps to reproduce:

    1. Create parent object

    2. Spawn child object and pin to parent

    3. Mirror parent

    Observed result:

    Child does not mirror with parent, it remains in the same position.

    Expected result:

    Child should mirror with parent.

    Operating system & service pack:

    Windows 7 64-bit

    Construct 2 version:

    Release 126

  • Since Construct 2 still requires the layout to have (as I workaround I can create an extra Loading Layout to handle this but anyway...) at least one instance of every object, when working on small single layout projects I usually start with:

    On start of layout: ChildObj.Destroy()

    I also have an On Create Master Obj : Spawn Child Obj

    From what I can tell though, the On Create is firing *before* On Layout Start, causing an object to be spawned then summarily deleted. Is this order of events intentional?

    Link to .capx file (required!):

    Order of Events Capx

    Steps to reproduce:

    0. Create Layout -> Add ChildObj and ParentObj to Layout

    1. Create ChildObj

    2. Create ParentObj

    3. Add On Create ParentObj : Spawn ChildObj

    4. Add On Start Layout : Destroy ChildObj

    Observed result:

    Both instances of ChildObj are destroyed.

    Expected result:

    Only the existing ChildObj should have been destroyed, then "On Create" should have been run.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Windows 7

    Construct 2 version:

    Release 126

  • I have a pusher object which is a solid box sprite with bullet and solid behaviors. The player is just a single box sprite with platform behavior applied to it.

    The problem is that when the pusher object runs into the player, it causes the player to jump randomly in addition to being pushed which breaks the players ability to jump since they aren't on the floor half the time.

    Here is a very simple example capx to demonstrate what I mean:

    Random Jump Capx

    I tried removing solid behavior and manually handling the push through checking for collisions/overlapping but this breaks the ability for the player to jump on top of the bullet. I could go through the trouble of trying to create multiple invisible collision boxes for the sides of the object, but given that I have a lot of differently shaped bullets, this is really more heavyweight than I would like.

    Anyone have a simple solution for this?

    Thanks,

    -- cacotigon

  • yeah, for all intents and purposes scope doesn't change. It's more of a "hey I'm OCD and I want to organize these global vars in a global event sheet" kind of thing.

  • If the global variable is already in use, there is no way to copy it to a different event sheet since deleting it will remove all events associated with that variable, and attempting to copy results in duplicate global variable error message.

    Specs:

    Construct 2 r105 64-bit

    Windows 7 Home Premium 64-bit

    Intel Celeron

  • Right-clicking on bounding points if Construct 2 is on second monitor fails to show the Context menu (add point, clear, etc)

    Moving the Edit Image Window onto the primary monitor fixes the problem.

    Maximizing Construct on the 2nd monitor also causes a problem where it stretches halfway onto the primary monitor.

    Specs:

    Construct 2 r105 64-bit

    Windows 7 Home Premium 64-bit

    Intel Celeron

  • I have a suggestion for the forums. I think that the How-Do-I forum should be broken into two boards:

    Beginners

    Advanced

    I see a lot of repetition in the current How-Do-I forum, and I'd say 80% of the time, the questions are fairly basic, aka, questions involving basic plugin/behavior functionality (moving your sprite, animating, setting up conditional events, etc).

    It would be nice to have a separate board for more complex questions and discussions, especially from an organizational point of view.

    -- cacotigon

cacotigon's avatar

cacotigon

Member since 10 Mar, 2009

None one is following cacotigon yet!

Connect with cacotigon

Trophy Case

  • 15-Year Club
  • x2
    Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies