Results 1 to 3 of 3

Thread: onObjectEnterContainer never fires for bottom card

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2018
    Location
    Melbourne, Australia
    Posts
    14

    onObjectEnterContainer never fires for bottom card

    This doesn't require anything complicated to reproduce, just two cards, it is reproducible 100% of the time.

    If one card is sitting on the table and you drop another on it, they will form a deck. In this circumstance `onObjectEnterContainer` should be called for both cards (before `onObjectDestroy`). However it's presently only called for the top card that falls and collides with the bottom card, it is never called for the bottom card. However, `onObjectDestroy` is correctly called for both cards, so it simply appears as though a user has deleted the bottom card.

    This is presently a show-stopper for my mod as I need to reliably track card instances around the table. My tracking is working great except in this particular circumstance because the way the events play out it's impossible to (with 100% certainty) discern a deck being formed from the user simply deleting the bottom card.

    Here's some logging I use to diagnose the problem. I have two cards, an "Enraged Nemeaek" sitting on the table, and a "Poor Weather Trooper" that I then drop on it.

    DEBUG: Card (6c149a) dropped in Drop Zone (53f425)
    DEBUG: Poor Weather Trooper (10) zone set to BattlefieldZone (53f425)
    DEBUG: Card (6c149a) entered Deck (nil)
    DEBUG: Poor Weather Trooper (10) entered Deck (nil)
    VERBOSE: Poor Weather Trooper (10) disassociated from Card (6c149a)
    VERBOSE: Poor Weather Trooper (10) associated with Deck (nil)
    DEBUG: Card (437f5f) removed from Drop Zone (53f425) as it's being destroyed
    DEBUG: Enraged Nemeaek (11) zone set to nil
    DEBUG: Destroying Enraged Nemeaek (11) as its associated Card (437f5f) is being destroyed
    VERBOSE: Enraged Nemeaek (11) disassociated from Card (437f5f)
    DEBUG: Enraged Nemeaek(11) destroyed.
    DEBUG: Card (6c149a) removed from Drop Zone (53f425) as it's being destroyed
    DEBUG: Deck (57fce4) entered Drop Zone (53f425)
    I should note that I'm not using GUIDs for anything in my mod, except save/restore and logging. So the GUIDs that appear in the log above (sometimes nil) are just to make the logs a little bit easier to read, my card tracking does not use them.

    As you can see in the logs, my "Enraged Nemeaek" card instance ends up being destroyed, "as its associated Card (437f5f) is being destroyed". This should not occur.

    If the `onObjectEnterContainer` event was fired for both cards, then the "Enraged Nemeaek" would have already been disassociated from the Card that's being destroyed, and instead associated with the newly created Deck. The logs demonstrate this procedure going off just fine for the "Poor Weather Trooper" i.e.

    DEBUG: Card (6c149a) entered Deck (nil)
    DEBUG: Poor Weather Trooper (10) entered Deck (nil)
    VERBOSE: Poor Weather Trooper (10) disassociated from Card (6c149a)
    VERBOSE: Poor Weather Trooper (10) associated with Deck (nil)
    Anyway, as I mentioned already, you don't need all this complicated "card tracking" functionality to reproduce this, just setup `onObjectEnterContainer` to print some text, then drop one card on another. You'll only see the text printed once, rather than twice as expected.
    Last edited by Benjamin Dobell; 09-29-2018 at 06:00 AM.

Similar Threads

  1. onObjectEnterContainer and improvements to onObjectLeaveContainer
    By my_hat_stinks in forum Scripting Suggestions
    Replies: 1
    Last Post: 12-26-2017, 03:04 PM
  2. Replies: 1
    Last Post: 07-15-2017, 09:58 PM
  3. Drawing bottom card sometimes shuffles deck
    By Jabrwock in forum Bug Reports
    Replies: 4
    Last Post: 04-20-2017, 09:56 AM
  4. Replies: 1
    Last Post: 12-23-2014, 05:07 PM
  5. [ADDED] [v2.2] Place card on bottom of deck
    By Grimshad in forum Suggestions
    Replies: 6
    Last Post: 11-20-2014, 11:55 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •