It is currently 29 Oct 2025, 12:28
   
Text Size

A Little "Tool" to Assist with Testing Scripts

Post MTG Forge Related Programming Questions Here

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

A Little "Tool" to Assist with Testing Scripts

Postby moomarc » 13 Jan 2012, 17:52

I've found that at times it can be arduous to build decks for testing scripts so I've created a Developer's Little Helper:
Trained Kraj | Open
Code: Select all
Name:Trained Kraj
ManaCost:0
Types:Legendary Creature Kraj
Text:This card is for the developers to use for testing different situations that can't be done through normal DevMode functions:

#These should make the AI ignore it mostly but not die too easily:
PT:0/4
K:Hexproof
K:CARDNAME can't attack or block.

# Basic damage and gaining/losing life that will trigger life gain/loss counts:
A:AB$ GainLife | Cost$ 0 | ValidTgts$ Player | TgtPrompt$Target a player to gain a life | LifeAmount$ 1 | SpellDescription$ Target player gains 1 life.
A:AB$ LoseLife | Cost$ 0 | ValidTgts$ Player | TgtPrompt$Target a player to lose a life | LifeAmount$ 1 | SpellDescription$ Target player loses 1 life.
A:AB$ Poison | Cost$ 0 | ValidTgts$ Player | TgtPrompt$Target a player to poison | Num$ 1 | SpellDescription$ Target player gets a poison counter.
A:AB$ DealDamage | Cost$ 0 | Tgt$ TgtCP | NumDmg$ 1 | SpellDescription$ Deal 1 damage to target creature or player.

# Destroy and sacrifice:
A:AB$Destroy | Cost$ 0 | ValidTgts$ Permanent | TgtPrompt$ Select target permanent | SpellDescription$ Destroy target permanent.

# For returning cards to the battlefield or to player's hand:
A:AB$ ChangeZone | Cost$ 0 | ValidTgts$ Card | TgtPrompt$ Choose target card in a graveyard | Origin$ Graveyard | Destination$ Hand | SpellDescription$ Return target card from a graveyard to its owner's hand.
A:AB$ ChangeZone | Cost$ 0 | ValidTgts$ Card | TgtPrompt$ Select target permanent | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return target permanent to its owner's hand.
A:AB$ ChangeZone | Cost$ 0 | ValidTgts$ Permanent | TgtPrompt$ Choose target permanent in a graveyard | Origin$ Graveyard | Destination$ Battlefield | SpellDescription$ Return target permanent from a graveyard to the battlefield under its owner's control.
A:AB$ ChangeZone | Cost$ 0 | ValidTgts$ Permanent | TgtPrompt$ Choose target permanent in a graveyard | Origin$ Graveyard | Destination$ Battlefield | GainControl$ True | SpellDescription$ Return target permanent from a graveyard to the battlefield under your control.

# General:
A:AB$ Regenerate | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature | SpellDescription$ Regenerate target creature.
A:AB$ Token | Cost$ 0 | TokenAmount$ 1 | TokenName$ Test Subject | TokenTypes$ Creature,Test,Subject | TokenOwner$ You | TokenColors$ Colorless | TokenPower$ 1 | TokenToughness$ 1 | SpellDescription$ Put a 1/1 colorless token named Test Subject onto the battlefield under your control.
A:AB$ Token | Cost$ 0 | TokenAmount$ 1 | TokenName$ Test Subject | TokenTypes$ Creature,Test,Subject | TokenOwner$ Opponent | TokenColors$ Colorless | TokenPower$ 1 | TokenToughness$ 1 | SpellDescription$ Put a 1/1 colorless token named Test Subject onto the battlefield under your opponent's control.

# For testing color effected situations:
A:AB$ Animate | Cost$ 0 | Tgt$ TgtC | Colors$ White | SpellDescription$ Target creature is white.
A:AB$ Animate | Cost$ 0 | Tgt$ TgtC | Colors$ Blue | SpellDescription$ Target creature is blue.
A:AB$ Animate | Cost$ 0 | Tgt$ TgtC | Colors$ Black | SpellDescription$ Target creature is black.
A:AB$ Animate | Cost$ 0 | Tgt$ TgtC | Colors$ Red | SpellDescription$ Target creature is red.
A:AB$ Animate | Cost$ 0 | Tgt$ TgtC | Colors$ Green | SpellDescription$ Target creature is green.

# Return Developer's Little Helper to your hand if it dies or is exiled (static trigger):
T:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ KrajGrave | Static$ True | TriggerDescription$ Return Developer's Little Helper to your hand if it dies or is exiled.
T:Mode$ ChangesZone | Origin$ Any | Destination$ Exile | ValidCard$ Card.Self | Execute$ KrajExiled | Static$ True
SVar:KrajGrave:AB$ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Hand
SVar:KrajExiled:AB$ChangeZone | Cost$ 0 | Origin$ Exile | Destination$ Hand

SVar:RemAIDeck:True
SVar:RemRandomDeck:True
SVar:Picture:http://www.marc-fowler-design.com/cardforge/promos/trained_kraj.jpg
SetInfo:MBP|Special|http://www.marc-fowler-design.com/cardforge/promos/trained_kraj.jpg
End
He fills in the holes not covered by the dev mode. You can finally return creatures to play or to your hand at will. Destroy anything or deal damage to target anything. He even creates token critters for you (or your opponent) to experiment on so that you don't have to load your deck unnecessarily. He can make them any color to help test any color-related restrictions. Tweak his script to train him further if you need access to counterspells or give him the ability to turn things into artifacts or enchantments at will. I included most of the things I use frequently so most cards can be tested by dropping it in a deck with one of these with dev mode active.

And to help prevent him from interfering too much with the opponents decisions, he can't attack or block, and has hexproof.

Best of all he even comes with a picture. Drop it in the MBP folder and you're set.
Attachments
trained_kraj.jpg
Trained Kraj (Developer's Little Helper)
Last edited by moomarc on 16 Jan 2012, 14:22, edited 1 time in total.
-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: A Little "Tool" to Assist with Testing Scripts

Postby Tranberry » 13 Jan 2012, 19:34

It will die to Tribute to Hunger, unless dev-mode can work around that.
User experience, make or break. MtG drafting is fun.
User avatar
Tranberry
 
Posts: 59
Joined: 01 Apr 2010, 19:32
Location: Sweden
Has thanked: 136 times
Been thanked: 3 times

Re: A Little "Tool" to Assist with Testing Scripts

Postby Hellfish » 13 Jan 2012, 19:56

It's returned to your hand as a static trigger in that case. Should probably give it Flash though, just in case.

In other news, AWW YEAH, now I feel like a mad scientist. :D
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: A Little "Tool" to Assist with Testing Scripts

Postby silly freak » 13 Jan 2012, 21:02

indestructible, anybody? or did I overlook something in the script?
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 598
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 93 times
Been thanked: 25 times

Re: A Little "Tool" to Assist with Testing Scripts

Postby moomarc » 13 Jan 2012, 21:12

Yeah, I figured everyone could tailor it to their own needs. I just wanted to provide a base that covered the main things I miss when testing.

Having it able to die was a conscious decision. Sometimes you need to just kill your helper :twisted:

Hope some of you can get some use out of him.
-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: A Little "Tool" to Assist with Testing Scripts

Postby moomarc » 28 Jan 2012, 16:23

For anyone that uses the token generating ability of the Trained Kraj, here's a token image. Just drop in your tokens folder.
Attachments
c_1_1_test_subject.jpg
Lovable test subject...
-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: A Little "Tool" to Assist with Testing Scripts

Postby Hellfish » 28 Jan 2012, 17:56

That is adorable... What the hell is it?
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: A Little "Tool" to Assist with Testing Scripts

Postby jeffwadsworth » 28 Jan 2012, 18:55

Hellfish wrote:That is adorable... What the hell is it?
A Choad.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: A Little "Tool" to Assist with Testing Scripts

Postby moomarc » 28 Jan 2012, 21:12

Hellfish wrote:That is adorable... What the hell is it?
Something cute and fluffy enough to test your nefarious spells on. Yet with enough spikes to be 1/1 :mrgreen: And I think the artist had the same idea.
-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: A Little "Tool" to Assist with Testing Scripts

Postby timmermac » 28 Jan 2012, 21:46

Kind of looks like a cross between a mini-lion and the dog-like creature from the episode of the original Star Trek where Kirk gets split into good-Kirk and bad-Kirk.
"I just woke up, haven't had coffee, let alone a pee in 7 days, and I find out you stole my ass and made a ...mini-me! Carter, I should be irked currently, yes?" - Jack O'Neill
User avatar
timmermac
Tester
 
Posts: 1512
Joined: 17 May 2010, 20:36
Has thanked: 18 times
Been thanked: 95 times

Re: A Little "Tool" to Assist with Testing Scripts

Postby Rob Cashwalker » 30 Jan 2012, 15:13

jeffwadsworth wrote:A Choad.
FYI folks, don't Google this..
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 12 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 12 users online :: 0 registered, 0 hidden and 12 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 12 guests

Login Form