It is currently 02 Nov 2025, 21:07
   
Text Size

[WIP] Split Cards Support

Post MTG Forge Related Programming Questions Here

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

Re: [WIP] Split Cards Support

Postby friarsol » 28 Feb 2013, 17:11

Max mtg wrote:Ok, Sol, next time I'll send card scripts directly to you! =) (so that you commit them in a fail-safe mode) (I also hope, we won't have to make such massive changes in the foreseeable future)
Hah. It's fine, I know you didn't expect any issues, otherwise you wouldn't have done it that way. I definitely wasn't trying to say you were being malicious, just that's where the root of the issue was. We'll get a new branch setup for Agetian, and nobody will remember the great script cleanup of 2013.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: [WIP] Split Cards Support

Postby Max mtg » 28 Feb 2013, 17:50

Ah, I know what else should be removed from _all_ of scripts => svar:rarity!
So I will send you an archive! :twisted:

Ok, right after beta 1.3.9
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: [WIP] Split Cards Support

Postby myk » 28 Feb 2013, 20:03

if it helps, here's a script that will split the checkins by directory:
Code: Select all
find res/cardsfolder/* -type d | while read dname; do count=$((count + 1)); svn commit -m "remove svar:rarity, part $count" "$dname"; done
edit: bash for windows is available via the cygwin library, which my windows-using coworkers swear by. There is also the win-bash project, which I haven't used but looks promising.
Last edited by myk on 28 Feb 2013, 20:17, edited 3 times in total.
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

Re: [WIP] Split Cards Support

Postby Max mtg » 28 Feb 2013, 20:10

Sorry, I am on Windows - that sample won't work.
But a similiar batch is quite possible. I still dream of sending an archive to Sol )
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: [WIP] Split Cards Support

Postby Agetian » 01 Mar 2013, 04:27

So, should I wait for the new branch then or just make one on my own (please tell me if I even can then :)). Thanks in advance!

- Agetian
Agetian
Programmer
 
Posts: 3490
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Split Cards Support

Postby friarsol » 01 Mar 2013, 04:29

Agetian wrote:So, should I wait for the new branch then or just make one on my own (please tell me if I even can then :)). Thanks in advance!

- Agetian
Feel free to make it yourself. They aren't that hard to make. If you can't figure it out, I'll make it for you tomorrow.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: [WIP] Split Cards Support

Postby friarsol » 01 Mar 2013, 14:25

Ok, I deleted and recreated the branch for you since it didn't seem to be updated. Should be under the same name as before (but you may need to recheckout the branch, I can't remember how that works)
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: [WIP] Split Cards Support

Postby Agetian » 02 Mar 2013, 02:16

Thanks a lot, sol! I'll get right to it after work today, I think I'll just go ahead and recheckout and then try merging up to the latest trunk to make sure everything works, then get on with the cards support.

- Agetian
Agetian
Programmer
 
Posts: 3490
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Split Cards Support

Postby Agetian » 03 Mar 2013, 06:12

OK, my progress so far:
- Branch merge works so far. Yay! :D
- I started working on the creation of the full split card face in CardFactory. So far most of it works but some of it is likely to be implemented somewhat wrong and doesn't want to work exactly as desired. In particular, I have questions about the following:

If I only add the abilities of each face to the combined card, I wind up with three abilities assigned to the card, however, neither of them shows the correct text - so, if I click the card to play it, I'm presented with three choices (one for the combined face, one for the left split, one for the right split), all of which are called "Assault // Battery" (given that that's the card I'm experimenting with). Also, the ability texts do not show in the card detail box. What am I doing wrong here and what should I do instead?

Currently I'm using the names of each split and the associated Oracle text to force-assign the full card text via card.setText, but I'm not sure if that's actually optimal (most likely not).

Also, would it be possible to "filter out" the combined face ability itself somewhere in the code so that I'm only presented with two choices, for the left and right split respectively, when playing the card? If so, what part of the code should I be looking at?

Thanks in advance!
- Agetian
Agetian
Programmer
 
Posts: 3490
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Split Cards Support

Postby Max mtg » 03 Mar 2013, 08:10

Agetian wrote:If I only add the abilities of each face to the combined card, I wind up with three abilities assigned to the card, however, neither of them shows the correct text - so, if I click the card to play it, I'm presented with three choices (one for the combined face, one for the left split, one for the right split), all of which are called "Assault // Battery" (given that that's the card I'm experimenting with). Also, the ability texts do not show in the card detail box. What am I doing wrong here and what should I do instead?
You have to arm with a debugger and see why is the third ability "for combined face" you've never added to card is being created.
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: [WIP] Split Cards Support

Postby Agetian » 03 Mar 2013, 11:50

Ok, the problem with the combined face ability being added to the list of abilities to choose from is now fixed, but the abilities still don't show up correctly in the choice box (or in the card detail panel, for that matter, if they're just added to the combined card face. It's almost as if the SpellDescription is not being "seen" by the game for abilities coming from split card faces - does anyone have any idea why that might be happening?

EDIT: A related question - are the abilities on the split cards supposed to be spell abilities, static abilities or intrinsic abilities? I assume they are all spell abilities (from Instants and Sorceries), but I'm not sure... I'd need a consultation of a rule guru here. :)

- Agetian
Agetian
Programmer
 
Posts: 3490
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Split Cards Support

Postby friarsol » 03 Mar 2013, 14:01

Agetian wrote:EDIT: A related question - are the abilities on the split cards supposed to be spell abilities, static abilities or intrinsic abilities? I assume they are all spell abilities (from Instants and Sorceries), but I'm not sure... I'd need a consultation of a rule guru here. :)
They are all spells (SpellAbilites), it's quite similar to Charm/Modal Spells. Where as you start casting it you decide which spell/mode you are casting. In your case, choosing which side will change the base Cost as well as other things. For Charms, that isn't the case (obviously).
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: [WIP] Split Cards Support

Postby Max mtg » 03 Mar 2013, 15:22

Agetian wrote:Ok, the problem with the combined face ability being added to the list of abilities to choose from is now fixed
- Agetian
You have found the right place, but made a wrong edit...
Code: Select all
       // this is the "default" spell for permanents like creatures and artifacts
        if (card.isPermanent() && !card.isAura() && !card.isLand()) {
            if (card.getRules().getSplitType() != CardSplitType.Split) {
                card.addSpellAbility(new SpellPermanent(card)); // ignore the default spell for combined split cards
            }
        }
You have to assign a correct card type to the combined face. When card has a type of Sorcerry, it won't be considered a permanent and the "third" ability creation will be excluded by the first condition in outer if. And the internal check of splittype becomes unnessesary
Last edited by Max mtg on 03 Mar 2013, 15:40, edited 1 time in total.
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: [WIP] Split Cards Support

Postby Max mtg » 03 Mar 2013, 15:28

Agetian wrote:EDIT: A related question - are the abilities on the split cards supposed to be spell abilities, static abilities or intrinsic abilities? I assume they are all spell abilities (from Instants and Sorceries), but I'm not sure... I'd need a consultation of a rule guru here. :)

- Agetian
You begin with intrinsic abilities filled by unprocessed lines of text. As they are parsed by factory you get the same amount of instances of SpellApiBased.
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: [WIP] Split Cards Support

Postby Agetian » 03 Mar 2013, 17:59

@ Max: Oh, OK, gotcha! I'll tinker with setting the card type then instead of checking for the split type. Btw, I tried adding intrinsic abilities to the card but it did not make any difference as far as displaying the abilities went... :( I'll keep looking.

- Agetian
Agetian
Programmer
 
Posts: 3490
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: Google [Bot] and 25 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 26 users online :: 1 registered, 0 hidden and 25 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: Google [Bot] and 25 guests

Login Form