Jump to content

Weird, Weird problem


Recommended Posts

So this code problem has befuddled the Discord.

After asking Our patron saint of fan content, RageLeague, they said to ask the devs because this was a problem with the game.

so.to figure this out, I will leave this here.

Code for the Card

Spoiler

hallucinations =
    {
    name = "Hallucinations",
    desc = "Gain 3 {DISTRACTED}.",
    cost = 0,
    flags =CARD_FLAGS.STATUS | CARD_FLAGS.HATCH | CARD_FLAGS.PARASITE,
    rarity = CARD_RARITY.COMMON,
    OnPostResolve = function( self, minigame )
    self.negotiator:AddModifier( "DISTRACTION", 3, self )
    end,
    },

Error Screen

Spoiler

20201007194138_1.thumb.jpg.6eb7009668cbb5ae9ddbe0f358e641cb.jpg

The card works fine used in debug. a little iffy, as it only makes 1 distracted instead of 3, but the card crashes the compendium whenever it scrolls to it.

Link to comment
Share on other sites

  • Developer

This should be fixed in the next experimental (the argument was only set up to be used by NPCs).

In your snippet above, I'm guessing it is meant to be adding the "DISTRACTED" modifier, not "DISTRACTION"?

When testing that card, one thing I noticed is that as written, Distracted will trigger due to playing the card itself, which might not be what you want.  If so, you could defer the application of the modifier like so:

Spoiler

        event_handlers =
        {
            [ EVENT.POST_RESOLVE ] = function( self, minigame, card )
                if card == self then
                    self.negotiator:AddModifier( "DISTRACTED", 3, self )
                end
            end,
        }

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...