It is currently 19 Apr 2024, 07:05
   
Text Size

Card Development Questions

Post MTG Forge Related Programming Questions Here

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

Re: Card Development Questions

Postby slapshot5 » 07 Jan 2011, 03:17

: Sailmonger as written in your post works fine for me. Is your creature a valid target?
My test deck was just Moxen, Sailmonger and Merfolk of the Pearl Trident.
-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby Jaedayr » 07 Jan 2011, 03:48

slapshot5 wrote:
Jaedayr wrote:Also I noticed that the info box in game has an extra hyphen in the name "Creature - - Human Monger"
You don't need to add hyphens in the Types: field. Just list them as:
Code: Select all
Creature Human Monger
Don't know why that card isn't working for you.
-slapshot5
I removed the extra hyphen and it works. Thank you for the help!
Jaedayr
Tester
 
Posts: 523
Joined: 08 Jul 2010, 00:06
Has thanked: 16 times
Been thanked: 13 times

Re: Card Development Questions

Postby Chris H. » 10 Jan 2011, 00:56

I would like to welcome Sentient6 to the list of committers. :D We appreciate the help.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Card Development Questions

Postby sentient6 » 10 Jan 2011, 02:26

Thanks for welcome. I hope my contributions actually help somewhat.

Not sure if this is the right thread to ask this, but it seems that you can't put a SpellDescription on a drawback created from an AbilityFactory without getting a null pointer error.

The code to blame is in AbilityFactory.getAbility. When called for a Drawback, abCost is never instantiated and thus a null pointer error occurs below.
AbilityFactory.getAbility Snippets | Open
Code: Select all
      if (!isDb){
         if (!mapParams.containsKey("Cost"))
            throw new RuntimeException("AbilityFact1ory : getAbility -- no Cost in " + hostCard.getName());
         abCost = new Ability_Cost(mapParams.get("Cost"), hostCard.getName(), isAb);
      }
Code: Select all
        if (hasSpDesc)
        {
           StringBuilder sb = new StringBuilder();
           
           if (mapParams.containsKey("PrecostDesc"))
              sb.append(mapParams.get("PrecostDesc")).append(" ");
           if (mapParams.containsKey("CostDesc"))
              sb.append(mapParams.get("CostDesc")).append(" ");
           else sb.append(abCost.toString());
           
           sb.append(mapParams.get("SpellDescription"));
           
           SA.setDescription(sb.toString());
        }
Would it be worth it to check for abCost being null here or is the idea that a drawback should always be described in the ability it falls under? I wanted to ask before doing anything myself so I don't accidently step on somebody's toes somehow.

Either way, what is the general consensus on where the description of multi-part abilities/spells should go?
sentient6
 
Posts: 13
Joined: 03 Jan 2011, 00:48
Has thanked: 0 time
Been thanked: 0 time

Re: Card Development Questions

Postby Chris H. » 10 Jan 2011, 02:34

sentient6 wrote:Not sure if this is the right thread to ask this, but it seems that you can't put a SpellDescription on a drawback created from an AbilityFactory without getting a null pointer error.
Either way, what is the general consensus on where the description of multi-part abilities/spells should go?
`
I think that you are right, we include the DB description as part of the SpellDescription included in the AF sa.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Card Development Questions

Postby sentient6 » 10 Jan 2011, 02:37

Chris H. wrote:
sentient6 wrote:Not sure if this is the right thread to ask this, but it seems that you can't put a SpellDescription on a drawback created from an AbilityFactory without getting a null pointer error.
Either way, what is the general consensus on where the description of multi-part abilities/spells should go?
`
I think that you are right, we include the DB description as part of the SpellDescription included in the AF sa.
Alright, that's the way I'll do it from here on out. Perhaps it might make sense to provide some sort of error message, though, to warn people not to put a SpellDescription on a drawback. The thrown exception was not exactly the clearest message.
sentient6
 
Posts: 13
Joined: 03 Jan 2011, 00:48
Has thanked: 0 time
Been thanked: 0 time

Re: Card Development Questions

Postby Chris H. » 10 Jan 2011, 03:41

sentient6 wrote:Alright, that's the way I'll do it from here on out. Perhaps it might make sense to provide some sort of error message, though, to warn people not to put a SpellDescription on a drawback. The thrown exception was not exactly the clearest message.
`
Easy to read error messages are always a good thing. :)
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Card Development Questions

Postby friarsol » 10 Jan 2011, 14:32

Drawbacks were written to never have costs, and the full SpellDescription should appear on the the root AF, since it's one whole ability. We can add a section in the
Code: Select all
if (hasSpDesc)
        {
block to check if this is a Drawback and popup a warning message, but skip the attempt at using the null Cost variable.

Edit: I'm going to add some code to make this scenario simpler to allow either front-loading of SpellDescription (as we have now) or chaining of the Descriptions
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby Jaedayr » 10 Jan 2011, 21:22

I created Zhalfirin Commander and when I checked on rarity at gatherer.wizards.com it says "Special". I am adding it to the SVN as "Rare" but do we or should we have a special tag for rarity? Or do we treat all specials as rare.
Jaedayr
Tester
 
Posts: 523
Joined: 08 Jul 2010, 00:06
Has thanked: 16 times
Been thanked: 13 times

Re: Card Development Questions

Postby friarsol » 10 Jan 2011, 21:32

Zhalfrin Commander was Uncommon in Mirage, so list it as that. It was one of the Timeshifted cards in Time Spiral. The SetInfoScript will handle the Special portion as normal.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby jeffwadsworth » 14 Jan 2011, 21:41

Does anyone see an issue with this line for the card Time Spiral?

Code: Select all
A:SP$Untap | Cost$ 4 U U | TargetMin$ 0 | TargetMax$ 6 | ValidTgts$ Land | TgtPrompt$ Select target land | SpellDescription$ You untap up to six lands.
It won't work whereas the "SP$Untap" works fine with other cards. Just making sure I am not missing something.
Last edited by jeffwadsworth on 14 Jan 2011, 21:48, edited 1 time in total.
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

Re: Card Development Questions

Postby friarsol » 14 Jan 2011, 21:46

This untapping isn't targeted and happens during resolution. It's probably better to just wait until Untap is written to handle this type of untargeted untapping. We probably also need ChangeZoneAll to be written for the card as well.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby jeffwadsworth » 15 Jan 2011, 03:40

Fooling with Hellfish's new trigger code and was wondering about Pandemonium.

Code: Select all
T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Creature.YouCtrl | Execute$ TrigDamage | TriggerDescription$ Whenever a creature enters the battlefield, that creature's controller may have it deal damage equal to its power to target creature or player of his or her choice.
SVar:TrigDamage:SP$DealDamage | Tgt$ TgtCP | NumDmg$ X
SVar:X:Count$?Power
Is there anyway to count the power of a creature that just entered the battlefield?
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

Re: Card Development Questions

Postby friarsol » 15 Jan 2011, 03:52

Not currently, but there's another problem with Pandemonium. The controller of the creature doesn't get to choose the target, the controller of Pandemonium does. That card is going to need a decent amount of more work to get it to be 100% scriptable.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby jeffwadsworth » 16 Jan 2011, 22:34

Is there a way to script the removal of a keyword like flying? Testing Emerald Charm.
jeffwadsworth
Super Tester Elite
 
Posts: 1171
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 69 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 56 guests


Who is online

In total there are 56 users online :: 0 registered, 0 hidden and 56 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 56 guests

Login Form