Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
Re: Card Development Questions
by moomarc » 29 Nov 2011, 21:03
I know what you mean about real life keeping one too busy. Just landed a job for 3d animation integrated into live video that's going to keep me away from forge for a month at least other than the occasional script maybe. Going to be fun though.
-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 » 30 Nov 2011, 05:01
Ok. Definitely an issue with copySpellOnStack and StackInstances. It's probably not overwriting the "known" StackInstance of the Copy with it's own StackInstance when it's placed on the stack. Will look into it further when i have some more time.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Doublestrike » 30 Nov 2011, 06:36
Congrats!moomarc wrote:Just landed a job for 3d animation integrated into live video...
---
A joke is a very serious thing.
A joke is a very serious thing.
-

Doublestrike - UI Programmer
- Posts: 715
- Joined: 08 Aug 2011, 09:07
- Location: Bali
- Has thanked: 183 times
- Been thanked: 161 times
Re: Card Development Questions
by jeffwadsworth » 30 Nov 2011, 23:26
Sweet. See if you can easter egg Forge in there somewhere. Haha.moomarc wrote:I know what you mean about real life keeping one too busy. Just landed a job for 3d animation integrated into live video that's going to keep me away from forge for a month at least other than the occasional script maybe. Going to be fun though.
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Re: Card Development Questions
by ArsenalNut » 01 Dec 2011, 07:57
I am trying to script Civilized Scholar//Homicidal Brute but the script is causing a crash that I can't figure out.
I traced the crash to a problem in the setStateResolve method. For some reason the mode string retrieved from the parameters map is null instead of "Transform". I am having the same issue with Mayor of Avabruck crashing but Daybreak Ranger and Gatstaf Shepherd work fine. This is really confusing since the first SetState script lines are identical between Mayor of Avabruck and Gatstaf Shepherd.
Can someone test if Mayor is crashing in r12354 or later? I'd like to know if it's my Eclipse environment or a real problem.
- Civilized Scholar//Homicidal Brute | Open
- Name:Civilized Scholar
ManaCost:2 U
Types:Creature Human Advisor
Text:no text
PT:0/1
A:AB$ Draw | Cost$ T | NumCards$ 1 | SubAbility$ DBDiscard | SpellDescription$ Draw a card, then discard a card. If a creature card is discarded this way, untap CARDNAME, then transform it.
SVar:DBDiscard:DB$Discard | Defined$ You | Mode$ TgtChoose | NumCards$ 1 | RememberDiscarded$ True | SubAbility$ DBUntap
SVar:DBUntap:DB$ Untap | Cost$ 0 | Defined$ Self | ConditionDefined$ Remembered | ConditionPresent$ Card.Creature | ConditionCompare$ EQ1 | SubAbility$ DBTransform
SVar:DBTransform:DB$ SetState | Cost$ 0 | Defined$ Self | ConditionDefined$ Remembered | ConditionPresent$ Card.Creature | ConditionCompare$ EQ1 | SubAbility$ DBCleanup | Mode$ Transform
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
AlternateMode:DoubleFaced
SVar:Picture:http://www.wizards.com/global/images/magic/general/civilized_scholar.jpg
SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/47a.jpg
Oracle:{T}: Draw a card, then discard a card. If a creature card is discarded this way, untap Civilized Scholar, then transform it.
ALTERNATE
Name:Homicidal Brute
ManaCost:no cost
Colors:red
Types:Creature Human Mutant
Text:no text
PT:5/1
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigTap | isPresent$ Card.Self+notAttackedThisTurn | TriggerDescription$ At the beginning of your end step, if CARDNAME didn't attack this turn, tap CARDNAME, then transform it.
SVar:TrigTap:AB$ Tap | Cost$ 0 | Defined$ Self | SubAbility$ DBTransform
SVar:DBTransform:DB$ SetState | Cost$ 0 | Defined$ Self
SVar:Picture1:http://www.wizards.com/global/images/magic/general/homicidal_brute.jpg
SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/47b.jpg
Oracle:At the beginning of your end step, if Homicidal Brute didn't attack this turn, tap Homicidal Brute, then transform it.
End
I traced the crash to a problem in the setStateResolve method. For some reason the mode string retrieved from the parameters map is null instead of "Transform". I am having the same issue with Mayor of Avabruck crashing but Daybreak Ranger and Gatstaf Shepherd work fine. This is really confusing since the first SetState script lines are identical between Mayor of Avabruck and Gatstaf Shepherd.
Can someone test if Mayor is crashing in r12354 or later? I'd like to know if it's my Eclipse environment or a real problem.
So many cards, so little time
-

ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Card Development Questions
by Hellfish » 01 Dec 2011, 08:53
Arsenal, this is probably due to the recent remodeling in how SVars are stored. They are no longer split between CardCharacteristics but there is a single set in the Card object, which means that if you have multiple SVars of the same name, the last one will overwrite all the others even if they are on separate card states. So your Civilized Scholar DBTransform SVar is overwritten by your Homicidal Brute DBTransform SVar, which is missing the Mode parameter, causing the crash. I will fix the Mayor and comb through the other transformers.
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 Iran » 01 Dec 2011, 13:33
Urge to Feed, Bloodbond March and Blood Tribute. Anyone see any problem to script them?
Can I script Urge to Feed like a cost? the part of tap any number of vampires to put +1/+1 on them.
Can I script Urge to Feed like a cost? the part of tap any number of vampires to put +1/+1 on them.
Re: Card Development Questions
by ArsenalNut » 01 Dec 2011, 13:54
Thanks. Making different SVar names solved the crashing issue. Now, the transformation trigger for Homicidal Brute always fires even if it attacked. I suspect there may be an issue with "Self" in the transformed state. I noticed earlier that if I changed Civilized Scholar to untap after the transform that the untap didn't occur.Hellfish wrote:Arsenal, this is probably due to the recent remodeling in how SVars are stored. They are no longer split between CardCharacteristics but there is a single set in the Card object, which means that if you have multiple SVars of the same name, the last one will overwrite all the others even if they are on separate card states. So your Civilized Scholar DBTransform SVar is overwritten by your Homicidal Brute DBTransform SVar, which is missing the Mode parameter, causing the crash. I will fix the Mayor and comb through the other transformers.
So many cards, so little time
-

ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Card Development Questions
by Hellfish » 01 Dec 2011, 15:43
Try placing the Self property last, i.e. "Card.notAttackedThisTurn+Self". That has caused problems before.
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 » 01 Dec 2011, 15:51
@Sloth: Do your recent PTK card commits enforce the "only if you've been attacked this step" part?
-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 » 01 Dec 2011, 16:11
Sloth is using a trick in the rules that skip over the rest of combat if no Attackers are Declared. So it's not explicitly doing it, but it should work as expected.moomarc wrote:@Sloth: Do your recent PTK card commits enforce the "only if you've been attacked this step" part?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by moomarc » 01 Dec 2011, 16:15
Nifty trickfriarsol wrote:Sloth is using a trick in the rules that skip over the rest of combat if no Attackers are Declared. So it's not explicitly doing it, but it should work as expected.moomarc wrote:@Sloth: Do your recent PTK card commits enforce the "only if you've been attacked this step" part?

-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 jeffwadsworth » 02 Dec 2011, 00:11
Testing Primordial Ooze.
Apparently, UnlessCost$ does not work within SubAbilities. Does anyone see a solution here? Note that the P1P1 must be put on the card before anything else is done.
- | Open
- Name:Primordial Ooze
ManaCost:R
Types:Creature Ooze
Text:no text
PT:1/1
K:CARDNAME attacks each turn if able.
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigPutCounter | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, put a +1/+1 counter on CARDNAME. Then you may pay X, where X is the number of +1/+1 counters on it. If you don't, tap CARDNAME and it deals X damage to you.
SVar:TrigPutCounter:AB$ PutCounter | Cost$ 0 | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ DBPayUp
SVar:DBPayUp:DB$ Tap | UnlessCost$ X | UnlessPayer$ You | SubAbility$ DBDamage
SVar:DBDamage:DB$ DealDamage | Defined$ You | NumDmg$ X
SVar:X:Count$CardCounters.P1P1
SVar:RemAIDeck:True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/primordial_ooze.jpg
End
Apparently, UnlessCost$ does not work within SubAbilities. Does anyone see a solution here? Note that the P1P1 must be put on the card before anything else is done.
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Re: Card Development Questions
by ArsenalNut » 02 Dec 2011, 03:24
Turns out I didn't capitalize "IsPresent"Hellfish wrote:Try placing the Self property last, i.e. "Card.notAttackedThisTurn+Self". That has caused problems before.

So many cards, so little time
-

ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Card Development Questions
by Sloth » 02 Dec 2011, 07:15
If I remember correctly subabilities and unless costs don't work together well (even if it would work in DBPayUp, DBDamage would always fire regardless of the unless cost being paid).jeffwadsworth wrote:Testing Primordial Ooze.
- | Open
- Name:Primordial Ooze
ManaCost:R
Types:Creature Ooze
Text:no text
PT:1/1
K:CARDNAME attacks each turn if able.
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigPutCounter | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, put a +1/+1 counter on CARDNAME. Then you may pay X, where X is the number of +1/+1 counters on it. If you don't, tap CARDNAME and it deals X damage to you.
SVar:TrigPutCounter:AB$ PutCounter | Cost$ 0 | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ DBPayUp
SVar:DBPayUp:DB$ Tap | UnlessCost$ X | UnlessPayer$ You | SubAbility$ DBDamage
SVar:DBDamage:DB$ DealDamage | Defined$ You | NumDmg$ X
SVar:X:Count$CardCounters.P1P1
SVar:RemAIDeck:True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/primordial_ooze.jpg
End
Apparently, UnlessCost$ does not work within SubAbilities. Does anyone see a solution here? Note that the P1P1 must be put on the card before anything else is done.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Who is online
Users browsing this forum: No registered users and 59 guests