Page 2 of 2

Re: New Testing Facility: Setup Battlefield

PostPosted: 05 Jun 2011, 07:06
by Agetian
UPDATE 5 JUN 2011:
- Added the ActivePhase option that allows to change the current phase. See the first post
for valid values and an example.

- Agetian

Re: New Testing Facility: Setup Battlefield

PostPosted: 05 Jun 2011, 09:23
by Agetian
UPDATE 5 JUN 2011:
- The state setup files no longer need an END tag.
- The state setup files can contain empty lines and comments beginning with the pound sign (#).

- Agetian

Re: New Testing Facility: Setup Battlefield

PostPosted: 05 Jun 2011, 18:00
by Agetian
UPDATE 6 JUN 2011:

- Added a possibility to change cards in Exile areas for Human and AI.
- Added an optional ability to specify a specific set for cards spawned through Setup Game State.

- Agetian

Re: New Testing Facility: Setup Battlefield

PostPosted: 05 Jun 2011, 18:24
by Rob Cashwalker
Added an optional ability to specify a specific set for cards spawned through Setup Game State.
Check out how the loading and saving of decks handles the set code. (Gui_DeckEditor)
Each card is listed as {CardName}|{SetCode}

Re: New Testing Facility: Setup Battlefield

PostPosted: 05 Jun 2011, 18:55
by Agetian
Rob Cashwalker wrote:
Added an optional ability to specify a specific set for cards spawned through Setup Game State.
Check out how the loading and saving of decks handles the set code. (Gui_DeckEditor)
Each card is listed as {CardName}|{SetCode}
Yep, I saw that, but for some reason the Java parser I wrote does not want to recognize the "|" symbol when splitting the string (it just returns an empty string when splitting using the "|"), so I had to resort to using a different custom symbol in the state setup files. If I (or someone else) figure out how to make it work with the "|" symbol, I'll definitely make it consistent, but for the time being it'll have to work with the "@" symbol in the state setup files. Amazingly enough, just changing split("@") into split("|") makes the code fail to work, while the one with @ (or pretty much any other symbol) works OK... Does anyone have any ideas why this might be the case?

- Agetian

Re: New Testing Facility: Setup Battlefield

PostPosted: 05 Jun 2011, 19:01
by lazylockie
nice work Agetian! This should really save up some time when scripting new cards. Any plans to extend this setup thing for Quest mode? That way the quest-quests become more dynamic and even normal opponents could have a starting battlefield as well.

Re: New Testing Facility: Setup Battlefield

PostPosted: 05 Jun 2011, 19:06
by Agetian
lazylockie wrote:nice work Agetian! This should really save up some time when scripting new cards. Any plans to extend this setup thing for Quest mode? That way the quest-quests become more dynamic and even normal opponents could have a starting battlefield as well.
Yep, actually I might extend this to a Puzzle mode or something like that, and I don't mind if anyone else adapts the code for other uses as well, such as Quest mode needs. :)

- Agetian

Re: New Testing Facility: Setup Battlefield

PostPosted: 05 Jun 2011, 19:44
by Chris H.
Agetian wrote:Yep, I saw that, but for some reason the Java parser I wrote does not want to recognize the "|" symbol when splitting the string (it just returns an empty string when splitting using the "|")
`
Check out the forge.card.abilityFactory class. On line 108 this class parses a string on the "|" character:

Code: Select all
String a[] = abString.split("\\|");

Re: New Testing Facility: Setup Battlefield

PostPosted: 06 Jun 2011, 03:44
by Agetian
Chris H. wrote:Check out the forge.card.abilityFactory class. On line 108 this class parses a string on the "|" character:
Code: Select all
String a[] = abString.split("\\|");
Thanks, that sure helped! I updated the code to use the pipe symbol now (|) for consistency.
- Agetian

Re: New Testing Facility: Setup Battlefield

PostPosted: 01 Jul 2011, 02:14
by Braids
ah, String.split uses regular expressions? if that's so, that explains why the pipe character needs to be escaped with backslashes.

Re: New Testing Facility: Setup Battlefield

PostPosted: 14 Aug 2011, 20:34
by Hellfish
Necroing a bit to inform people that I've extended this feature in a way that breaks set assignment for old state files.New named parameters could be added for things like attacking creatures and such.A complete rewrite could concievably allow attaching cards to eachother and the like.
Log msg | Open
*Extended Setup Game State - Added named parameters.
-Tapped = If this is True,well... the card is tapped, ofc.
-SummonSick = If this is True, the card has Summoning Sickness.
-Counters = A comma-separated list of counters on the card.
-Morphed = If this is True, the card is facedown. (It must have the morph keyword for this to work)
-Set = Like you previously set SetCode.If absent, the latest printing is used.
Ex. "AICardsInPlay=Aphetto Alchemist|Set:ONS|Tapped:True|SummonSick:True|Counters:P1P1,P1P1,M0M2|Morphed:True; Memnite"