Giter VIP home page Giter VIP logo

Comments (7)

brine avatar brine commented on August 23, 2024

I should probably provide more info on that "attachment dictionary in use" error. Basically what's going on is the card attachment function accesses a global variable that's shared between players, which stores a list of each card and what it's attached to.

When you activate the attachment function, it grabs the attachment list and then LOCKS that variable, preventing other players from trying to manipulate it. Then the function processes, figuring out what card you targeted, then adding that relationship to the attachment list and then UNLOCKING it. So when you get that error message, it means that the script has failed and canceled out somewhere in between the locking and unlocking steps, permanently locking the attachment list.

All this being said, I've tried my best to seal up as many flaws/holes in the code as possible, but there will always be little corner cases that slip through and screw up card attachment (and alignment). What I'll need from you in order to fix this is to find out the situation that caused you to get this error.

  1. What function/hotkey did you/opponent use that gave this message? Most of the time it's gonna be the attach card function, but just in case.
  2. If #1 was "attach card", what was the LAST successful combination of cards that were attached?
  3. What did you and your opponent do in between these two steps?
    3.5) What specifically did you change about the combination of cards in #2?

If you can't remember the last situation that did it, just keep these steps in mind as it will probably happen again.

from mtg-octgn.

Kijer avatar Kijer commented on August 23, 2024

I just got it again, the specific error is
----Python Error----
Traceback (most recent call last):
TypeError: Value cannot be null.
attach(Card(133561), 196.976, -87.531)

----End Error----

When I was trying to attach a phantasmal image to a copy of gravecrawler, and then when I swung it aligned wonky so I basically tried to attach to the card it was already attached to.... I'm not surprised it crashed... (using ctrl+q)

Could we add an unlock clause to the pass-turn button? possibly have a backup of the variable, when going into the attach process?
[attach]
$global2=$global1
proceed to locking and further functions
[/attach]

then if anything goes wrong
[passTurn]
if $global1_locked = true
Unlock_Global($Global1)
$global1 = $global2
end_if
clearStack()
[/pass the turn]

(hypothetically coding, of course :p)

from mtg-octgn.

brine avatar brine commented on August 23, 2024

can you play around with that scenario to see if you can reliably replicate it? I can't get it to happen on my end, so we may need to meet at some point so I can see it.

from mtg-octgn.

brine avatar brine commented on August 23, 2024

I released a new version. It didn't directly fix your issue as I still haven't been able to locate it, but the update DID revamp the alignment and card attachment code. It may have inadvertently fixed it though, so give it a try and see if it still happens.

The issue with an unlock button is that the attachment dictionary that is shared between all players gets wiped clean each time it is accessed, and then replaced with an updated dictionary once the script finishes. The only way to actually unlock it again is to permanently wipe it, which would lose the links between all attachments already in play. I'd much rather plug all the potential holes in the code then resort to something that drastic

from mtg-octgn.

Kijer avatar Kijer commented on August 23, 2024

okay-- it seems better now. I was able to reliably get the error in .0.9 by attaching the targeted card to itself. This no longer occurs in .0.10

Cheers!

from mtg-octgn.

brine avatar brine commented on August 23, 2024

K good to hear :)
Now for the other two issues...

  1. i try to avoid auto-drawing as much as I can due to card drawing being irreversible by nature, for events where a card ability changes the way you draw cards during certain times. Other than that, the phase system should already be similar to what you described?

  2. that sounds more like an actual bug in OCTGNs code. If it happens again it would be better to post it in OCTGN's github issues instead

from mtg-octgn.

brine avatar brine commented on August 23, 2024

sounds like this is no longer an issue.

from mtg-octgn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.