It is currently 11 Sep 2025, 22:29
   
Text Size

Changes to card script format

Post MTG Forge Related Programming Questions Here

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

Changes to card script format

Postby 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)
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

Postby 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
User avatar
timmermac
Tester
 
Posts: 1512
Joined: 17 May 2010, 20:36
Has thanked: 18 times
Been thanked: 95 times

Re: Changes to card script format

Postby Max mtg » 22 Feb 2013, 13:32

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?
Deckeditor has not been using svar-rarity for over 9000 revisions - that is ~550 days.

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

Postby 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

Postby Max mtg » 22 Feb 2013, 19:30

friarsol wrote:Looks like the picture field was still being used by Quest Pets, as mine no longer display their images.
1. Tokens are not displayed correctly, I suspect. Should download token pictures and investigate.
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

Postby friarsol » 22 Feb 2013, 19:41

Max mtg wrote:3. Sol, do not use singletons.getmodel.getgame in classes which already have a game field (such classes as player*, gameaction*)
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.

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

Postby 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

Postby friarsol » 22 Feb 2013, 20:06

Max mtg wrote:Card should also have a reference to game, but I didn't yet drive the code to that state.
Makes sense there's only so much mind-numbing conversions one can handle in a short amount of time.
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

Postby 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.
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

Postby friarsol » 22 Feb 2013, 21:35

Max 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.
Content Downloaders -> Download Quest 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

Postby myk » 22 Feb 2013, 21:45

I know you haven't had a chance to test it yet, but just fyi, r19829 did not get the images back
Screen Shot 2013-02-22 at 1.44.15 pm.png
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

Postby Max mtg » 22 Feb 2013, 22:52

Thanks, I already got the images and could see results by myself.
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

Postby 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

Postby 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 } }
Commited as r19874
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 22 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 22 users online :: 0 registered, 0 hidden and 22 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 22 guests

Login Form