It is currently 12 Sep 2025, 23:49
   
Text Size

Issue 113 Converting Hardcoded Cards to AFs/Trigger

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby friarsol » 05 Feb 2011, 04:42

Part of streamlining all of the cards into the new data structures, we have to convert all of the old cards that are now able to be scripted. I'll try to go through some of these so we can have people start knocking them off. These will need both updated .txt file and removal of a block from the appropriate CardFactory. Feel free to do some of these along with the new cards, as they are just as helpful

Code: Select all
Accursed Centaur
Affa Guard Hound
Arctic Nishoba
Aven Riftwatcher
Cemetery Reaper
Child of Alara
Chittering Rats
Commander Greven il-Vec
Corrupt Court Official
Crater Hellion
Cyclopean Mummy
Dakmor Ghoul
Deadly Grub
Denizen of the Deep
Doomsday Specter
Dromad Purebred
Eater of Days
Elvish Hunter
Filigree Angel
Flowstone Sculpture
Glory
Goblin Marshal
Haunted Angel
Highway Robber
Ichor Rats
Kargan Dragonlord
Kazandu Tuskcaller
Keening Banshee
Keiga, the Tide Star
Kjeldoran Dead
Kokusho, the Evening Star
Lava Hounds
Leveler
Lich Lord of Unx
Lockjaw Snapper
Maggot Carrier
Magma Giant
Malakir Bloodwitch
Mogg War Marshal
Mongrel Pack
Mudbutton Torchrunner
Mystic Snake
Nemata, Grove Guardian
Oros, the Avenger
Pallid Mycoderm
Phyrexian Gargantua
Phyrexian Rager
Phyrexian War Beast
Plague Spitter
Rathi Fiend
Ravenous Rats
Reveillark (although I think Chris was doing Evoke cards)
Roc Egg
Rootwater Thief
Ryusei, the Falling Star
Sengir Autocrat
Serra Avatar
Skizzik?
Slaughterhouse Bouncer
Sower of Temptation
Sphinx of Magosi
Spined Fluke
Spitting Spider
Stangg
Subterranean Spirit
Symbiotic Elf
Symbiotic Wurm
Thelonite Hermit
Thunder Dragon
Thundermare
Timbermare
Totem-Guide Hartebeest
Tuktuk the Explorer
Undying Beast
Venerated Teacher
Vindictive Mob
Vodalian Merchant
Vorosh, the Hunter
Vulshok Heartstoker
Edit: List now sorted.
Last edited by friarsol on 05 Feb 2011, 15:50, edited 1 time in total.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby Chris H. » 05 Feb 2011, 13:15

Yeah, I am trying to finish off the evoke cards at this time. There are several evoke cards that I will not be able to add:

Dawnfluke
Slithermuse

After I finish the last several evoke cards that I can handle I would like to spend some time on maintenance. We have some cards that are using TgtP with non-damage type AF sa's. We are asked to to choose a player or planeswalker and the ability is for example, discard. Ouch. :)

It may take me a few days to fix this. Afterwards I will work on the "enters the battlefield" type card conversions as they are similar to some of the evoke cards that I have done recently. After the "enters the battlefield" type cards I may do some more maintenance or I may jump into the "leaves the battlefield" type card conversions.

The frequent java heap errors that I am getting is making it difficult to play test my new cards and card conversions. I am not sure of what I can do to help alleviate my situation with these java heap errors. ](*,)
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby Zirbert » 05 Feb 2011, 16:49

I noticed that the Thallids are all partially hardcoded (the upkeep counter). I'm working on adding some of the missing ones anyway, so I'll convert the existing ones along the way.

Assuming I can get it working - for some reason, so far they keep getting *2* counters each upkeep. Here's what I used, pretty much cribbed/adapted from Trade Caravan:
Code: Select all
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ At the beginning of your upkeep, put a spore counter on CARDNAME.
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ SPORE | CounterNum$ 1 | SpellDescription$ Put a spore counter on CARDNAME.
The ability only goes on the stack once, and it's only triggering during my upkeep, but for some reason 2 counters keep showing up. I'll keep looking at it, and post any results over in Card Contributions.

EDIT - OK, something's weird. It consistently adds 1 more counter than the value of CounterNum$. For 1 counter, I set it to 0, and it works. I really don't want to start posting cards that way, though, since I figure there's something I'm not seeing...
Zirbert
 
Posts: 512
Joined: 13 Oct 2010, 16:04
Has thanked: 104 times
Been thanked: 19 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby friarsol » 05 Feb 2011, 17:12

Zirbert wrote:Assuming I can get it working - for some reason, so far they keep getting *2* counters each upkeep.
If the upkeep is hardcoded, then the hardcoded section will still always add 1 counter. We need to remove that whole section and do all of the Fungi in one fell swoop.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby Hellfish » 05 Feb 2011, 17:16

EDIT: Beaten by Sol, again :lol:
Yeah, it's because the hardcoded counter-adding is still in there. (GameActionUtil.upkeep_Spore_Counters(), if you're up for it) I tested your trigger with Thallid Devourer and it worked fine.
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
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby Zirbert » 05 Feb 2011, 17:16

friarsol wrote:
Zirbert wrote:Assuming I can get it working - for some reason, so far they keep getting *2* counters each upkeep.
If the upkeep is hardcoded, then the hardcoded section will still always add 1 counter. We need to remove that whole section and do all of the Fungi in one fell swoop.
OK, I'll leave them alone for now. The weird part is that I was trying to do Feral Thallid, which isn't in Forge yet. There must have already been some hardcoding in place for it, though - maybe whoever hardcoded the Thallid upkeep ability just included them all in the list for if / when they got added.
Zirbert
 
Posts: 512
Joined: 13 Oct 2010, 16:04
Has thanked: 104 times
Been thanked: 19 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby Hellfish » 05 Feb 2011, 17:18

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
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby Zirbert » 05 Feb 2011, 17:19

Hellfish wrote:EDIT: Beaten by Sol, again :lol:
Yeah, it's because the hardcoded counter-adding is still in there. (GameActionUtil.upkeep_Spore_Counters(), if you're up for it)
Nope, not a chance of me poking around under the hood! I'll stick with plain-text scripting, thanks. I'm glad to know it wasn't just me not understanding the API this time!


EDIT: Aha! Spore Flower isn't listed as hardcoded! Dibs! And Sporoloth Ancient looks like an interesting challenge - I think I can do it, based on how Slivers pass around abilities.

Thanks again, guys!
Zirbert
 
Posts: 512
Joined: 13 Oct 2010, 16:04
Has thanked: 104 times
Been thanked: 19 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby friarsol » 05 Feb 2011, 17:29

I'll edit it since it's just a copy/paste job.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby Chris H. » 08 Feb 2011, 01:01

Chris H. wrote:After I finish the last several evoke cards that I can handle I would like to spend some time on maintenance

Afterwards I will work on the "enters the battlefield" type card conversions as they are similar to some of the evoke cards that I have done recently.
`
I have started to convert the etb cards in the list above.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby Chris H. » 08 Feb 2011, 02:49

I am in the process of converting Affa Guard Hound. My test deck consists of 3 Affa Guard Hound, 3 Goldenglow Moth and 3 plains. When my Affa Guard Hound etb I can successfully pump one of my Goldenglow Moth +0/+3.

The AI is not targeting anything with it's Affa Guard Hound. The AI put all 3 of its Goldenglow Moth into play first and then summoned its first Affa Guard Hound. The stack had the statement "(Targetin)" at the end of its stack desc but there was no target. Hovering my mouse pointer over its 4 creatures show that none of them recieved the buff.

I waited to the following turn and the AI summoned its 2nd Affa Guard Hound and the same thing happened. It is not targeting a creature and no creature receives the buff.

Code: Select all
Name:Affa Guard Hound
ManaCost:2 W
Types:Creature Hound
Text:no text
PT:2/2
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigPump | TriggerDescription$ When CARDNAME enters the battlefield, target creature gets +0/+3 until end of turn.
SVar:TrigPump:AB$Pump | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumDef$ +3
K:Flash
SVar:PlayMain1:TRUE
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/affa_guard_hound.jpg
SetInfo:ROE|Uncommon|http://magiccards.info/scans/en/roe/14.jpg
End
`
Attachments
Stack.jpg
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby friarsol » 08 Feb 2011, 05:04

Pump hooks aren't setup yet. I'll try to do them next, but it probably will have to wait for Wednesday since I'm in the city for most of the day tomorrow and busy once I get back. I'll let you know when they are ready to go.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby Chris H. » 15 Feb 2011, 13:26

I attempted to convert Mystic Snake:

Mystic Snake Card | Open
Name:Mystic Snake
ManaCost:1 G U U
Types:Creature Snake
Text:no text
PT:2/2
K:Flash
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigCounterspell | TriggerDescription$ When CARDNAME enters the battlefield, counter target spell.
SVar:TrigCounterspell:AB$Counter | Cost$ 0 | Type$ Spell | Destination$ Graveyard
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/mystic_snake.jpg
SetInfo:APC|Rare|http://magiccards.info/scans/en/ap/112.jpg
SetInfo:TSB|Special|http://magiccards.info/scans/en/tsts/97.jpg
End

`
I held off on this card for awhile, tried it today with my fingers crossed. It did not work. AF_Counter may not be set up to handle this type of situation. When play tested I got this error exception as the trigger resolved.


Mystic Snake Error Exception | Open
An error has occured. You can copy/paste this message or save it to a file.
Please report this, plus what you tried to do, to:
viewforum.php?f=26
If you don't want to register an account, you can mail it directly to
mtgerror@yahoo.com


null


Version:
Forge -- official beta: $Date: 2011-01-06 11:34:48 -0500 (Thu, 06 Jan 2011) $, SVN revision: $Revision: 4891 $

OS: Mac OS X Version: 10.6.6 Architecture: x86_64

Java Version: 1.6.0_22 Vendor: Apple Inc.

Detailed error trace:
java.lang.NullPointerException
at forge.AbilityFactory_CounterMagic.counterStackDescription(AbilityFactory_CounterMagic.java:225)
at forge.AbilityFactory_CounterMagic.access$1(AbilityFactory_CounterMagic.java:215)
at forge.AbilityFactory_CounterMagic$1.getStackDescription(AbilityFactory_CounterMagic.java:67)
at forge.TriggerHandler.runSingleTrigger(TriggerHandler.java:255)
at forge.TriggerHandler.runTrigger(TriggerHandler.java:201)
at forge.GameAction.moveTo(GameAction.java:77)
at forge.GameAction.moveToPlay(GameAction.java:245)
at forge.Spell_Permanent.resolve(Spell_Permanent.java:215)
at forge.MagicStack.resolveStack(MagicStack.java:666)
at forge.Phase.passPriority(Phase.java:514)
at forge.ComputerAI_General.stackResponse(ComputerAI_General.java:286)
at forge.ComputerAI_General.stack_not_empty(ComputerAI_General.java:241)
at forge.ComputerAI_Input.think(ComputerAI_Input.java:43)
at forge.ComputerAI_Input.showMessage(ComputerAI_Input.java:31)
at forge.GuiInput.setInput(GuiInput.java:27)
at forge.GuiInput.update(GuiInput.java:21)
at java.util.Observable.notifyObservers(Observable.java:142)
at java.util.Observable.notifyObservers(Observable.java:98)
at forge.MyObservable.updateObservers(MyObservable.java:9)
at forge.InputControl.resetInput(InputControl.java:52)
at forge.Phase.passPriority(Phase.java:505)
at forge.Input_PassPriority.selectButtonOK(Input_PassPriority.java:35)
at forge.GuiInput.selectButtonOK(GuiInput.java:35)
at forge.GuiDisplay4.okButtonActionPerformed(GuiDisplay4.java:946)
at forge.GuiDisplay4.access$3(GuiDisplay4.java:945)
at forge.GuiDisplay4$25.actionPerformed(GuiDisplay4.java:733)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6352)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6117)
at java.awt.Container.processEvent(Container.java:2085)
at java.awt.Component.dispatchEventImpl(Component.java:4714)
at java.awt.Container.dispatchEventImpl(Container.java:2143)
at java.awt.Component.dispatchEvent(Component.java:4544)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4621)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
at java.awt.Container.dispatchEventImpl(Container.java:2129)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4544)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby Chris H. » 15 Feb 2011, 21:45

Chris H. wrote:Afterwards I will work on the "enters the battlefield" type card conversions as they are similar to some of the evoke cards that I have done recently. After the "enters the battlefield" type cards I may do some more maintenance or I may jump into the "leaves the battlefield" type card conversions.
`
OK, I have finished the EtB conversions. There were three of them that will have to wait until some code is added.

Affa Guard Hound
Keening Banshee
Mystic Snake

I will now spend some time on card file maintenance as there is several issues that I would like to try and address. Once I finish that I will move on to the simple LtB cards on Sol's list.

I will post a modified version of Sol's list below:

modified version of Sol's list | Open
LtB Arctic Nishoba
LtB Child of Alara
LtB Cyclopean Mummy
LtB Deadly Grub
LtB Haunted Angel
LtB Keiga, the Tide Star
LtB Kokusho, the Evening Star
Done LtB Lockjaw Snapper
LtB Mongrel Pack
LtB Phyrexian War Beast
LtB Roc Egg
Done LtB Ryusei, the Falling Star
LtB Slaughterhouse Bouncer
LtB Symbiotic Elf
LtB Symbiotic Wurm
LtB Tuktuk the Explorer
LtB Undying Beast

EtB + LtB Aven Riftwatcher
EtB + LtB Goblin Marshal
EtB + LtB Mogg War Marshal
EtB + LtB Sengir Autocrat
EtB + LtB Stangg

EtB + ? Doomsday Specter
LtB + ? Plague Spitter

? Cemetery Reaper
? Dromad Purebred
? Elvish Hunter
? Flowstone Sculpture
? Glory
? Kargan Dragonlord
? Kazandu Tuskcaller
? Lich Lord of Unx
? Nemata, Grove Guardian
? Oros, the Avenger
? Pallid Mycoderm
? Rootwater Thief
? Serra Avatar
? Skizzik ?
? Sphinx of Magosi
? Thelonite Hermit
? Vorosh, the Hunter

? Chub Toad


The cards at the top of the list (LtB) are the ones that I will start working on in a few days. Below this we have some combo EtB + LtB cards that should be a little more work. The cards with the question mark will require other portions of the trigger code that I am not yet familiar with.

I would not mind if someone were to take a shot at a few of the cards at the bottom of the list. 8)
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby jeffwadsworth » 16 Feb 2011, 03:47

I will start with the ? cards. Kargan Dragonlord, Nemata are done already. Rootwater Thief refuses to work correctly with a script that looks okay, so it will have to stay put for now.
Last edited by jeffwadsworth on 17 Feb 2011, 14:46, edited 3 times in total.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 59 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 59 users online :: 0 registered, 0 hidden and 59 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 59 guests

Login Form