Page 1 of 1

Script reference - better documentation needed!

PostPosted: 07 Feb 2015, 20:53
by pufthemajicdragon
I'm trying to teach myself this scripting language as best as I can by making custom cards with custom effects. The trouble is that referencing existing cards doesn't give me much guidance, and there are a million key words, commands, and functions that aren't documented on the wiki.

The ones I'm having trouble with right now are imprinting and remembering cards. But there are so many others that I have trouble with too. Is there an existing reference somewhere that includes all of these functions? Or is it just a trial and error kind of thing?

Re: Script reference - better documentation needed!

PostPosted: 13 Feb 2015, 08:04
by Hellfish
It's mostly trial and error / copy pasting, unfortunately. I'll hopefully be able to take an hour this weekend to update at least the trigger wiki page, I just gotta catch up with the added triggers.

What is the problem with imprinting/remembering, specifically?

Re: Script reference - better documentation needed!

PostPosted: 13 Feb 2015, 12:00
by Hexadecimal
Forgive my ignorance, but where can I find the wiki ?

Re: Script reference - better documentation needed!

PostPosted: 13 Feb 2015, 12:17
by elcnesh
Hexadecimal wrote:Forgive my ignorance, but where can I find the wiki ?
http://www.slightlymagic.net/wiki/Forge_API ;)

Re: Script reference - better documentation needed!

PostPosted: 17 Feb 2015, 18:34
by pufthemajicdragon
Trial and error has hit a dead end :(

I'm trying to create a custom planeswalker with the ability to put a token into play, which token grants a bonus to its controller's creatures based on the number of loyalty counters on the planeswalker.

Text: -5 loyalty counters: Put an enchantment token into play with: "Each creature you control gains +1/+1 for each loyalty counter on Custom Planeswalker"

When I create the token, I call "ImprintToken" so Planeswalker can always reference its tokens. But I need a way to remember the Planeswalker on the token, so the token knows how many loyalty counters are on Planeswalker. Now I've looked at the code for almost every card that uses the Remember or Imprint key words and for the life of me I can't figure out how they work.

Best guess of how it might look (but this doesn't work):
Code: Select all
A:AB$ Token | Cost$ SubCounter<5/LOYALTY> | Planeswalker$ True | TokenAmount$ 1 | TokenName$ Custom Planeswalker Token | TokenTypes$ Enchantment | TokenOwner$ You | TokenColors$ White | ImprintTokens$ True | Ultimate$ True | SpellDescription$ Put an enchantment token onto the battlefield under your control with "Creatures you control get +1/+1 for each loyalty counter on Custom Planeswalker."
S:Mode$ Continuous | Affected$ Card.IsImprinted | AddStaticAbility$ STPump | AddSVar$ Y & YCleanup
SVar:STPump:Mode$ Continuous | ImprintCards$ OriginalHost | Affected$ Creature.YouCtrl | AddPower$ Y | AddToughness$ 1 | Description$ Creatures you control get +1/+1 for each loyalty counter on Custom Planeswalker.
SVar:Y:Count$TotalCounters_LOYALTY_Card.IsImprinted+namedCustom Planeswalker
With the above code, the token grants +0/+1 to each creature, so I know the pump is working, but the imprinting isn't. Archery Training has been one of the better references I've had to work with, but I've come to the conclusion that "OriginalHost" is a keyword used by auras and won't work for a global enchantment.

The best workaround idea I have is to mimic Saproling Burst and push the number of loyalty counters to the token by adding counters to the token, and then count those counters. But I'd much rather make it work natively.

Re: Script reference - better documentation needed!

PostPosted: 06 Mar 2015, 23:39
by Midori
I might be not as skilled at scripting, but have you looked at the code of Gutter Grime already?
Im refering to this line.
Code: Select all
SVar:GutterGrimePT:Remembered$CardCounters.SLIME
This is apparently the line that defines the variable P/T of the Ooze tokens according to the slime counters on Gutter Grime.

The Remembered card is defined in the token creation effect by RememberSource$ True.
Code: Select all
SVar:DBToken:DB$ Token | TokenAmount$ 1 | TokenName$ Ooze | TokenTypes$ Creature,Ooze | TokenOwner$ You | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1 | TokenImage$ G X X Ooze ISD | TokenSVars$ GutterGrimePT | RememberSource$ True | TokenStaticAbilities$ Static
I hope this is still helpful after all this time.

Re: Script reference - better documentation needed!

PostPosted: 06 Mar 2015, 23:46
by pufthemajicdragon
OMG that looks perfect! I think the "RememberSource$ True" command is exactly what I needed. I'll give it a whirl when I get home from work!
I'd been trying to find a card that closely matched what I was trying to do, but when there are 10,000+ card scripts to read through one by one....

:Edit:
Worked perfectly! You're my new hero!