Mulitstate cards test drive
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Mulitstate cards test drive
by Hellfish » 23 Oct 2011, 00:13
Okay, status update: I've implemented a new system based on Sloth's suggestion that doesn't keep separate Card object but separate CardCharacteristics objects for states.CardCharacteristics objects are sort of collection classes for Name/Type/Abilities/everything that would change between states of a multistate card.The Card objects themselves track this. I also had to go trawling through the whole Script file->CardRules->CardPrinted system to setup the new script format for the alternates. I probably butchered the whole system
but it seems to work! Plus, while I was there I hacked in support in the deckeditor for multistate cards.
I'll probably put out a patch sometime tomorrow. Here's a laundry list for those who're wondering.
-The ability to view the alternate state in the deckeditor. DONE!
-Clone interaction. DONE?
-MSC Planeswalker ability limitation. DONE!
-ImageFilename for alternate state. DONE!
-Triggers on alternate state working properly. DONE!
-Restructure TriggerHandler to get rid of trigger registering and just loop through all cards in the game looking for triggers. DONE!
Bugs:
-Alternate states do not get their colors set correctly (they remain colorless) DONE!
-Not everything is copied properly (SVars, ImageFilename...) DONE!
All items ticked off, which means I'll post a patch... After I come back from the shops.
Script example:

I'll probably put out a patch sometime tomorrow. Here's a laundry list for those who're wondering.

-The ability to view the alternate state in the deckeditor. DONE!
-Clone interaction. DONE?
-MSC Planeswalker ability limitation. DONE!
-ImageFilename for alternate state. DONE!
-Triggers on alternate state working properly. DONE!
-Restructure TriggerHandler to get rid of trigger registering and just loop through all cards in the game looking for triggers. DONE!
Bugs:
-Alternate states do not get their colors set correctly (they remain colorless) DONE!
-Not everything is copied properly (SVars, ImageFilename...) DONE!
All items ticked off, which means I'll post a patch... After I come back from the shops.

Script example:
- | Open
- Name:Cloistered Youth
ManaCost:1 W
Types:Creature Human
Text:no text
PT:1/1
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigTransform | OptionalDecider$ You | TriggerDescription$ At the beginning of your upkeep, you may transform CARDNAME.
SVar:TrigTransform:AB$ChangeState | Cost$ 0 | Defined$ Self
SVar:Rarity:Uncommon
AlternateMode:DoubleFaced
SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/8a.jpg
Oracle:At the beginning of your upkeep, you may transform Cloistered Youth.
ALTERNATE
Name:Unholy Fiend
ManaCost:no cost
Colors:Black
Types:Creature Horror
Text:no text
PT:3/3
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigLoseLife | TriggerDescription$ At the beginning of your end step, you lose 1 life.
SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ You | LifeAmount$ 1
SVar:Rarity:Uncommon
SetInfo:ISD|Uncommon|http://magiccards.info/scans/en/isd/8b.jpg
Oracle:Creature - Horror\n3/3\nAt the beginning of your end step, you lose 1 life.
End
Last edited by Hellfish on 23 Oct 2011, 13:28, edited 2 times in total.
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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Mulitstate cards test drive
by Sloth » 23 Oct 2011, 08:40
Sounds promising Hellfish! Can't wait to test. 

-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Mulitstate cards test drive
by Hellfish » 23 Oct 2011, 15:30
Alright, check the bottom of the first post for the new Characteristic-based system!
Please try out scripting multistate cards and keep a close eye on Clone/Copy effects *crosses fingers*
Please try out scripting multistate cards and keep a close eye on Clone/Copy effects *crosses fingers*
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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Mulitstate cards test drive
by Chris H. » 23 Oct 2011, 16:42
`Hellfish wrote:Patch (for r11365): http://www.mediafire.com/?q67asi4x446nulz
Havn't figured out how to produce a proper .jar file, sorry.
Dave knows more about this stuff than I do, but you should be able to create a new build as a .tar.bz2 archive via a Maven command locally on your computer by doing the following:
1] Open Run Configurations dialog.
2] Click on the Maven Build item rather than the Java Application option listed on the left side of the window.
3] Click on the New Launch Configuration button.
4] Give the Launch Configuration a good name.
5] Make sure that the Base directory path points to your working project with your new code.
6] Past the following goal into your Goals text box:
-U -B clean -P windows-linux install
7] Click on the Apply button and then the Run button. Watch your console. When finished there should be an .tar.bz2 archive in your project target folder. Upload the archive to MediaFire.
8] Do a File -> Refresh. Then do a Run -> Run As -> Maven Clean to remove the new contents from the target folder. Do another File -> Refresh.
-
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: Mulitstate cards test drive
by jeffwadsworth » 23 Oct 2011, 16:52
Awaiting new patch. 

Last edited by jeffwadsworth on 23 Oct 2011, 17:00, edited 2 times in total.
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Re: Mulitstate cards test drive
by Hellfish » 23 Oct 2011, 16:56
I think you got the wrong patch there, Jeff. MultiStateHandler.java is not in the new system. I might've linked to the wrong patch, I'll check. EDIT: Try the one linked now. EDIT AGAIN: To clarify, don't apply this patch over the previous ones, apply it to a clean checkout of r11365.
Thanks, Chris, I'll try those instructions.
Thanks, Chris, I'll try those instructions.

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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Mulitstate cards test drive
by jeffwadsworth » 23 Oct 2011, 17:31
Looks like that new patch "V2" is missing some cards. Gatstaf Shepard and Screeching Bats.
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Re: Mulitstate cards test drive
by Hellfish » 23 Oct 2011, 17:35
Oh yeah,thanks, forgot about those. You can put together Screeching Bat / Stalking Vampire with a little Cut&Paste and comparing with Unholy Fiend. Gatstaf Shepherd / Gatstaf Howler needs a Trigger condition that I forgot to add in. Will fix.
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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Mulitstate cards test drive
by Iran » 24 Oct 2011, 00:46
When the developers introduces DF cards in forge, he would can solve the issue with the AI doesn't blocks with two or more when one card asks this. Because one of the most Werewof card is Kruin Outlaw/Terror of Kruin Pass.
The Terror of Kruin Pass have the effects below:
Double strike
Each Werewolf you control can't be blocked except by two or more creatures.
Thanks
The Terror of Kruin Pass have the effects below:
Double strike
Each Werewolf you control can't be blocked except by two or more creatures.
Thanks
Re: Mulitstate cards test drive
by Hellfish » 24 Oct 2011, 07:26
That is a separate issue in the blocking system that I don't know how to deal with. My work here is only to enable multistate cards, not to make sure all of them can be scripted with regards to other features in Forge.Iran wrote:When the developers introduces DF cards in forge, he would can solve the issue with the AI doesn't blocks with two or more when one card asks this. Because one of the most Werewof card is Kruin Outlaw/Terror of Kruin Pass.
The Terror of Kruin Pass have the effects below:
Double strike
Each Werewolf you control can't be blocked except by two or more creatures.
Thanks
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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Mulitstate cards test drive
by Hellfish » 24 Oct 2011, 07:59
New patch, see first post!
This version adds the Werewolf transformation conditions to Triggers. (WerewolfTransformCondition$ True and WerewolfUntransformCondition$ True, see Gatstaf Shepherd / Gatstaf Howler)
The CardDb now keeps a separate CardPrinted for each state, meaning that multistate cards works with both deck editors AND Download Set Pictures LQ. Also added Screeching Bat / Stalking Vampire.
@Chris or Dave, I'm trying to run the maven run config that Chris specified, but it complains that I'm not using the correct JDK (>1.4). As far as I can tell, I'm using JDK 1.7.
This version adds the Werewolf transformation conditions to Triggers. (WerewolfTransformCondition$ True and WerewolfUntransformCondition$ True, see Gatstaf Shepherd / Gatstaf Howler)
The CardDb now keeps a separate CardPrinted for each state, meaning that multistate cards works with both deck editors AND Download Set Pictures LQ. Also added Screeching Bat / Stalking Vampire.
@Chris or Dave, I'm trying to run the maven run config that Chris specified, but it complains that I'm not using the correct JDK (>1.4). As far as I can tell, I'm using JDK 1.7.
- | Open
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project forge: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files\Java\jre6\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/disp ... eException
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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Mulitstate cards test drive
by Hellfish » 24 Oct 2011, 11:27
I've pored over gatherer and found only 6 flip/dfc cards that possibly cause other problems in Forge, all other flip/dfc cards should be implementable from the get-go.
I'm also unsure if our "Fight" implementation is up to snuff for Daybreak Ranger / Nightfall Predator but it's there, at least.
I could be greedy and implement all the others myself, but that would just be mean
- | Open
- Kitsune Mystic / Autumn-Tail, Kitsune Sage - Needs enchantment moving(AF_Attach)
Civilized Scholar / Homicidal Brute - The transform conditions can't be done currently that I know of.
Delver of Secrets / Insectile Aberration - Again, the transform condition can't be done currently.
Sasaya, Orochi Ascendant / Sasaya's Essence - Flip condition. Not sure we can handle the mana shenanigans?
Kruin Outlaw / Terror of Kruin Pass - "Can't be blocked except by two or more creatures"
Akki Lavarunner / Tok-Tok, Volcano Born - Damage modification.
I'm also unsure if our "Fight" implementation is up to snuff for Daybreak Ranger / Nightfall Predator but it's there, at least.
I could be greedy and implement all the others myself, but that would just be mean

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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Mulitstate cards test drive
by Chris H. » 24 Oct 2011, 12:02
`Hellfish wrote:@Chris or Dave, I'm trying to run the maven run config that Chris specified, but it complains that I'm not using the correct JDK (>1.4). As far as I can tell, I'm using JDK 1.7.
- | Open
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project forge: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files\Java\jre6\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/disp ... eException
Good question Hellfish. I wish that I had a good answer. I hope that Dave sees this message and can give some guidance.

-
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: Mulitstate cards test drive
by friarsol » 24 Oct 2011, 12:17
Hellfish, you are using the JRE (Java Runtime Environment) where it's asking you for the JDK (Java Development Kit).Chris H. wrote:`Hellfish wrote:@Chris or Dave, I'm trying to run the maven run config that Chris specified, but it complains that I'm not using the correct JDK (>1.4). As far as I can tell, I'm using JDK 1.7.
- | Open
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project forge: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files\Java\jre6\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/disp ... eException
Good question Hellfish. I wish that I had a good answer. I hope that Dave sees this message and can give some guidance.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Mulitstate cards test drive
by Hellfish » 24 Oct 2011, 13:12
Doi!
Thanks, I'll try again after I fix some unwanted behaviour.

Thanks, I'll try again after I fix some unwanted behaviour.
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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Who is online
Users browsing this forum: No registered users and 44 guests