It is currently 05 Nov 2025, 13:04
   
Text Size

Card Development Questions

Post MTG Forge Related Programming Questions Here

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

Re: Card Development Questions

Postby 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
User avatar
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

Postby 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

Postby Doublestrike » 30 Nov 2011, 06:36

moomarc wrote:Just landed a job for 3d animation integrated into live video...
Congrats!
---
A joke is a very serious thing.
User avatar
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

Postby jeffwadsworth » 30 Nov 2011, 23:26

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.
Sweet. See if you can easter egg Forge in there somewhere. Haha.
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

Postby 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.

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
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Card Development Questions

Postby 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
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: Card Development Questions

Postby 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.
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby ArsenalNut » 01 Dec 2011, 13:54

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.
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.
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Card Development Questions

Postby 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
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: Card Development Questions

Postby 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
User avatar
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

Postby friarsol » 01 Dec 2011, 16:11

moomarc wrote:@Sloth: Do your recent PTK card commits enforce the "only if you've been attacked this step" part?
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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby moomarc » 01 Dec 2011, 16:15

friarsol wrote:
moomarc wrote:@Sloth: Do your recent PTK card commits enforce the "only if you've been attacked this step" part?
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.
Nifty trick =D>
-Marc
User avatar
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

Postby jeffwadsworth » 02 Dec 2011, 00:11

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.
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

Postby ArsenalNut » 02 Dec 2011, 03:24

Hellfish wrote:Try placing the Self property last, i.e. "Card.notAttackedThisTurn+Self". That has caused problems before.
Turns out I didn't capitalize "IsPresent" #-o
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Card Development Questions

Postby Sloth » 02 Dec 2011, 07:15

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.
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).
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

PreviousNext

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 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 59 guests

Login Form