Changes to card script format
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
14 posts
• Page 1 of 1
Changes to card script format
by Max mtg » 22 Feb 2013, 08:57
SVar:Rarity - ignored during parse (removal from all scripts is highly recommended)
Text: - optional (no need for 'no text' lines)
All Licids use 'Licid' alternative state (name globally changed)
Out of game tokens may be represented by CardToken class (used in quest initial conditions)
Text: - optional (no need for 'no text' lines)
All Licids use 'Licid' alternative state (name globally changed)
Out of game tokens may be represented by CardToken class (used in quest initial conditions)
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: Changes to card script format
by timmermac » 22 Feb 2013, 12:55
Isn't the rarity SVar used for things like deck editor and spell shop sorting and booster generation? Or is that covered by the setinfo lines?
"I just woke up, haven't had coffee, let alone a pee in 7 days, and I find out you stole my ass and made a ...mini-me! Carter, I should be irked currently, yes?" - Jack O'Neill
Re: Changes to card script format
by Max mtg » 22 Feb 2013, 13:32
Deckeditor has not been using svar-rarity for over 9000 revisions - that is ~550 days.timmermac wrote:Isn't the rarity SVar used for things like deck editor and spell shop sorting and booster generation? Or is that covered by the setinfo lines?
Yes, rarity is taken from setinfo. If setinfo is not supplied some default set and rarity are assigned.
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: Changes to card script format
by friarsol » 22 Feb 2013, 19:22
Looks like the picture field was still being used by Quest Pets, as mine no longer display their images.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Changes to card script format
by Max mtg » 22 Feb 2013, 19:30
1. Tokens are not displayed correctly, I suspect. Should download token pictures and investigate.friarsol wrote:Looks like the picture field was still being used by Quest Pets, as mine no longer display their images.
2. SVar:Picture was not deprecated.
3. Sol, do not use singletons.getmodel.getgame in classes which already have a game field (such classes as player*, gameaction*)
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: Changes to card script format
by friarsol » 22 Feb 2013, 19:41
Ah didn't realize Player had it already. I added the code to Card first and then just copied over the useful bits. Didn't expect the two GameEntities to be in different states as far as that goes.Max mtg wrote:3. Sol, do not use singletons.getmodel.getgame in classes which already have a game field (such classes as player*, gameaction*)
Edit: r19826
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Changes to card script format
by Max mtg » 22 Feb 2013, 19:59
Card should also have a reference to game, but I didn't yet drive the code to that state.
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: Changes to card script format
by friarsol » 22 Feb 2013, 20:06
Makes sense there's only so much mind-numbing conversions one can handle in a short amount of time.Max mtg wrote:Card should also have a reference to game, but I didn't yet drive the code to that state.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Changes to card script format
by Max mtg » 22 Feb 2013, 21:21
Speaking of quest tokens, do you know where to obtain them?
No beta release topic had any link to tokens, neither ones coming from sets, nor custom ones drawn for quest.
No beta release topic had any link to tokens, neither ones coming from sets, nor custom ones drawn for quest.
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: Changes to card script format
by friarsol » 22 Feb 2013, 21:35
Content Downloaders -> Download Quest ImagesMax mtg wrote:Speaking of quest tokens, do you know where to obtain them?
No beta release topic had any link to tokens, neither ones coming from sets, nor custom ones drawn for quest.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Changes to card script format
by myk » 22 Feb 2013, 21:45
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: Changes to card script format
by Max mtg » 22 Feb 2013, 22:52
Thanks, I already got the images and could see results by myself.
19834 fixes token images
19834 fixes token images
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: Changes to card script format
by myk » 22 Feb 2013, 23:04
No offense intended. Fix confirmed as of r19836.
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: Changes to card script format
by Max mtg » 25 Feb 2013, 18:28
Here is windows powershell script I applied it to all cardname.txt files
- Code: Select all
Get-ChildItem . | ForEach-Object -process { Get-ChildItem $_ | ForEach-Object -process { ( Get-Content $_.FullName ) | Where-Object -FilterScript { $_ -ne "Text:no text" } | Where-Object -FilterScript { $_ -ne "End" } | Set-Content $_.FullName } }
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
14 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 37 guests