It is currently 23 Apr 2024, 09:22
   
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 torridus » 11 Jan 2014, 07:09

Tested with 1.5.2 and 1.2.11 but unfortunately no.

Forge hasn't come up with any errors but none of these have worked:

SVar:X:Count$TypeInExile.Creature
SVar:X:Count$Valid Card.Exiled
SVar:X:Count$Valid Card.Exile
SVar:X:Count$Valid Card.inZoneExile
torridus
 
Posts: 56
Joined: 03 Jul 2012, 12:58
Has thanked: 4 times
Been thanked: 9 times

Re: Card Development Questions

Postby moomarc » 11 Jan 2014, 07:29

The count function you're looking for is SVar:X:Count$ValidExile Card where card can be any valid type string. You can check multiple zones with this function too by stringing zones together although I can't remember the exact syntax.

Edit: not in front of my PC and suddenly not certain of the syntax. It might have an underscore before the zone, so "Valid_Exile Card". Also, "TypeInExile Creature" with a space instead of point should work, but I think that method was deprecated recently.
-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 torridus » 11 Jan 2014, 07:59

moomarc wrote:SVar:X:Count$ValidExile Card
This does the trick! Thank you.
torridus
 
Posts: 56
Joined: 03 Jul 2012, 12:58
Has thanked: 4 times
Been thanked: 9 times

Re: Card Development Questions

Postby Max mtg » 29 Jan 2014, 17:05

Which core type stands for a permanent, and which one does not?
Code: Select all
        Artifact(true),
        Creature(true),
        Enchantment(true),
        Instant(false),
        Land(true),
        Plane(false),
        Planeswalker(true),
        Scheme(false),
        Sorcery(false),
        Tribal(false),
        Vanguard(false),
        Phenomenon(false);
       
        public final boolean isPermanent;
       
        private CoreType(final boolean permanent) {
            isPermanent = permanent;
        }
Is this correct?
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Card Development Questions

Postby friarsol » 29 Jan 2014, 17:11

Max mtg wrote:Which core type stands for a permanent, and which one does not?
Code: Select all
        Artifact(true),
        Creature(true),
        Enchantment(true),
        Instant(false),
        Land(true),
        Plane(false),
        Planeswalker(true),
        Scheme(false),
        Sorcery(false),
        Tribal(false),
        Vanguard(false),
        Phenomenon(false);
       
        public final boolean isPermanent;
       
        private CoreType(final boolean permanent) {
            isPermanent = permanent;
        }
Is this correct?
Yep that's all correct, although these are referred to in the rules as "Card Types" not "Core Types", there are also "Supertypes" (Basic, Legendary etc), and "Subtypes" (Human, Aura, etc)
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby Max mtg » 29 Jan 2014, 17:18

friarsol wrote:Yep that's all correct, although these are referred to in the rules as "Card Types" not "Core Types", there are also "Supertypes" (Basic, Legendary etc), and "Subtypes" (Human, Aura, etc)
Thanks for confirmation.
I cannot name the enum CardType because that would lead to name clash. There's already a class named CardType that includes SuperType, CoreType and subType (the latter is alist of strings, the two former ones are EnumSets)
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Card Development Questions

Postby Marek14 » 29 Jan 2014, 18:13

friarsol wrote:
Max mtg wrote:Which core type stands for a permanent, and which one does not?
Code: Select all
        Artifact(true),
        Creature(true),
        Enchantment(true),
        Instant(false),
        Land(true),
        Plane(false),
        Planeswalker(true),
        Scheme(false),
        Sorcery(false),
        Tribal(false),
        Vanguard(false),
        Phenomenon(false);
       
        public final boolean isPermanent;
       
        private CoreType(final boolean permanent) {
            isPermanent = permanent;
        }
Is this correct?
Yep that's all correct, although these are referred to in the rules as "Card Types" not "Core Types", there are also "Supertypes" (Basic, Legendary etc), and "Subtypes" (Human, Aura, etc)
And of course, "Subtypes" themselves are divided according to which card type (or types) they belong to.
Marek14
Tester
 
Posts: 2761
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 297 times

Re: Card Development Questions

Postby Max mtg » 04 Feb 2014, 12:51

Please confirm someone that chages from r24656 are correct in terms of game rules.

I was sure that Chains of Mephisto did need a harcode.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Card Development Questions

Postby Sloth » 04 Feb 2014, 13:20

Max mtg wrote:Please confirm someone that chages from r24656 are correct in terms of game rules.

I was sure that Chains of Mephisto did need a harcode.
I think the script looks fine. It's a normal replacement effect.

Do you see any case where it doesn't work?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby swordshine » 04 Feb 2014, 13:57

It's a normal replacement effect.
Similar examples: You have four Blood Scriveners when you have no cards in hand and would draw a card, you will draw 5 cards and lose 4 life because each Blood Scrivener modifies the draw.
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Card Development Questions

Postby Max mtg » 04 Feb 2014, 14:05

Ok, it replaces "draw" with "discard, then draw" or "mill"
And that resulting draw in turn can be replaced by second Chains' static ability.
I'll test if the game does not enter an infinite loop here (i.e. first card won't replace draw caused by second card)
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Card Development Questions

Postby friarsol » 04 Feb 2014, 15:45

Max mtg wrote:Ok, it replaces "draw" with "discard, then draw" or "mill"
And that resulting draw in turn can be replaced by second Chains' static ability.
I'll test if the game does not enter an infinite loop here (i.e. first card won't replace draw caused by second card)
Once a replacement effect influences a single action, it shouldn't be able to influence that same action again. If that doesn't work in Forge, then having two Thought Reflection in play would cause an infinite loop too.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby Max mtg » 04 Feb 2014, 17:51

I don't know why, but it works properly :)
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Card Development Questions

Postby friarsol » 04 Feb 2014, 17:55

Max mtg wrote:I don't know why, but it works properly :)
Lots of people working different levels of Magic on this software ;)
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby Marek14 » 04 Feb 2014, 19:40

friarsol wrote:
Max mtg wrote:Ok, it replaces "draw" with "discard, then draw" or "mill"
And that resulting draw in turn can be replaced by second Chains' static ability.
I'll test if the game does not enter an infinite loop here (i.e. first card won't replace draw caused by second card)
Once a replacement effect influences a single action, it shouldn't be able to influence that same action again. If that doesn't work in Forge, then having two Thought Reflection in play would cause an infinite loop too.
What happens in these esoteric examples?

1. Lightning Bolt to Swans of Bryn Argoll, one draw replaced by Words of War, damage dealt to the Swans.
(I believe that the damage should not be replaced since it's still counts as the original action.)

2. Words of Wilding used to replace regular turn draw, Zameck Guildmage activated, Doubling Season on battlefield.
(I think that you'll get one token with one +1/+1 counter since turn draw is not an effect.)
Marek14
Tester
 
Posts: 2761
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 297 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 40 guests


Who is online

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

Login Form