[WIP] Split Cards Support
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
Re: [WIP] Split Cards Support
by Sloth » 05 Mar 2013, 13:40
Don't worry about every corner case. I'm sure we will find a lot more incompatibilities, but most of them will be there, because some of the old cards/keywords were scripted/coded sloppily. It's not your task to fix all the mess that has piled up in the code over time.Agetian wrote:I'm not sure if there are other cases like that which are possible and which are currently not accounted for, please revise.
If the main interactions work - reintegrate the branch.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: [WIP] Split Cards Support
by Agetian » 05 Mar 2013, 13:45
Ok I'll do some more testing and will then reintegrate. Is the latter as simple as hit the "Reintegrate the branch" or whatever it says in TortoiseSVN? (I've never done that before and, as such, I'm kinda afraid I'll do the wrong thing
).
- Agetian
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Split Cards Support
by Sloth » 05 Mar 2013, 14:24
1. Switch to the trunkAgetian wrote:Ok I'll do some more testing and will then reintegrate. Is the latter as simple as hit the "Reintegrate the branch" or whatever it says in TortoiseSVN? (I've never done that before and, as such, I'm kinda afraid I'll do the wrong thing).
2. "Merge" -> "Reintegrate a branch".
3. Resolve all conflicts.
4. Commit.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: [WIP] Split Cards Support
by swordshine » 05 Mar 2013, 14:30
Just go over all the 46 split cards (we could get 52 search results in magiccards.info, but actually Naughty/Nice and Who/What/When/Where/Why are illegal for Forge), It seems these cards are not easy to script right now:
Determined:not sure if keyword CARDNAME can't be countered. works here (Vexing Shusher)
Development:cost "has you draw a card" is not scriptable
Fall:reveals two cards at random
Odds:flip heads/tails (Molten Sentry?)
Edit:If you use CARDNAME in SpellDescription, it would not show the correct side but the name of two sides.
Also I'm not sure where to put urls for card pictures or svars like "SVar:RemAIDeck:True". Would these svars affect both sides or only one side?
Determined:not sure if keyword CARDNAME can't be countered. works here (Vexing Shusher)
Development:cost "has you draw a card" is not scriptable
Fall:reveals two cards at random
Odds:flip heads/tails (Molten Sentry?)
Edit:If you use CARDNAME in SpellDescription, it would not show the correct side but the name of two sides.
Also I'm not sure where to put urls for card pictures or svars like "SVar:RemAIDeck:True". Would these svars affect both sides or only one side?
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: [WIP] Split Cards Support
by Agetian » 05 Mar 2013, 14:54
@ Sloth: Uhhh trying to reintegrate right now but for some stupid reason it's going over the 12000 cards again even though both my trunk and my SplitCards are on the head revision, so technically speaking, those files should be the same. Do you know why it's doing that? I'm pretty sure it'll fail eventually because I could never get it to merge 12000 files at once without getting me disconnected around the letter G or H. 
@ swordshine: Here's an example of a script with a SVar in it:
I'll see what I can do with the CARDNAME issue, can you give me an example script that would use it so that I can play with it?
- Agetian
@ swordshine: Here's an example of a script with a SVar in it:
- Code: Select all
Name:Fire
ManaCost:1 R
AlternateMode: Split
Types:Instant
A:SP$ DealDamage | Cost$ 1 R | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player to distribute damage to | NumDmg$ 2 | TargetMin$ 1 | TargetMax$ 2 | DividedAsYouChoose$ 2 | SpellDescription$ Fire deals 2 damage divided as you choose among one or two target creatures and/or players.
SetInfo:APC Uncommon
SetInfo:COM Uncommon
SetInfo:DDJ Uncommon
Oracle:Fire deals 2 damage divided as you choose among one or two target creatures and/or players.
ALTERNATE
Name:Ice
ManaCost:1 U
Types:Instant
A:SP$ Tap | Cost$ 1 U | ValidTgts$ Permanent | TgtPrompt$ Select target permanent | SubAbility$ DBDraw | SpellDescription$ Tap target permanent. Draw a card.
SVar:DBDraw:DB$ Draw | NumCards$ 1
Oracle:Tap target permanent.\nDraw a card.
End
I'll see what I can do with the CARDNAME issue, can you give me an example script that would use it so that I can play with it?
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Split Cards Support
by friarsol » 05 Mar 2013, 15:02
In your example above the SpellDescription for Fire should be "CARDNAME deals 2 damage divided as you choose among one or two target creatures and/or players."Agetian wrote:I'll see what I can do with the CARDNAME issue, can you give me an example script that would use it so that I can play with it?
- Agetian
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: [WIP] Split Cards Support
by myk » 05 Mar 2013, 16:11
If it fails, I can do the reintegration for you. Since you've been merging trunk into your branch, there shouldn't be any conflicts to resolve. It's going over all 12000 cards since they were touched during the branch lifetime. It doesn't matter that there are no differences, unfortunately; it's just how subversion works.Agetian wrote:@ Sloth: Uhhh trying to reintegrate right now but for some stupid reason it's going over the 12000 cards again even though both my trunk and my SplitCards are on the head revision, so technically speaking, those files should be the same. Do you know why it's doing that? I'm pretty sure it'll fail eventually because I could never get it to merge 12000 files at once without getting me disconnected around the letter G or H. :(
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: [WIP] Split Cards Support
by Agetian » 05 Mar 2013, 16:24
@ myk: Yeah, it failed alright, sadly, for some reason it does it for several hours on my system and it drops me about 1/3 way through it as if it times out or something... Please feel free to reintegrate for me, I'd be very grateful if you could do that.
@ Everyone: I'm looking into the CARDNAME issue but can't seem to get to the bottom of it. I've found five places in the entire Forge code base where CARDNAME is being replaced with the actual card name "en masse" via a call to replaceAll - four instances in the Card class and one instance in SpellAbility.getStackDescription. I tried tinkering with all five of those but neither of them actually seems to be the one I want, because even if I replace the line that replaces CARDNAME with something along the lines of ...replaceAll("CARDNAME", "RANDOMLINE"), it still shows up as "Fire // Ice" in the game as if it was replaced by the name of the card *already* from somewhere else before it got to the part I'm tinkering with. Can you please help me with this?... (at least give me a hint where I should be looking at). P.S. This is minor enough for now and should be easy enough to fix once I pinpoint the location to rig, I don't think this issue should hinder reintegration with the trunk (we can patch it up in trunk shortly).
- Agetian
@ Everyone: I'm looking into the CARDNAME issue but can't seem to get to the bottom of it. I've found five places in the entire Forge code base where CARDNAME is being replaced with the actual card name "en masse" via a call to replaceAll - four instances in the Card class and one instance in SpellAbility.getStackDescription. I tried tinkering with all five of those but neither of them actually seems to be the one I want, because even if I replace the line that replaces CARDNAME with something along the lines of ...replaceAll("CARDNAME", "RANDOMLINE"), it still shows up as "Fire // Ice" in the game as if it was replaced by the name of the card *already* from somewhere else before it got to the part I'm tinkering with. Can you please help me with this?... (at least give me a hint where I should be looking at). P.S. This is minor enough for now and should be easy enough to fix once I pinpoint the location to rig, I don't think this issue should hinder reintegration with the trunk (we can patch it up in trunk shortly).
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Split Cards Support
by friarsol » 05 Mar 2013, 16:45
Yea this is relatively minor, and can be looked at once the reintegration happens.Agetian wrote:P.S. This is minor enough for now and should be easy enough to fix once I pinpoint the location to rig, I don't think this issue should hinder reintegration with the trunk (we can patch it up in trunk shortly).
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: [WIP] Split Cards Support
by friarsol » 05 Mar 2013, 16:57
Determined should be the same Static Ability as Banefire just on an Effect.swordshine wrote:Determined:not sure if keyword CARDNAME can't be countered. works here (Vexing Shusher)
Development:cost "has you draw a card" is not scriptable
Fall:reveals two cards at random
Odds:flip heads/tails (Molten Sentry?)
I was looking at doing heads/tails flips for Mana Clash, but never actually finished.
Can't you use the Reveal effect for Fall? I guess the "Random" portion would need to actually account for how many cards you want to Reveal randomly. Should be pretty easy to add support for that. Once that's added Nebuchadnezzar can be converted from hardcode.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: [WIP] Split Cards Support
by myk » 05 Mar 2013, 17:30
reintegrating.... (will be done in a few hours. I'm still in res/cardsfolder/a..). Would you like me to remove the SplitCards branch after it's merged, or I should I reset the merge info so you can continue to use the branch and reintegrate further changes at a later date?
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: [WIP] Split Cards Support
by Agetian » 05 Mar 2013, 17:53
Umm unless anyone has important considerations and arguments for keeping it, I'd say it can be removed - I mean, the basic structure of split card support is all in, what remains is polishing it and fleshing out the potential issues and incompatibilities in card interaction, I guess it's best to do that in one place (trunk, since the major part of the branch is reintegrated anyway), though it's my first experience of working with a branch, so to be on the safe side, I guess we can reset it and keep it for a few days after the reintegration to see if we need it for something else or not. Other opinions are indeed welcome!
- Agetian
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Split Cards Support
by Max mtg » 05 Mar 2013, 18:04
Why don't you reintegrate only 'src' folder? All those 12k cards just won't participate
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
by Agetian » 05 Mar 2013, 18:07
@ Max: Oh, I wasn't aware it was possible to do that! Thx for the tip! I'll definitely utilize this shortcut the next time I work with branches (which means soon since I plan to start a branch for the AI personalities soon enough). 
- Agetian
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Split Cards Support
by myk » 05 Mar 2013, 18:46
I didn't do it this way since subtree merges can lead to errors and complexities down the road. I've made that mistake in the past and have no intention of repeating it : ) The svn book explicitly advises against subtree merging. Consistently merging from branch roots keeps things simple, and is usually quite fast -- most merges won't take nearly this long.Max mtg wrote:Why don't you reintegrate only 'src' folder? All those 12k cards just won't participate
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Who is online
Users browsing this forum: No registered users and 64 guests