Page 1 of 1

[waitlist]Cinder Elemental AI we don't see value for x

PostPosted: 13 Aug 2016, 07:29
by Aswan jaguar
Describe the Bug:
Cinder Elemental when AI pays x we don't get to see what paid for x value.

Which card did behave improperly ?
Cinder Elemental

Which update are you using?(date,name)Which type(Duel,Gauntlet,Sealed Deck)
Manalink 2016/08/07: Eldritch Moon, duel

What exactly should be the correct behavior/interaction ?
When AI activates Cinder Elemental we get to see what value AI picked for x.

Are any other cards possibly affected by this bug ?
-

Re: Cinder Elemental AI we don't see value for x

PostPosted: 13 Aug 2016, 08:18
by Korath
If I remember correctly, the AI-pays-|X dialog for activation is the same issue I talk about here. More trouble than it's worth.

Re: Cinder Elemental AI we don't see value for x

PostPosted: 13 Aug 2016, 08:22
by Aswan jaguar
If I am not wrong I believe you are confusing it with the random target card that shows when AI casts spells that target.Besides there are cards with X value that show the value for X (I don't remember however if those target or not).

Re: Cinder Elemental AI we don't see value for x

PostPosted: 13 Aug 2016, 08:42
by Korath
Amount chosen for X and which targets are chosen use the same AI stack, and still hardly anything tries to populate it in Manalink during EVENT_SELECTED CARD. I'm only seeing clockwork creatures (Clockwork Horse, Clockwork Swarm, Clockwork Avian, and Clockwork Steed); Candelabra of Tawnos; Helix Pinnacle; and Goblin Polka Band. (And Goblin Polka Band looks like it's probably populating it wrong.) Maybe some of the cards that have wrappers in C just for the sake of having wrappers in C, and call back into the original card in the executable to do the real work, too.

Re: Cinder Elemental AI we don't see value for x

PostPosted: 11 Sep 2016, 17:13
by Korath
To get this working as well as it can (short of using the multiplayer version of that popup like in Shandalar), you need to:
  • Make sure the card's flagged EA_ACT_USE_X. This just determines whether an X value is shown at all, not which number is shown for it.
  • Make the card respond to EVENT_SELECTED_CARD by calling dword_60A438 to the proper value.
    • If that proper value is computed in C during activation, then you need to duplicate that calculation (and you won't be able to, if it depends on something chosen by the AI, like a target).
    • If the card just calls charge_mana(player, COLOR_COLORLESS, -1) and that's the very first thing that the EVENT_ACTIVATE handler does, you can peek forward at the number it'll pick by calling EXE_FN(void, 0x499010, int)(0); as in card_candelabra_of_tawnos().
  • Test it for each card you use this with, and for each different ability if it has more than one; at least a third of the time, you'll get the wrong value, it'll display random-looking garbage and maybe also crash if it also tries to display a target, you've just made things much worse instead of very slightly better, and there's nothing you'll be able to do.