It is currently 09 Dec 2018, 19:17
   
Text Size

Card Development Questions

Post MTG Forge Related Programming Questions Here

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

Re: Card Development Questions

Postby Hanmac » 18 Aug 2016, 08:34

i did a big change with ChooseCardName
now it does use (I)CardFace objects.

that makes it possible for Alhammarret to select Split Card Names.

But please check if i broke something.
Hanmac
 
Posts: 937
Joined: 06 May 2013, 18:44
Has thanked: 228 times
Been thanked: 153 times

Re: Card Development Questions

Postby vinnie » 24 Oct 2016, 00:13

older request | Open
where I can find all the abbreviated names of the sets that put in ./pics/cards? Today I spent the whole afternoon trying without find any documentation.

I looked also in the sources that I could find in http://www.cardforge.link/releases/forge/ doing a grep of a knew name (grep -ir "bng" ./*), and never finding anything (I've been looking at forge-ai-1.5.56-sources.jar, forge-core-1.5.56-sources.jar, forge-gui-desktop-1.5.56-sources.jar, forge-game-1.5.56-sources.jar).

In forge-core I found the file CardEdition.java with the following comment:
* @param code the MTG 3-letter set code
* @param code2 the 2 (usually) letter code used for image filenames/URLs distributed by the HQ pics team that
* use Magic Workstation-type edition codes. Older sets only had 2-letter codes, and some of the 3-letter
* codes they use now aren't the same as the official list of 3-letter codes. When Forge downloads set-pics,
* it uses the 3-letter codes for the folder no matter the age of the set.

* @param mciCode the code used by magiccards.info website.
but this does not explain the situation.

In ./res/editions/ there is a list of all editions with this codenames but here are two examples:
Code: Select all
[metadata]
Code=LEB
Date=1993-10-01
Name=Limited Edition Beta
Code2=B
MciCode=be
Type=Core
BoosterCovers=1
Booster=11 Common, 3 Uncommon, 1 Rare
Foil=NotSupported
Beta edition is an old set but also if should still use 3 characters code (as written in the previous comment), it uses only the "B" in Code2.
OK, then all sets using the Code2? NO! here another example:

Code: Select all
[metadata]
Code=BNG
Date=2014-02-07
Name=Born of the Gods
MciCode=bng
Type=Expansion
BoosterCovers=3
Booster=10 Common, 3 Uncommon, 1 RareMythic, 1 BasicLand THS
This edition totally lacking Code2, and use the BNG as folder name.
Please where can I find a unique and updated source of abbreviations of the set?

Thanks


Here is the current full list (helped by forge cards site):
Code: Select all
10E   Tenth Edition
4E    Fourth Edition
5E    Fifth Edition
6E    Classic Sixth Edition
7E    Seventh Edition
8E    Eighth Edition
9E    Ninth Edition
A     Limited Edition Alpa
AL    Alliances
ALA   Shards of Alara
AN    Arabian Nights
AP    Apocalypse
AQ    Antiquities
ARB   Alara Reborn
ARC   Archenemy
AVR   Avacyn Restored
B     Limited Edition Beta
BFZ   Battle for Zendikar
BNG   Born of the Gods
BOK   Betrayers of Kamigawa
C13   Commander 2013
C14   Commander 2014
C15   Commander 2015
C16   Commander 2016
CFX   Conflux
CH    Chronicles
CHK   Champions of Kamigawa
CM1   Commander's Arsenal
CN2   Conspiracy: Take the Crown
CNS   Conspiracy
COM   Commander
CS    Coldsnap
DD2   Duel Decks: Jave vs. Chandra
DDC   Duel Decks: Divine vs. Demonic
DDD   Duel Decks: Garruk vs. Liliana
DDE   Duel Decks: Phyrexia vs. the Coalition
DDF   Duel Decks: Elpeth vs. tezzeret
DDG   Duel Decks: Knights vs. Dragons
DDH   Duel Decks: Ajani vs. Nicol Bolas
DDI   Duel Decks: Vanser vs. Koth
DDJ   Duel Decks: Izzet vs. Golgari
DDK   Duel Decks: Sorin vs. Tibalt
DDL   Duel Decks: Heroes vs. Monsters
DDM   Duel Decks: Jave vs. Vraska
DDN   Duel Decks: Speed vs. Cunning
DDO   Duel Decks: Kiora vs. Elspeth
DDP   Duel Decks: Zendikar vs. Eldrazi
DDQ   Duel Decks: Blessed vs. Cursed
DDR   Duel Decks: Nissa vs. Ob Nixilis
DGM   Dragon's Maze
DIS   Dissension
DK    The Dark
DKA   Dark Ascension
DRB   From the Vault: Dragons
DS    Darksteel
DTK   Dragons of Tarkir
EMA   Eternal Masters
EMN   Eldritch Moon
EVE   Eventide
EVG   Duel Decks: Elves vs. Goblins
EX    Exodus
EXP   Zendikar Expeditions
FD    Fifth Dawn
FE    Fallen Empires
FRF   Fate Reforged
FUT   Future Sight
FVE   From the Vault: Exiled
FVL   From The Vault: Legends
FVR   From the Vault: Relics
GP    Guildpact
GTC   GATECRASH
HL    Homelands
HOP   Planechase
IA    Ice Age
IN    Invasion
ISD   Innistrad
JOU   Journey into Nyx
JU    Judgment
KLD   kaladesh
KTK   Khans of Tarkir
LE    Legions
LG    Legends
LRW   Lorwyn
M10   Magic 2010
M11   Magic 2011
M12   Magic 2012
M13   Magic 2013
M14   Magic 2014
M15   Magic 2015
MBP   Promo set for Gatherer
MBS   Mirrodin Besieged
MI    Mirage
MM    Mercadian Masques
MM2   Modern Masters 2015
MMA   Modern Masters
MOR   Morningtide
MPS   kaladesh inventions
MR    Mirrodin
NE    Nemesis
NPH   New Phyrexia
OD    Odyssey
OGW   Oath of the Gatewatch
ON    Onslaught
ORI   Magic Origins
P2    Portal Second Age
P3    Portal Three Kingdoms
PC2   Planechase 2012 Edition
PD2   Premium Deck Series: Fire and Lightning
PD3   Premium Deck Series: Graveborn
PDS   Premium Deck Series: Slivers
PS    Planeshift
PLC   Planar Chaos
PT    Portal
PY    Prophecy
R     Revised Edition
RAV   Ravnica: City of Guilds
ROE   Rise of the Eldrazi
RTR   Return to Ravnica
S2K   Starter 2000
SC    Scourge
SH    Stronghold
SHM   Shadowmoor
SOI   Shadows Over Innistrad
SOK   Saviors of Kamigawa
SOM   Scars of Mirrodin
ST    Starter 1999
TE    Tempest
THS   Theros
TO    Torment
TPR   Tempest Remastered
TSB   Time Spiral "Timeshifted"
TSP   Time Spiral
U     Unlimited Edition
UD    Urza's Destiny
UGF   Ugin's Fate
UL    Urza's Legacy
US    Urza's Saga
V12   From the Vault: Realms
V13   From the Vault: Twenty
V14   From The Vault: Annihilation
V15   From the Vault: Angels
V16   From the Vault: Lore
VAN   Vanguard
VI    Visions
VMA   Vintage Masters
W16   Welcome 2016
WL    Weatherlight
WWK   Worldwake
ZEN   Zendikar
User avatar
vinnie
 
Posts: 104
Joined: 21 Dec 2015, 14:03
Has thanked: 23 times
Been thanked: 6 times

Re: Card Development Questions

Postby ShivaFang » 19 Jun 2017, 19:45

For my own use, I tried to create Vanquisher's Banner from the Ixalan leaks. Does this look right? I used the code from Door of Destinies and Argothian Enchantress to get it to work.

Code: Select all
Name:Vanquisher's Banner
ManaCost:5
Types:Artifact
K:ETBReplacement:Other:ChooseCT
SVar:ChooseCT:DB$ ChooseType | Defined$ You | Type$ Creature | SpellDescription$ As CARDNAME enters the battlefield, choose a creature type. | AILogic$ MostProminentInComputerDeck
T:Mode$ SpellCast | ValidCard$ Card.ChosenType | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDraw | TriggerDescription$ Whenever you cast a spell of the chosen type, draw a card.
SVar:TrigDraw:AB$Draw | Cost$ 0 | Defined$ You | NumCards$ 1
S:Mode$ Continuous | Affected$ Creature.ChosenType+YouCtrl | AddPower$ 1 | AddToughness$ 1 | Description$ Creatures you control of the chosen type get +1/+1.
SVar:BuffedBy:Creature
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/door_of_destinies.jpg
Oracle:As Vanquisher's Banner enters the battlefield, choose a creature type.\nCreatures you control of the chosen type get +1/+1.\nWhenever you cast a creature spell of the chosen type, draw a card.
ShivaFang
 
Posts: 100
Joined: 25 Jun 2016, 01:15
Has thanked: 26 times
Been thanked: 3 times

Re: Card Development Questions

Postby atilappl » 18 Nov 2018, 05:04

How can i implement dice rolling?
I will try to script Urza, Academy Headmaster based on rolling a twenty-sided dice.
atilappl
 
Posts: 2
Joined: 16 Jun 2018, 13:45
Has thanked: 1 time
Been thanked: 0 time

Re: Card Development Questions

Postby RumbleBBU » 28 Nov 2018, 15:03

atilappl wrote:How can i implement dice rolling?
I will try to script Urza, Academy Headmaster based on rolling a twenty-sided dice.
Unless it has been added in one of the more recent versions, no, I'm afraid die rolling isn't directly supported in Forge.

However...there is a very nice and powerful/flexible scriptable ability called GenericChoice that can be used to emulate die rolls to some extent.
Basically, it is used to choose one of several SubAbilities, and if you set the AtRandom$ to True, the choice will be made randomly, not too different from die rolls. Here's an example, a silly custom card I made quite a while ago (no idea whether it works in the current version of Forge but it should, unless something has been majorly changed since, which is of course possible...):

| Open
Name:Cranky Witch
ManaCost:B B
Types:Creature Human Wizard
PT:1/2
A:AB$ GenericChoice | Cost$ T | Choices$ R1,R2,R3,R4,R5,R6 | AtRandom$ True | Defined$ You | StackDescription$ SpellDescription | SpellDescription$ Roll a die. On a 1, skip your next untap step. On 2, discard a card. On a 3, lose 1 life. On a 4, gain 1 life. On a 5, put a +1/+1 counter on target creature. On a 6, draw a card.
SVar:R1:DB$ Pump | Cost$ 0 | Defined$ You | KW$ Skip your next untap step. | Permanent$ True | SpellDescription$ Skip your next untap step.
SVar:R2:DB$ Discard | Cost$ 0 | Defined$ You | NumCards$ 1 | Mode$ TgtChoose
SVar:R3:DB$ LoseLife | Cost$ 0 | Defined$ You | LifeAmount$ 1
SVar:R4:DB$ GainLife | Cost$ 0 | LifeAmount$ 1
SVar:R5:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | Choices$ Creature | SubAbility$ PumpCounter
SVar:PumpCounter:DB$ PutCounter | Cost$ 0 | Defined$ ChosenCard | CounterType$ P1P1 | CounterNum$ 1
SVar:R6:DB$ Draw | Cost$ 0 | NumCards$ 1 | SpellDescription$ Draw a card.
SVar:RemAIDeck:True
Oracle:{T}: Roll a die. On a 1, skip your next untap step. On 2, discard a card. On a 3, lose 1 life. On a 4, gain 1 life. On a 5, put a +1/+1 counter on target creature. On a 6, draw a card.


Note that I said that GenericChoice could be used to emulate die rolls "to some extent". There are some obvious limitations. If something tells you to roll several dice, e.g., two 6-sided dice, you will probably end up with 6*6 different GenericChoice outcomes (rather than 6+6). Take at look at this clunky script I came up with for Lydari Elephant some time ago to see what I mean:

| Open
Name:Lydari Elephant
ManaCost:4 G
Types:Creature Elephant
PT:2/2
K:etbCounter:GROWTH:1
A:AB$ GenericChoice | Cost$ SubCounter<1/GROWTH> | Choices$ P11,P12,P13,P14,P15,P21,P22,P23,P24,P25,P31,P32,P33,P34,P35,P41,P42,P43,P44,P45,P51,P52,P53,P54,P55 | AtRandom$ True | Defined$ You | StackDescription$ SpellDescription | SpellDescription$ CARDNAME gains +1/+0, +1/+1 and/or +0/+1 counters in a combination that gives it +1, +2, +3, +4, or +5 to its power and toughness, each chosen individually and randomly.
SVar:P11:DB$ PutCounter | CounterType$ P1P1 | CounterNum$ 1
SVar:P12:DB$ PutCounter | CounterType$ P0P1 | CounterNum$ 1 | SubAbility$ P11
SVar:P13:DB$ PutCounter | CounterType$ P0P1 | CounterNum$ 2 | SubAbility$ P11
SVar:P14:DB$ PutCounter | CounterType$ P0P1 | CounterNum$ 3 | SubAbility$ P11
SVar:P15:DB$ PutCounter | CounterType$ P0P1 | CounterNum$ 4 | SubAbility$ P11
SVar:P21:DB$ PutCounter | CounterType$ P1P0 | CounterNum$ 1 | SubAbility$ P11
SVar:P22:DB$ PutCounter | CounterType$ P1P1 | CounterNum$ 2
SVar:P23:DB$ PutCounter | CounterType$ P0P1 | CounterNum$ 1 | SubAbility$ P22
SVar:P24:DB$ PutCounter | CounterType$ P0P1 | CounterNum$ 2 | SubAbility$ P22
SVar:P25:DB$ PutCounter | CounterType$ P0P1 | CounterNum$ 3 | SubAbility$ P22
SVar:P31:DB$ PutCounter | CounterType$ P1P0 | CounterNum$ 2 | SubAbility$ P11
SVar:P32:DB$ PutCounter | CounterType$ P1P0 | CounterNum$ 1 | SubAbility$ P22
SVar:P33:DB$ PutCounter | CounterType$ P1P1 | CounterNum$ 3
SVar:P34:DB$ PutCounter | CounterType$ P0P1 | CounterNum$ 1 | SubAbility$ P33
SVar:P35:DB$ PutCounter | CounterType$ P0P1 | CounterNum$ 2 | SubAbility$ P33
SVar:P41:DB$ PutCounter | CounterType$ P1P0 | CounterNum$ 3 | SubAbility$ P11
SVar:P42:DB$ PutCounter | CounterType$ P1P0 | CounterNum$ 2 | SubAbility$ P22
SVar:P43:DB$ PutCounter | CounterType$ P1P0 | CounterNum$ 1 | SubAbility$ P33
SVar:P44:DB$ PutCounter | CounterType$ P1P1 | CounterNum$ 4
SVar:P45:DB$ PutCounter | CounterType$ P0P1 | CounterNum$ 1 | SubAbility$ P44
SVar:P51:DB$ PutCounter | CounterType$ P1P0 | CounterNum$ 4 | SubAbility$ P11
SVar:P52:DB$ PutCounter | CounterType$ P1P0 | CounterNum$ 3 | SubAbility$ P22
SVar:P53:DB$ PutCounter | CounterType$ P1P0 | CounterNum$ 2 | SubAbility$ P33
SVar:P54:DB$ PutCounter | CounterType$ P1P0 | CounterNum$ 1 | SubAbility$ P44
SVar:P55:DB$ PutCounter | CounterType$ P1P1 | CounterNum$ 5
SVar:RemAIDeck:True
Oracle:Lydari Elephant enters the battlefield with a growth counter on it.\nRemove growth counter from Lydari Elephant: CARDNAME gains +1/+0, +1/+1 and/or +0/+1 counters in a combination that gives it +1, +2, +3, +4, or +5 to its power and toughness, each chosen individually and randomly.


Also, if there are modifiers to the die rolls, like "add +1 to the roll if your wisdom is 17, or +2 if it is 18" (typical in pen&paper roleplaying games), you are in for a world of headache trying to translate all of them to GenericChoice. Let alone something along the lines of "Add +X to the die roll where X is the number of cards in your hand/graveyard/library"... *shudder*

Oh, and an important caveat! Targeting doesn't work like you expect in GenericChoice subroutines. More specifically, it doesn't work at all. (Again, unless it has been changed in a relatively recent version.) You will need to use ChooseCard instead (see the Cranky Witch example above, die roll 5). Which is kind of similar, yet isn't the same! For example, "Protection from color" means, among other things, that the card can't be targeted by a spell or ability of a specific color...but, AFAIK, when using ChooseCard, a spell of that color can still affect (i.e., effectively "target") a card that is supposed to have protection from the color.

As for Urza, Academy Headmaster ...wow, that is one tough cookie. Looking briefly, I didn't notice anything that outright couldn't be done, but wow, it would be an insanely immense task! Comparable to scripting 50 or so individual cards. Not to mention that some of the die roll results involve something like "flip a coin 5 times...". Again, that can be scripted, but that in itself translates to quite a few script lines...
And if you succeed, you will have one record-breakingly massive script file! Probably 50kb or more. :lol:
User avatar
RumbleBBU
 
Posts: 380
Joined: 18 Aug 2012, 04:24
Has thanked: 29 times
Been thanked: 62 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 7 guests


Who is online

In total there are 7 users online :: 0 registered, 0 hidden and 7 guests (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 7 guests

Login Form