Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by friarsol » 26 Sep 2012, 01:57
Ok so I added the References and realized that Myr Welder doesn't work in this scenario because Myr Welder gains all of the important references by Remembering the Exiled Helm of Obedience, but part of the Helm's ability clears out the Remembered objects while it's resolving. So basically the ability starts activating, then all of the remembered/references are wiped, and then nothing else happens after that. Additionally, the Helm is no longer remembered after the ability is activated (and fails to do anything) the first time. I'm going to commit what I have, and if we can think of a solution that'd be good. I'm not sure what other cards have activated abilities that depend on clearing the Remembered Objects, but they would suffer the same issues.Hellfish wrote:Any ability or subability that references any of the svars from TargetedLibrary through to X needs a References$ parameter naming them. (Come on Myr Welder , work!)
Also, holy shit.
Additionally, the popup window to choose abilities doesn't appear to have a max width. And when I activated the Welded Helm, the
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Hellfish » 26 Sep 2012, 10:22
Don't keep me in suspense!;-)
I'll look at it tonight, hopefully.
I'll look at it tonight, hopefully.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Card Development Questions
by moomarc » 26 Sep 2012, 10:32
Should be easy enough to make the Welder imprint the card instead of remembering it. That should fix this case at least.friarsol wrote:Ok so I added the References and realized that Myr Welder doesn't work in this scenario because Myr Welder gains all of the important references by Remembering the Exiled Helm of Obedience, but part of the Helm's ability clears out the Remembered objects while it's resolving.
SERIOUS cliffhanger there!friarsol wrote:And when I activated the Welded Helm, the...

-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Card Development Questions
by moomarc » 26 Sep 2012, 11:35
Well, I've converted Myr Welder to use imprint instead, and that all works fine (I also added a static trigger to clear the imprinted cards if it leaves the battlefield). I couldn't test it with Helm of Obedience though because the Helm isn't working properly even if not imprinted by the Welder. Instead the AI's full library goes to the graveyard. I think that its the same issue as with Tree of Redemption where the References param is overwriting the svar set by StoreSVar AF.moomarc wrote:Should be easy enough to make the Welder imprint the card instead of remembering it. That should fix this case at least.friarsol wrote:Ok so I added the References and realized that Myr Welder doesn't work in this scenario because Myr Welder gains all of the important references by Remembering the Exiled Helm of Obedience, but part of the Helm's ability clears out the Remembered objects while it's resolving.SERIOUS cliffhanger there!friarsol wrote:And when I activated the Welded Helm, the...My guess is that it caused some sort of cosmic flux that started the next planar overlay!
EDIT: That's definitely the problem with the Helm at the moment. Removing those refs makes it work again but can't test it with the Welder because it doesn't have the refs. I tried a few things to fix the problem when I tracked it down for the tree, but nothing I tried worked. I'm sure one of you guys will crack it though.
LAST EDIT: When Myr Welder was using Remembered artifacts instead of imprinted ones could it use equip abilities? At the moment mine doesn't so I'll just post the script here for testing with the Helm at least.
- Myr Welder | Open
- Name:Myr Welder
ManaCost:3
Types:Artifact Creature Myr
Text:no text
PT:1/4
S:Mode$ Continuous | Affected$ Card.Self | EffectZone$ Battlefield | GainsAbilitiesOf$ Card.IsImprinted | GainsAbilitiesOfZones$ Exile | Description$ CARDNAME has all activated abilities of all cards exiled with it.
A:AB$ ChangeZone | Cost$ T | ValidTgts$ Artifact | Origin$ Graveyard | Destination$ Exile | TgtPrompt$ Select target artifact | Imprint$ True | PrecostDesc$ Imprint - | SpellDescription$ Exile target artifact card from a graveyard.
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Battlefield | Destination$ Any | Execute$ DBCleanup | Static$ True
SVar:DBCleanup:DB$ Cleanup | ClearImprinted$ True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/myr_welder.jpg
SetInfo:MBS|Rare|http://magiccards.info/scans/en/mbs/118.jpg
Oracle:Imprint -: Exile target artifact card from a graveyard.\nMyr Welder has all activated abilities of all cards exiled with it.
End
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Card Development Questions
by friarsol » 26 Sep 2012, 12:57
Haha Oops. I realized I could just fix the problem instead of complaining about it. Forgot I was in midsentence. The Repeat AF was using af.getHostCard() in the stack description instead of sa.getSourceCard(), so even though I activated the Welder, it said Helm of Obedience was activated.moomarc wrote:SERIOUS cliffhanger there!friarsol wrote:And when I activated the Welded Helm, the...My guess is that it caused some sort of cosmic flux that started the next planar overlay!
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Hellfish » 26 Sep 2012, 16:16
I've modded AF_StoreSVar to make things right between Tree of Redemption and abilitystealers at least. Gonna run a Helm of Obedience test next.
EDIT:Also, Sol, seems Essence Vortex didn't get added in your last commit.
EDIT: Okay, now the helm works on it's own and Myr Welder has the References it needs. Now I just need to figure out why AF_Repeat decides that it will end in an infinite loop when Myr Welder uses the ability.
EDIT:Also, Sol, seems Essence Vortex didn't get added in your last commit.
EDIT: Okay, now the helm works on it's own and Myr Welder has the References it needs. Now I just need to figure out why AF_Repeat decides that it will end in an infinite loop when Myr Welder uses the ability.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Card Development Questions
by friarsol » 26 Sep 2012, 18:11
::Cackles::Hellfish wrote:EDIT: Okay, now the helm works on it's own and Myr Welder has the References it needs. Now I just need to figure out why AF_Repeat decides that it will end in an infinite loop when Myr Welder uses the ability.
Oh yea, I just noticed Essence Vortex too. Thanks
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by friarsol » 26 Sep 2012, 18:14
On the quest to 80% here's crappy card from Ice Age: Goblin Sappers.
Here's my current script, but I need my delayed trigger to know who the original target was. Maybe someone can play around with it and get it working. The unblockable part was fine, just the end of combat destruction doesn't seem quite right.
Here's my current script, but I need my delayed trigger to know who the original target was. Maybe someone can play around with it and get it working. The unblockable part was fine, just the end of combat destruction doesn't seem quite right.
- Goblin Sappers | Open
- Name:Goblin Sappers
ManaCost:1 R
Types:Creature Goblin
Text:no text
PT:1/1
A:AB$ Pump | Cost$ R R T | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | KW$ HIDDEN Unblockable | SubAbility$ DelTrigBoth | SpellDescription$ Target creature you control is unblockable this turn. Destroy it and Goblin Sappers at end of combat.
A:AB$ Pump | Cost$ R R R R T | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | KW$ HIDDEN Unblockable | SubAbility$ DelTrigFriend | SpellDescription$ Target creature you control is unblockable this turn. Destroy it and Goblin Sappers at end of combat.
SVar:DelTrigFriend:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigDestroyFriend | TriggerDescription$ Destroy it at end of combat.
SVar:TrigDestroyFriend:DB$Destroy | Defined$ Targeted
SVar:DelTrigBoth:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Player | Execute$ TrigDestroySapper | TriggerDescription$ Destroy it and CARDNAME at end of combat.
SVar:TrigDestroySapper:DB$Destroy | Defined$ Self | SubAbility$ TrigDestroyFriend
SVar:RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/goblin_sappers.jpg
End
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Hellfish » 26 Sep 2012, 18:42
Leaving some notes for myself to pick back up after some housework.
AF_Repeat constructs the ability to repeat by grabbing an SVar from the AF's hostcard,which is Helm of Obedience. However, the routine that completes the ability's chain of subabilities tries to grab those from Myr Welder. Consequently, the subabilities where the counter SVars are incremented are never created (Nor the subs that actually DO anything either).
A few other AF's probably have this problem as well (Clash, Flip, more?).
AF_Repeat constructs the ability to repeat by grabbing an SVar from the AF's hostcard,which is Helm of Obedience. However, the routine that completes the ability's chain of subabilities tries to grab those from Myr Welder. Consequently, the subabilities where the counter SVars are incremented are never created (Nor the subs that actually DO anything either).
A few other AF's probably have this problem as well (Clash, Flip, more?).
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Card Development Questions
by friarsol » 29 Oct 2012, 02:32
I was looking into converting Split second to translate into a Static Ability, instead of the way we have it now (which isn't very clean). But it doesn't seem to quite work:
Not sure if this is due to the fact that the spell is on the Stack and isn't being checked, or what else it might be.
Similarly, I was trying to add Kaervek's Torch and it looks like it may suffer from the same issue:
- Replacement Split second | Open
- S:Mode$ CantBeActivated | ValidCard$ Card | NonMana$ True | EffectZone$ Stack | Description$ Split second (As long as this spell is on the stack, players can't cast spells or activate abilities that aren't mana abilities.)
S:Mode$ CantBeCast | ValidCard$ Card | Caster$ Player | EffectZone$ Stack
Not sure if this is due to the fact that the spell is on the Stack and isn't being checked, or what else it might be.
Similarly, I was trying to add Kaervek's Torch and it looks like it may suffer from the same issue:
- Kaervek's Torch | Open
- A:SP$ DealDamage | Cost$ X R | Tgt$ TgtCP | NumDmg$ X | References$ X | SpellDescription$ CARDNAME deals X damage to target creature or player.
SVar:X:Count$xPaid
S:Mode$ RaiseCost | ValidTarget$ Card.Self | Activator$ Player | Type$ Spell | Amount$ 2 | EffectZone$ Stack | Description$ As long as CARDNAME is on the stack, spells that target it costmore to cast.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Sloth » 29 Oct 2012, 12:47
Currently not all zones are checked for static effects. Just search for "RaiseCost" to see where to add some code.friarsol wrote:I was looking into converting Split second to translate into a Static Ability, instead of the way we have it now (which isn't very clean). But it doesn't seem to quite work:
- Replacement Split second | Open
- S:Mode$ CantBeActivated | ValidCard$ Card | NonMana$ True | EffectZone$ Stack | Description$ Split second (As long as this spell is on the stack, players can't cast spells or activate abilities that aren't mana abilities.)
S:Mode$ CantBeCast | ValidCard$ Card | Caster$ Player | EffectZone$ Stack
Not sure if this is due to the fact that the spell is on the Stack and isn't being checked, or what else it might be.
Similarly, I was trying to add Kaervek's Torch and it looks like it may suffer from the same issue:
- Kaervek's Torch | Open
- A:SP$ DealDamage | Cost$ X R | Tgt$ TgtCP | NumDmg$ X | References$ X | SpellDescription$ CARDNAME deals X damage to target creature or player.
SVar:X:Count$xPaid
S:Mode$ RaiseCost | ValidTarget$ Card.Self | Activator$ Player | Type$ Spell | Amount$ 2 | EffectZone$ Stack | Description$ As long as CARDNAME is on the stack, spells that target it costmore to cast.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by friarsol » 09 Nov 2012, 04:29
I thought I remembered seeing that we could handle UnlessCost inside subabilities? But I couldn't seem to get them to work for me for Fade Away. It looks like each of the repeat objects are looped through, each input is queued up, and then the SA finishes resolving. Then I can cancel out of each prompt and not need to sacrifice anything. Not sure if this is a different case due to how Repeat works, but just in case someone wants to play around with it here's the info:
The script is:
Along with this blurb in AbilityFactory.getDefinedPlayers()
The script is:
- Fade Away | Open
- Name:Fade Away
ManaCost:2 U
Types:Sorcery
A:SP$ RepeatEach | Cost$ 2 U | RepeatSubAbility$ DBSac | RepeatCards$ Creature | SpellDescription$ For each creature, its controller sacrifices a permanent unless he or she pays.
SVar:DBSac:DB$Sacrifice | UnlessCost$ 1 | UnlessPayer$ RememberedController | Defined$ RememberedController | SacValid$ Permanent
End
Along with this blurb in AbilityFactory.getDefinedPlayers()
- Code: Select all
} else if (defined.equals("RememberedController")) {
for (final Object rem : card.getRemembered()) {
if (rem instanceof Card) {
players.add(((Card) rem).getController());
}
}
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Max mtg » 11 Nov 2012, 07:08
forge.game.phase.Upkeep.upkeepOathOfGhouls() <= what is needed to make target opponent selectable and convert this into a script?
This method and another one reference
This method and another one reference
- Code: Select all
forge.game.GameState.compareTypeAmountInGraveyard(Player, String)
forge.game.GameState.compareTypeAmountInPlay(Player, String)
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Development Questions
by friarsol » 11 Nov 2012, 14:20
I'll take a look this morning. Should be able to use the blank Pump trick that Donate and similar use. Along with a Hidden Graveyard to Hand ChangeZone.Max mtg wrote:forge.game.phase.Upkeep.upkeepOathOfGhouls() <= what is needed to make target opponent selectable and convert this into a script?
This method and another one referenceTheese automatically select target opponent, but this is not good for multiplayer.
- Code: Select all
forge.game.GameState.compareTypeAmountInGraveyard(Player, String)
forge.game.GameState.compareTypeAmountInPlay(Player, String)
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by friarsol » 11 Nov 2012, 16:43
Oh right, we don't have a way right now to have a player other than the activating player to choose targets. Once that gets added Oath of Ghouls shouldn't be too bad to convert to script.friarsol wrote:I'll take a look this morning. Should be able to use the blank Pump trick that Donate and similar use. Along with a Hidden Graveyard to Hand ChangeZone.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Who is online
Users browsing this forum: No registered users and 12 guests