Page 1 of 1

Issue with Custom Card Script Failing to Execute

PostPosted: 27 Jun 2024, 05:22
by seleeenaaa112
Helllo,

I am currently working on a custom card script for MTG Forge ; and I am facing an issue where the script fails to execute properly. Below are the details:
Card Name: Mystic Apprentice
Script:

<CARD>
<NAME>Mystic Apprentice</NAME>
<TYPE>Creature</TYPE>
<SUBTYPE>Human Wizard</SUBTYPE>
<COST>{1}{U}</COST>
<POWER>2</POWER>
<TOUGHNESS>2</TOUGHNESS>
<TEXT>
Whenever Mystic Apprentice enters the battlefield, draw a card.
</TEXT>
<CODE>
AB$ Draw | Cost$ 0 | NumCards$ 1 | SubAbility$ SBTrigger
SB$ Trigger | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ DrawCard
SB$ DrawCard | NumCards$ 1
</CODE>
</CARD>

When I test the card ; it appears on the battlefield but the draw effect doesn't trigger. There are no errors displayed in the console; and I am not sure where the script is going wrong.
I have Verified the syntax of the script. Checked other similar card scripts to ensure consistency. Restarted MTG Forge to clear any cached data.

Could anyone help me identify what might be wrong with this script or suggest debugging steps I could take?


Thanks in advance for your assistance!


Thank you
seleeenaa

Re: Issue with Custom Card Script Failing to Execute

PostPosted: 28 Jun 2024, 05:28
by Marek14
That is not a trigger. That is an activated ability (AB$) with zero activation cost.

For comparison, here is how the ability is written for Merchant of Secrets:
Code: Select all
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDraw | TriggerDescription$ When CARDNAME enters the battlefield, draw a card.
SVar:TrigDraw:DB$ Draw | Defined$ You | NumCards$ 1
Note:
"T:" -- this is used to define triggers.
Variable names -- you have none. In particular, you have "SubAbility$ SBTrigger", but there is nothing called "SBTrigger" in the code.
Triggers have modes, without a mode, yours doesn't know that it's supposed to trigger on something changing zone. That's what "Mode$ ChangesZone" is for.
You use "DrawCard" but the actual effect is "Draw".