It is currently 16 Apr 2024, 19:10
   
Text Size

Custom Card Thread

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

Re: Custom Card Thread

Postby WindSparrow » 21 Aug 2017, 01:37

Hi,

Is it possible for me to force a Charm effect to be chosen at random? I am attempting to recreate Faerie Dragon in Forge (ref. this thread) and hope to try to make the process as streamlined as possible. If not, is it possible for me to make a workaround using coinflips, based on Fiery Gambit?
His is the fury of the wildfire, the boiling blood of the volcano. He fights you not because you've wronged him, but because you're there.
User avatar
WindSparrow
 
Posts: 13
Joined: 11 Jun 2014, 00:30
Has thanked: 2 times
Been thanked: 0 time

Re: Custom Card Thread

Postby RumbleBBU » 21 Aug 2017, 07:26

It's definitely possible. Use GenericChoice with the "AtRandom$" parameter set to true. Take a look at Master of the Wild Hunt Avatar to see how it is done.

As another example, here is an implementation of Goblin Tutor using GenericChoice:

Code: Select all
Name:Goblin Tutor
ManaCost:R
Types:Instant
A:SP$ GenericChoice | Cost$ R | Choices$ NoEffect,SGoblinTutor,SEnchantment,SArtifact,SCreature,SSorcInstant | AtRandom$ True | Defined$ You | StackDescription$ SpellDescription | SpellDescription$ Roll a die. On a 1, CARDNAME has no effect. Otherwise search your library for the indicated card, reveal that card to all players, and put it into your hand. Shuffle your library afterwards. 2: Goblin Tutor. 3: Any enchantment. 4: Any artifact. 5: Any creature. 6: Any instant or sorcery.
SVar:SGoblinTutor:DB$ ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Hand | ChangeType$ Card.namedGoblinTutor | ChangeNum$ 1 | SpellDescription$ Search your library for a Goblin Tutor.
SVar:SEnchantment:DB$ ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Hand | ChangeType$ Enchantment | ChangeNum$ 1 | SpellDescription$ Search your library for an enchantment.
SVar:SArtifact:DB$ ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Hand | ChangeType$ Artifact | ChangeNum$ 1 | SpellDescription$ Search your library for an artifact.
SVar:SCreature:DB$ ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Hand | ChangeType$ Creature | ChangeNum$ 1 | SpellDescription$ Search your library for a creature.
SVar:SSorcInstant:DB$ ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Hand | ChangeType$ Sorcery,Instant | ChangeNum$ 1 | SpellDescription$ Search your library for a sorcery or instant.
SVar:NoEffect:DB$ Cleanup | SpellDescription$ Do nothing
SVar:RemAIDeck:True
Oracle:Roll a die. On a 1, CARDNAME has no effect. Otherwise search your library for the indicated card, reveal that card to all players, and put it into your hand. Shuffle your library afterwards. 2: Goblin Tutor. 3: Any enchantment. 4: Any artifact. 5: Any creature. 6: Any instant or sorcery.
(Yeah, the DBCleanup call for 'Do Nothing' is a bit dumb, so sue me. :) )

An important caveat: I have discovered through experience that picking a target doesn't work as expected after the random GenericChoice. In other words, if you want to use a random effect that has a target, you will need to choose a target first (ChooseCard works here), then do the effect on the chosen card. Otherwise it will simply do nothing. Here is a sample script for such an ability, I think this could be adapted for Faerie Dragon. (I wrote this for an earlier version of Forge but I believe it would still work.)

Code: Select all
A:AB$ GenericChoice | Cost$ 0 |  Choices$ WPumpA3,WPumpD3,WPumpFly,WPumpFS,WPumpFly,WPumpHurt,WWasp,WBazaar,WArmy,WMill,WMillYou,WSac,WSacYou,WDam,WDamYou,WHeal,WHealOpp | AtRandom$ True | Defined$ You | StackDescription$ SpellDescription | SpellDescription$ Play a random effect.
SVar:WCounterP1P1:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ PutCounter1
SVar:PutCounter1:DB$ PutCounter | Cost$ 0 | CounterType$ P1P1 | CounterNum$ 1 | Defined$ ChosenCard
SVar:WCounterM1M1:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ PutCounter2
SVar:PutCounter2:DB$ PutCounter | Cost$ 0 | CounterType$ M1M1 | CounterNum$ 1 | Defined$ ChosenCard
SVar:WPumpA3:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ PumpA3
SVar:PumpA3:DB$ Pump | Cost$ 0 | Defined$ ChosenCard | NumAtt$ +3
SVar:WPumpD3:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ PumpD3
SVar:PumpD3:DB$ Pump | Cost$ 0 | Defined$ ChosenCard | NumDef$ +3
SVar:WPumpFly:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ PumpFly
SVar:PumpFly:DB$ Pump | Cost$ 0 | Defined$ ChosenCard | KW$ Flying
SVar:WPumpFS:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ PumpFS
SVar:PumpFS:DB$ Pump | Cost$ 0 | Defined$ ChosenCard | KW$ First Strike
SVar:WPumpHurt:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ PumpHurt
SVar:PumpHurt:DB$ DealDamage | Defined$ ChosenCard | NumDmg$ 2
SVar:WWasp:DB$ Token | Cost$ 5 0 | TokenAmount$ 1 | TokenName$ Wasp | TokenTypes$ Artifact,Creature,Insect | TokenOwner$ You | TokenColors$ Colorless | TokenPower$ 1 | TokenToughness$ 1 | TokenKeywords$ Flying | SpellDescription$ Put a 1/1 colorless Insect artifact creature token with flying named Wasp onto the battlefield.
SVar:WBazaar:DB$ Draw | Cost$ 0 | NumCards$ 2 | SpellDescription$ Draw two cards, then discard three cards. | SubAbility$ DBBazDiscard
SVar:DBBazDiscard:DB$Discard | Defined$ You | NumCards$ 3 | Mode$ TgtChoose
SVar:WArmy:DB$PumpAll | Cost$ 0 | ValidCards$ Creature.attacking | NumAtt$ 2 | SpellDescription$ Attacking creatures get +2/+0 until end of turn.
SVar:WMill:DB$Mill| Cost$ 0 | NumCards$ 2 | Defined$ Player.Opponent | SpellDescription$ Your opponent puts the top two cards of his or her library into his or her graveyard.
SVar:WMillYou:DB$Mill| Cost$ 0 | NumCards$ 2 | Defined$ You | SpellDescription$ You put the top two cards of your library into your graveyard.
SVar:WSacYou:DB$Sacrifice | Cost$ 0 | Defined$ You | SacValid$ Card | SacMessage$ Permanent | SpellDescription$ You sacrifice a permanent.
SVar:WSac:DB$Sacrifice | Cost$ 0 | Defined$ Player.Opponent | SacValid$ Card | SacMessage$ Permanent | SpellDescription$ Your opponent sacrifices a permanent.
SVar:WDam:DB$ DealDamage | Cost$ 0 | Defined Player.Opponent | NumDmg$ 2 | SpellDescription$ CARDNAME deals 2 damage to opponent.
SVar:WDamYou:DB$ DealDamage | Cost$ 0 | Defined You | NumDmg$ 2 | SpellDescription$ CARDNAME deals 2 damage to you.
SVar:WHeal:DB$ GainLife | Cost$ 0 | LifeAmount$ 0 | Defined$ You | SpellDescription$ You gain 2 life.
SVar:WHealOpp:DB$ GainLife | Cost$ 0 | LifeAmount$ 0 | Defined$ Player.Opponent | SpellDescription$ Your opponent gains 2 life.
User avatar
RumbleBBU
 
Posts: 394
Joined: 18 Aug 2012, 04:24
Has thanked: 29 times
Been thanked: 66 times

Re: Custom Card Thread

Postby WindSparrow » 21 Aug 2017, 21:01

Thank you! If you don't mind me asking - what does DB$ stand for? I'm not exactly sure where to locate the reference for it in the source code.

Also, when I tried to implement the effect based on second script, I'm currently getting a NullPointerException error along with a bunch of error messages I'm not sure I fully understand. I have also provided my card code for reference - could someone help me identify the error?

NullPointerException | Open
Code: Select all
Forge Version:    1.6.2-r-1
Operating System: Windows 8.1 6.3 x86
Java Version:     1.8.0_144 Oracle Corporation

java.lang.NullPointerException
   at forge.game.spellability.SpellAbility.setAdditionalAbilityList(SpellAbility.java:746)
   at forge.game.ability.AbilityFactory.getAbility(AbilityFactory.java:246)
   at forge.game.ability.AbilityFactory.getAbility(AbilityFactory.java:146)
   at forge.game.ability.AbilityFactory.getAbility(AbilityFactory.java:129)
   at forge.game.ability.AbilityFactory.getAbility(AbilityFactory.java:112)
   at forge.game.card.CardFactoryUtil.addAbilityFactoryAbilities(CardFactoryUtil.java:1932)
   at forge.game.card.CardFactory.readCardFace(CardFactory.java:468)
   at forge.game.card.CardFactory.readCard(CardFactory.java:396)
   at forge.game.card.CardFactory.getCard(CardFactory.java:255)
   at forge.game.card.CardFactory.getCard(CardFactory.java:250)
   at forge.game.card.Card.fromPaperCard(Card.java:5338)
   at forge.game.Match.preparePlayerLibrary(Match.java:185)
   at forge.game.Match.prepareAllZones(Match.java:247)
   at forge.game.Match.startGame(Match.java:74)
   at forge.match.HostedMatch$2.run(HostedMatch.java:224)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Card Code | Open
Code: Select all
Name:Faerie Dragon
ManaCost:2 G G
Types:Creature Beast
PT:2/3
K:Flying
A:AB$ GenericChoice | Cost$ 1 G G | Choices$ TFDLifelace, TFDPurelace | Defined$ You | AtRandom$ True | StackDescription$ SpellDescription | SpellDescription$ Play a random effect.

SVar:TFDLifelace:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDLifelace
SVar:FDLifelace:DB$ Animate | Cost$ 0 | Defined$ ChosenCard | Colors$ Green | OverwriteColors$ True | Permanent$ True

SVar:TFDPurelace:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDPurelace
SVar:FDPurelace:DB$ Animate | Cost$ 0 | Defined$ ChosenCard | Colors$ White | OverwriteColors$ True | Permanent$ True

SVar:RemAIDeck:True
SVar:Picture:https://deckmaster.info/images/cards/AST/-885-hr.jpg
Oracle:Flying\n{!}{G}{G}: Target creature becomes green. (Mana symbols on that permanent remain unchanged.)
EDIT: I appear to have solved the issue by tweaking the SubAbility code to the following, but still I'm not sure why the original NullPointerError happened and would like to understand better - if anyone can tell me what I did incorrectly with my original version that'd be greatly appreciated.

Code: Select all
SVar:FDLifelace:DB$ Animate | Cost$ 0 | Colors$ Green | OverwriteColors$ True | Defined$ ChosenCard | Permanent$ True | TgtPrompt$ Select target creature | SpellDescription$ Target creature becomes green. (Mana symbols on that permanent remain unchanged.)
His is the fury of the wildfire, the boiling blood of the volcano. He fights you not because you've wronged him, but because you're there.
User avatar
WindSparrow
 
Posts: 13
Joined: 11 Jun 2014, 00:30
Has thanked: 2 times
Been thanked: 0 time

Re: Custom Card Thread

Postby RumbleBBU » 22 Aug 2017, 05:59

The philosophical difference between AB$ and DB$ seems to be that AB$ ("ability") is used for the main ability, and DB$ ("drawback") for its various SubAbilities. However, it is not always obvious when you are supposed to use AB$ and when to use DB$ (esp. with triggers), and that has even changed from one version of Forge to another. Some of the cards I made for an earlier version of Forge with special AB$ triggers crashed the current Forge because that version wanted DB$ triggers instead. (Yes, they worked in the older version.)
Also note that 'DB$' abilities work a little differently from 'AB$' abilities. They don't use Cost, and their SpellDescriptions are not shown, which can be a bummer. You can throw a random ability effect and have no way of knowing whether you got a beneficial or harmful one!

In your example, however, it seems to me that the problem is nothing more than the space (!) in the 'Choices$' list. Choices$ expects a comma-separated list, not a 'comma-and-space-seprated' list, i.e., "Choices$ option1,option2,option3", not "Choices$ option1, option2, option3". Doing the latter causes the NPE.

So you could try this...

| Open
Code: Select all
Name:Faerie Dragon
ManaCost:2 G G
Types:Creature Beast
PT:2/3
K:Flying
A:AB$ GenericChoice | Cost$ 1 G G | Choices$ TFDLifelace,TFDPurelace | Defined$ You | AtRandom$ True | StackDescription$ SpellDescription | SpellDescription$ Play a random effect.

SVar:TFDLifelace:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDLifelace
SVar:FDLifelace:DB$ Animate | Cost$ 0 | Defined$ ChosenCard | Colors$ Green | OverwriteColors$ True | Permanent$ True

SVar:TFDPurelace:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDPurelace
SVar:FDPurelace:DB$ Animate | Cost$ 0 | Defined$ ChosenCard | Colors$ White | OverwriteColors$ True | Permanent$ True

SVar:RemAIDeck:True
SVar:Picture:https://deckmaster.info/images/cards/AST/-885-hr.jpg
Oracle:Flying\n{!}{G}{G}: Target creature becomes green. (Mana symbols on that permanent remain unchanged.)
As an aside, I wrote Forge scripts for those old Microprose Astral cards, as well as Sega Dreamcast cards, some time last year. IIRC, I did all of them, with some exceptions:
- Some cards didn't script well. At least the version of Forge I was using didn't support something I needed. Most notably, random ETB abilities didn't work (see Rainbow Knights). Instead, as a workaround, I made Rainbow Knights enter the battlefield with a shield counter that they could remove to gain their permanent random protection.
- I had no idea what to do with those "Random fast effects" cards (Whimsy, Faerie Dragon). I sure could have used that list you linked above. :)
- The color changing ability of Prismatic Dragon was pretty much useless because it was next to impossible to figure out which color it was when you wanted to know. The current Forge is better because you get that information from the frame color.
- As for the Sega Dreamcast cards, I remember I could never make Tornellian Protector work as intended. I gave up. (IDK if the current Forge could enable its functionality.)
- Also, there was a green creature (Lydari Druid or something) that would turn all lands into random basic lands. My implementation did, but after that, the changed lands would remain that type for the rest of the game no matter what, and a second Lydari Druid would not change them again.

If there is interest, I could dig up those scripts and post them.
User avatar
RumbleBBU
 
Posts: 394
Joined: 18 Aug 2012, 04:24
Has thanked: 29 times
Been thanked: 66 times

Re: Custom Card Thread

Postby WindSparrow » 23 Aug 2017, 02:13

That part about the spaces makes sense. Thank you!

I am intending to do Faerie Dragon and Whimsy first and then complete all the videogame cards, haha, so I'd love to see those scripts and perhaps even re-do the cards you were having issues with. Feel free to post/PM them! :)

EDIT 1: For fairness's sake, I may try replacing DBs with ABs as well, as seeing what effect you rolled might be a tad less feel-bad.

EDIT 2: It looks like I am not able to change the DBs into ABs without crashing Forge. Ah well. XD
Also, it seems my current version of Berserk will grant Trample, but not the P/T boost - the "destroy at end step" trigger does show up but if my Dragon attacked it doesn't seem to work, strangely - here is my current script.
Old Code | Open
Code: Select all
Name:Faerie Dragon
ManaCost:2 G G
Types:Creature Beast
PT:2/3
K:Flying
A:AB$ GenericChoice | Cost$ 0 | Choices$ TFDBerserk,TFDPurelace,TFDThoughtlace,TFDDeathlace,TFDChaoslace,TFDLifelace | Defined$ You | AtRandom$ True | StackDescription$ SpellDescription | SpellDescription$ Play a random effect.

#Berserk, without the timing restriction

SVar:TFDBerserk:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDBerserk
SVar:FDBerserk:DB$ Pump | Cost$ 0 | NumAtt$ X | KW$ Trample | Defined$ ChosenCard | TgtPrompt$ Select target creature | References$ X | SubAbility$ FDBDelTrig
SVar:FDBDelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ End Of Turn | Execute$ FDBTrigDestroy | RememberObjects$ ChosenCard | TriggerDescription$ At the beginning of the next end step, destroy that creature if it attacked this turn. | AILogic$ Always
SVar:FDBTrigDestroy:DB$ Destroy | Defined$ DelayTriggerRemembered | ConditionDefined$ DelayTriggerRemembered | ConditionPresent$ ChosenCard.attackedThisTurn | ConditionCompare$ GE1
SVar:X:Targeted$CardPower

#The Five Purelace effects
SVar:TFDPurelace:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDPurelace
SVar:FDPurelace:DB$ Animate | Cost$ 0 | Colors$ White | OverwriteColors$ True | Defined$ ChosenCard | Permanent$ True | TgtPrompt$ Select target creature

SVar:TFDThoughtlace:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDThoughtlace
SVar:FDThoughtlace:DB$ Animate | Cost$ 0 | Colors$ Blue | OverwriteColors$ True | Defined$ ChosenCard | Permanent$ True | TgtPrompt$ Select target creature

SVar:TFDDeathlace:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDDeathlace
SVar:FDDeathlace:DB$ Animate | Cost$ 0 | Colors$ Black | OverwriteColors$ True | Defined$ ChosenCard | Permanent$ True | TgtPrompt$ Select target creature

SVar:TFDChaoslace:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDChaoslace
SVar:FDChaoslace:DB$ Animate | Cost$ 0 | Colors$ Red | OverwriteColors$ True | Defined$ ChosenCard | Permanent$ True | TgtPrompt$ Select target creature

SVar:TFDLifelace:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDLifelace
SVar:FDLifelace:DB$ Animate | Cost$ 0 | Colors$ Green | OverwriteColors$ True | Defined$ ChosenCard | Permanent$ True | TgtPrompt$ Select target creature

SVar:RemAIDeck:True
SVar:Picture:https://deckmaster.info/images/cards/AST/-885-hr.jpg
Oracle:Flying\n{1}{G}{G}: Play a random effect.
My main issue seems to be that I am not sure how to get certain properties of ChosenCard. I tried a simplified version in the form of:
Code: Select all
SVar:TFDBerserk:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ PumpA3
SVar:PumpA3:DB$ Pump | Cost$ 0 | Defined$ ChosenCard | NumAtt$ ChosenCard.CardPower
But that has no effect either.


EDIT 3: Solved the Berserk problem! I now have a functioning workaround using Imprint! (the function not the ability XD) Current state of the dragon:

Code: Select all
Name:Faerie Dragon
ManaCost:2 G G
Types:Creature Beast
PT:2/3
K:Flying
A:AB$ GenericChoice | Cost$ 0 | Choices$ TFDBerserk,TFDPurelace,TFDThoughtlace,TFDDeathlace,TFDChaoslace,TFDLifelace | Defined$ You | AtRandom$ True | StackDescription$ SpellDescription | SpellDescription$ Play a random effect.

#Berserk, without the timing restriction

SVar:TFDBerserk:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ TFDBerserkImprint
SVar:TFDBerserkImprint:DB$ Pump | Defined$ ChosenCard | ImprintCards$ ChosenCard | SubAbility$ FDBerserk | StackDescription$ None

SVar:FDBerserk:DB$ Pump | Cost$ 0 | NumAtt$ X | KW$ Trample | Defined$ ChosenCard | TgtPrompt$ Select target creature | References$ X | SubAbility$ FDBDelTrig
SVar:FDBDelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ End Of Turn | Execute$ FDBTrigDestroy | RememberObjects$ Imprinted | TriggerDescription$ At the beginning of the next end step, destroy that creature if it attacked this turn. | AILogic$ Always
SVar:FDBTrigDestroy:DB$ Destroy | Defined$ DelayTriggerRemembered | ConditionDefined$ DelayTriggerRemembered | ConditionPresent$ Card.attackedThisTurn | ConditionCompare$ GE1
SVar:X:Imprinted$CardPower


#The Five Purelace effects
SVar:TFDPurelace:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDPurelace
SVar:FDPurelace:DB$ Animate | Cost$ 0 | Colors$ White | OverwriteColors$ True | Defined$ ChosenCard | Permanent$ True | TgtPrompt$ Select target creature

SVar:TFDThoughtlace:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDThoughtlace
SVar:FDThoughtlace:DB$ Animate | Cost$ 0 | Colors$ Blue | OverwriteColors$ True | Defined$ ChosenCard | Permanent$ True | TgtPrompt$ Select target creature

SVar:TFDDeathlace:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDDeathlace
SVar:FDDeathlace:DB$ Animate | Cost$ 0 | Colors$ Black | OverwriteColors$ True | Defined$ ChosenCard | Permanent$ True | TgtPrompt$ Select target creature

SVar:TFDChaoslace:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDChaoslace
SVar:FDChaoslace:DB$ Animate | Cost$ 0 | Colors$ Red | OverwriteColors$ True | Defined$ ChosenCard | Permanent$ True | TgtPrompt$ Select target creature

SVar:TFDLifelace:DB$ ChooseCard | Defined$ You | Cost$ 0| Amount$ 1 | AtRandom$ True | Choices$ Creature | SubAbility$ FDLifelace
SVar:FDLifelace:DB$ Animate | Cost$ 0 | Colors$ Green | OverwriteColors$ True | Defined$ ChosenCard | Permanent$ True | TgtPrompt$ Select target creature

SVar:RemAIDeck:True
SVar:Picture:https://deckmaster.info/images/cards/AST/-885-hr.jpg
Oracle:Flying\n{1}{G}{G}: Play a random effect.
His is the fury of the wildfire, the boiling blood of the volcano. He fights you not because you've wronged him, but because you're there.
User avatar
WindSparrow
 
Posts: 13
Joined: 11 Jun 2014, 00:30
Has thanked: 2 times
Been thanked: 0 time

Re: Custom Card Thread

Postby RumbleBBU » 25 Aug 2017, 07:22

WindSparrow wrote:I am intending to do Faerie Dragon and Whimsy first and then complete all the videogame cards, haha, so I'd love to see those scripts and perhaps even re-do the cards you were having issues with. Feel free to post/PM them! :)
Here you are. The latest versions of my Microprose Astral and Sega Dreamcast conversion experiments.

Some release notes:

I deliberately made the activation cost of Necropolis of Azar {4} + remove counter instead of {5} + remove counter (as per the original version). I thought the original effect was overcosted, after all you need those counters to activate it (and the created Spawn thingies tend to be rather weak, except against black, but black creatures don't give you needed counters). Change it back to {5} if you wish.

Couldn't make Rainbow Knights and the relatively similar(ish) Camato Scout work quite as intended. Random ETB abilities didn't work. So I gave them an ETB counters instead that they can remove to gain their random abilities.

"X random target creatures" cards (Goblin Polka Band, Saji's Torrent at least) don't work when you pay more X than the number of creatures the spell could target.

When a Lydari Druid turns lands into random basic lands, the change is very permanent. In other words, a second Lydari Druid will have no effect on lands that have been changed already.

The Oracle texts are could use some improvement. In general, templating could be better. It isn't consistent nor does it follow the current official templating (e.g., I used "put onto the battlefield" instead of "create").

Missing cards:
- Whimsy, Faerie Dragon (because I didn't know what to do with the "random fast effect").
- Tornellan Protector. Try as I might, just couldn't get it to work. (Like, who cares, the card is junk anyway. :lol: )

Oh, a final caveat: A used a slightly older version of Forge when I scripted these. I haven't tested them under the current Forge. If you notice problems, let me know.
Attachments
sega_dreamcast_mtg.zip
(5.2 KiB) Downloaded 651 times
microprose_astral.zip
(5.72 KiB) Downloaded 605 times
User avatar
RumbleBBU
 
Posts: 394
Joined: 18 Aug 2012, 04:24
Has thanked: 29 times
Been thanked: 66 times

Re: Custom Card Thread

Postby lordknightstradmore » 09 Sep 2017, 15:18

Can you guys help me a bit on my first custom card?

its about a Golgari(G/B) creature that steals one(1) -1/-1 Counter on each available creatures with -1/-1 counter on ETB, then at anytime this creature holds a specific number of -1/-1 counters, it exiles itself then return to the field Transformed into a Planeswalker card similar to Chandra, Fire of Kaladesh in Origin.

as a Transformed Planeswalker, this creature has an Emblem
"Allows creatures to gain -1/-1 counters if restrictions occur.(For Solemnity)
-1/-1 counters cannot be:
Reduced(For effects like Vizier of Remedies)
Removed(For effects like Hapatra's Mark)."

Im not looking for the final finished code, rather I wanted a step by step procedure in coding a custom card for Forge.

If the card effect written above are somewhat uncode-able(maybe there are no effect like that in mtg,etc.), please do suggest different effects that is complements a deck that focuses on -1/-1 counter.

everones help will be appreciated, thanks
"A failure is simply another opportunity for
improvement. Just wait until you see what I
come up with next
."
-Nimble Innovator
lordknightstradmore
 
Posts: 28
Joined: 26 Aug 2017, 17:58
Has thanked: 2 times
Been thanked: 10 times

Re: Custom Card Thread

Postby Victre151 » 26 Oct 2017, 05:20

Hey if anyone could help me script this u would be amazing making custom commander decks and this is for one of them maybe somone could tell me how to so wont need lots of help all the time
Attachments
Shaman of Rot.full.jpg
Okina Deathmage.full.jpg
Heirloom Pendant.full.jpg
From the Archives.full.jpg
Druid Of Pain.full.jpg
Deaths Eldest.full.jpg
Blood-Rite Elf.full.jpg
Blood-Moon.full.jpg
Blood Lotus.full.jpg
Ancient Elf.full.jpg
Victre151
 
Posts: 3
Joined: 04 Oct 2017, 17:42
Has thanked: 0 time
Been thanked: 0 time

Re: Custom Card Thread

Postby RumbleBBU » 02 Nov 2017, 19:02

Victre151 wrote:Hey if anyone could help me script this u would be amazing making custom commander decks and this is for one of them maybe somone could tell me how to so wont need lots of help all the time
For starters, if you haven't already, you could read my post:
viewtopic.php?f=26&t=19637

After that, IMO the best way to proceed is to find cards that are "close enough" to what you're trying to do. For example,for your Blood Lotus, you could take Black Lotus as your template:

Code: Select all
Name:Black Lotus
ManaCost:0
Types:Artifact
A:AB$ Mana | Cost$ T Sac<1/CARDNAME> | Produced$ Any | Amount$ 3 | AILogic$ BlackLotus | SpellDescription$ Add three mana of any one color to your mana pool.
SVar:Picture:http://www.wizards.com/global/images/magic/general/black_lotus.jpg
Oracle:{T}, Sacrifice Black Lotus: Add three mana of any one color to your mana pool.
Then you start modifying it.

1) The first change is obvious enough. Change the card name to:

Code: Select all
Name:Blood Lotus
2) The next one is where things get interesting. You want to change the activation line. There are a couple of things you want to change here:
- Add a call to a new subroutine that deals 1 damage to you.
- Change the ability description accordingly.
With these, the ability line (A:AB$) could look something like this:
Code: Select all
A:AB$ Mana | Cost$ T Sac<1/CARDNAME> | Produced$ Any | Amount$ 3 | AILogic$ BlackLotus | SubAbility$ DBHurt | SpellDescription$ Add three mana of any one color to your mana pool. CARDNAME deals 1 damage to you.
3) You also need to add the drawback ability. As it happens, painlands already do what you want. So you could look how it's done there and add a similar ability line:
Code: Select all
SVar:DBHurt:DB$ DealDamage | NumDmg$ 1 | Defined$ You
4) Remove the image download link.

5) Modify the Oracle line accordingly.

So, the finished card could look something like this (warning, haven't actually tested it, so no guarantees):

Code: Select all
Name:Blood Lotus
ManaCost:0
Types:Artifact
A:AB$ Mana | Cost$ T Sac<1/CARDNAME> | Produced$ Any | Amount$ 3 | AILogic$ BlackLotus | SubAbility$ DBHurt | SpellDescription$ Add three mana of any one color to your mana pool. CARDNAME deals 1 damage to you.
SVar:DBHurt:DB$ DealDamage | NumDmg$ 1 | Defined$ You
Oracle:{T}, Sacrifice Blood Lotus: Add three mana of any one color to your mana pool. Blood Lotus deals 1 damage to you.
Hope this helps you get started. (Alternatively, you could try to find some kind soul willing to script the exact cards you want.)

As an aside, I find some of your cards...rather competitively costed for what they do.
User avatar
RumbleBBU
 
Posts: 394
Joined: 18 Aug 2012, 04:24
Has thanked: 29 times
Been thanked: 66 times

Re: Custom Card Thread

Postby azcotic » 14 Jan 2018, 02:58

Hi, i trying to code a custom set call it Netropolis http://www.planesculptors.net/set/netropolis/version-10.

Is really cool, like Ghost in The Shell and not the scarlett Johansson version.

NETROPOLIS is a cyberpunk-themed custom Magic set which takes place in a dystopic, technologically-advanced city. Players can Upload data to the Net for an information advantage, Arm their forces with deadly weapons, wrestle for Supremacy, or attack their opponents with malicious Viruses. Enlist hackers to your cause, join the undergunned rebels, make deals with corrupt corporations, or throw your lot in with the city’s seedy mutant underground.


WELL enough Context, the set has 260 cards, and already code it 150, now i need help with a very new mechanic, Upload.

Upload (To upload a card, exile it face-up. Its owner may pay 2 to return it to his or her hand any time he or she could cast a sorcery.)
Image
Image

Im trying this, but dosent add the ability to the remembered card.

| Open
Name:Viral Fame
ManaCost:W
Types:Instant
A:SP$ ChangeZone | Cost$ W | ValidTgts$ Creature | TgtPrompt$ Select target creature | Origin$ Battlefield | Destination$ Exile | ChangeType$ Card | RememberChanged$ True | SpellDescription$ Upload target creature. | StackDescription$ SpellDescription | SubAbility$ DBEffect
SVar:DBEffect:DB$ Effect | RememberObjects$ Remembered | StaticAbilities$ STUpload | Duration$ Permanent | Triggers$ TrigCleanup | SVars$ DBExileSelf| SubAbility$ DBCleanup
SVar:STUpload:Mode$ Continuous | EffectZone$ Command | MayPlay$ True | Affected$ Card.IsRemembered | AffectedZone$ Exile | AddAbility$ ABDownload | Description$ Exiled card has "{2}, Return CARDNAME to its owner's hand".
SVar:ABDownload:AB$ChangeZone | Cost$ 2 | SorcerySpeed$ True | ActivationZone$ Exile | Origin$ Exile | Destination$ Hand | SpellDescription$ Return CARDNAME to its owner's hand.
SVar:TrigCleanup:Mode$ ChangesZone | ValidCard$ Card.IsRemembered | Origin$ Exile | Destination$ Any | TriggerZones$ Command | Execute$ DBExileSelf | Static$ True
SVar:DBExileSelf:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:Picture:
Oracle:Exile target creature.
azcotic
 
Posts: 34
Joined: 27 Aug 2017, 03:58
Has thanked: 2 times
Been thanked: 9 times

Re: Custom Card Thread

Postby Taris36 » 15 Jan 2018, 23:40

Your set looks good so far. Hoping for a download soon.
Taris36
 
Posts: 16
Joined: 05 Mar 2016, 21:19
Has thanked: 1 time
Been thanked: 0 time

Re: Custom Card Thread

Postby Sprague » 23 Jan 2018, 03:22

Hello! I'm trying to make these planeswalker ability (yes, probably broken, but I'll work on balance later)

+2: You may exile a nontoken creature you control. If you do, you gain 2 life and target opponent exiles a card from his or her hand.
-2: Target player exiles a creature he or she controls.
-5: Sacrifice Monika, Remorseful Tyrant. Put all exiled permanent cards onto the battlefield under your control.

For the +2:
I can do the "you may exile a nontoken creature" part fine. The problem is making it check if you did exile, then doing the "gain 2 life and target opponent exiles..." effect.

If it were a sacrifice effect and not an exile effect, I could use the code from Daretti, Ingenious Iconoclast's second ability. He has a
Code: Select all
RememberSacrificed$ True
line. Is there some equivalent for what I need to do?

There might also be a cleaner way to implement the "you may exile" effect. Currently, it's really an "exile up to one target" effect. Not sure if that's the standard way to do this.

For the -2:
I tried using the code from Doomfall. However, once I activate the ability and select a target player, the planeswalker exiles herself, and no creature gets exiled (not even if I target myself).

I suppose I could just make it a sacrifice ability, a la Liliana of the Veil, and also add an effect like "When that creature dies this turn, exile it," but that seems janky, and it might mess up the AI.

Here's the code so far:

Code: Select all
Name:Monika, Remorseful Tyrant
ManaCost:1 W B
Types:Legendary Planeswalker Monika
Loyalty:3
A:AB$ ChangeZone | Cost$ AddCounter<2/LOYALTY> | Planeswalker$ True | TargetMin$0 | TargetMax$ 1 |  ValidTgts $Creature.YouCtrl+nonToken | Optional$ True | TgtPrompt$ Select target nontoken creature you control | Origin$ Battlefield | Destination$ Exile | SpellDescription$ You may exile a nontoken creature you control. If you do, you gain 2 life and target opponent exiles a card from his or her hand.
A:AB$ ChangeZone | Cost$ SubCounter<2/LOYALTY> | Planeswalker$ True | Origin$ Battlefield | Destination$ Exile | ValidTgts$ Player | DefinedPlayer$ Targeted | Mandatory$ True | ChangeType$ Creature | ChangeNum$ 1 | IsCurse$ True | Chooser$ Targeted | SpellDescription$ Target player exiles a creature he or she controls.
Last edited by Sprague on 23 Jan 2018, 04:43, edited 1 time in total.
Sprague
 
Posts: 17
Joined: 13 Nov 2017, 17:39
Has thanked: 19 times
Been thanked: 1 time

Re: Custom Card Thread

Postby Sprague » 25 Mar 2018, 04:08

Is there a way to script a effect that triggers when a card is drawn and a cost is paid (similar to Miracle), but that does not actually cast the card?
For example:
Code: Select all
Spiffy Magic Dude
UU
Creature -- Lizard Wizard
When you draw CARDNAME, you may pay U. If you do, scry 2.
2/2
My first thought, aside from hacking together some bizarre kludge with Miracle that returns the card to your hand on resolution, would be to make a version of Forecast, with the added requirement that the card be drawn this turn, but I'm not sure how to implement that.
Sprague
 
Posts: 17
Joined: 13 Nov 2017, 17:39
Has thanked: 19 times
Been thanked: 1 time

Re: Custom Card Thread

Postby RumbleBBU » 04 Apr 2018, 05:58

Sprague wrote:Is there a way to script a effect that triggers when a card is drawn and a cost is paid (similar to Miracle), but that does not actually cast the card?
Oh, it's definitely possible!

To Forge, your library and hand are just different activation zones, and drawing a card is just another event. It's not like real (offline) MtG, where it would be difficult to trigger anything from your hand or library, at least without revealing it.

I've used and abuse this quite a bit in my private sequel set to Arabian Nights. Two of the mechanics are I used in that set were draw triggers and even library activation triggers. I'm including a couple of sample cards with draw effect triggers so you can see how they work. Basically, what you need is

Code: Select all
T:Mode$ Drawn | ValidCard$ Card.Self | TriggerZones$ Hand | Execute$ TrigSomething | TriggerDescription$ When you draw CARDNAME... (something happens)
You can then use Cost$ in a triggered AB$ (SVar:TrigSomething:AB$...)

Note that in the sample cards that follow, I included some paranoia checks (conditions) to prevent the draw effects from triggering before the game has started. (I'm not sure how well these conditions would work in games like the quest mode where you can start the game with cards on the battlefield.)

(And yes, I know, since Cost$ isn't really used in these sample cards, I could have as easily used DB$ without Cost$ but I also did some draw effect cards where the Cost$ parameter was used, and I wanted script them in an analogous fashion.)

Also, I can't guarantee these cards will work as such in the latest version of Forge - I developed these cards a few versions ago, and I've noticed that the Forge script engine tends to get tweaked and reworked every couple of versions or so. :D

Code: Select all
Name:Fire Asp
ManaCost:1 R
Types:Creature Snake
PT:1/1
T:Mode$ Drawn | ValidCard$ Card.Self | ConditionPresent$ Creature | ConditionCompare$ GE1 | TriggerZones$ Hand | Execute$ TrigDmg | TriggerDescription$ When you draw CARDNAME, if there is at least 1 creature on the battlefield, CARDNAME deals 1 damage to target creature.
T:Mode$ AttackerUnblocked | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigDmg | TriggerDescription$ Whenever CARDNAME attacks and is not blocked, it deals 1 damage to target creature.
SVar:TrigDmg:AB$ DealDamage | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature. | NumDmg$ 1
Oracle:When you draw Fire Asp, if there is at least 1 creature on the battlefield, Fire Asp deals 1 damage to target creature.\nWhenever Fire Asp attacks and is not blocked, it deals 1 damage to target creature.
Fire Asp.full.jpg


Code: Select all
Name:Baghdad Urchin
ManaCost:1 U
Types:Creature Human
PT:1/1
T:Mode$ Drawn | ValidCard$ Card.Self | ConditionPresent$ Creature | ConditionCompare$ GE1 | TriggerZones$ Hand | Execute$ TrigTap | TriggerDescription$ When you draw CARDNAME, if there is at least 1 creature on the battlefield, tap target creature.
SVar:TrigTap:DB$ Tap | Cost$ 0 | ValidTgts$ Creature | TgtPrompt$ Select target creature
T:Mode$ AttackerUnblocked | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigBigTap | TriggerDescription$ Whenever CARDNAME attacks and is not blocked, you may pay {1}{U}. If you do, tap target permanent.
SVar:TrigBigTap:AB$ Tap | Cost$ 1 U | ValidTgts$ Card | TgtPrompt$ Select target permanent
Oracle:When you draw Baghdad Urchin, if there is at least 1 creature on the battlefield, tap target creature.\nWhenever Baghdad Urchin attacks and is not blocked, you may pay {1}{U}. If you do, tap target permanent.
Baghdad Urchin.full.jpg

Code: Select all
Name:Nomad Merchant
ManaCost:1 G
Types:Creature Human Nomad
PT:1/2
T:Mode$ Drawn | ValidCard$ Card.Self | ConditionPresent$ Land | ConditionCompare$ GE1 | TriggerZones$ Hand | Execute$ TrigLand | TriggerDescription$ When you draw CARDNAME, if there is at least 1 land on the battlefield, you may put a land card from your hand onto the battlefield.
SVar:TrigLand:DB$ ChangeZone | Origin$ Hand | Destination$ Battlefield | ChangeType$ Land | ChangeNum$ 1 | OptionalDecider$ You
Oracle:When you draw Nomad Merchant, if there is at least 1 land on the battlefield, you may put a land card from your hand onto the battlefield.
Nomad Merchant.full.jpg

Code: Select all
Name:Khaliy Djinn
ManaCost:3 G G
Types:Creature Djinn
PT:3/3
T:Mode$ Drawn | ValidCard$ Card.Self | ConditionPresent$ Creature.YouCtrl | ConditionCompare$ GE1 | TriggerZones$ Hand | Execute$ Trig1Ctr | TriggerDescription$ When you draw CARDNAME, if you control at least 1 creature, put a +1/+1 counter on target creature you control.
SVar:Trig1Ctr:DB$ PutCounter | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control to add a counter | CounterType$ P1P1 | CounterNum$ 1 | SpellDescription$ Put a +1/+1 counter on target creature you control.
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigCounters | TriggerDescription$ When CARDNAME enters the battlefield, distribute two +1/+1 counters among creatures you control.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.Self | Execute$ TrigCounters2 | Secondary$ True | TriggerController$ TriggeredCardController | TriggerDescription$ When CARDNAME leaves the battlefield, distribute two -1/-1 counters among creatures you control and two +1/+1 counters among creatures your opponents control.
T:Mode$ ChangesZone | Secondary$ True | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.Self | Execute$ TrigCounters3 | Secondary$ True | TriggerController$ TriggeredCardController | TriggerDescription$ When CARDNAME leaves the battlefield, distribute two -1/-1 counters among creatures you control and two +1/+1 counters among creatures your opponents control.
SVar:TrigCounters:DB$ PutCounter | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control to distribute counters to | CounterType$ P1P1 | CounterNum$ 2 | TargetMin$ 1 | TargetMax$ 2 | DividedAsYouChoose$ 2 | SpellDescription$ Distribute two +1/+1 counters among one or two target creatures you control.
SVar:TrigCounters2:DB$ PutCounter | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control to distribute counters to | CounterType$ M1M1 |CounterNum$ 2 | TargetMin$ 1 | TargetMax$ 2 | DividedAsYouChoose$ 2 | SpellDescription$ Distribute two -1/-1 counters among one or two target creatures you control.
SVar:TrigCounters3:DB$ PutCounter | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponents control to distribute counters to | CounterType$ P1P1 | CounterNum$ 2 | TargetMin$ 1 | TargetMax$ 2 | DividedAsYouChoose$ 2 | SpellDescription$ Distribute two +1/+1 counters among one or two target creatures your opponents  control.
SVar:RemRandomDeck:True
Oracle:When you draw Khaliy Djinn, if you control at least 1 creature, put a +1/+1 counter on target creature you control.\mWhen Khaliy Djinn enters the battlefield, distribute two +1/+1 counters among creatures you control.\nWhen Khaliy Djinn leaves the battlefield, distribute two -1/-1 counters among creatures you control and two +1/+1 counters among creatures your opponents control.
Khaliy Djinn.full.jpg
User avatar
RumbleBBU
 
Posts: 394
Joined: 18 Aug 2012, 04:24
Has thanked: 29 times
Been thanked: 66 times

Re: Custom Card Thread

Postby Sprague » 06 Apr 2018, 03:41

RumbleBBU wrote:Oh, it's definitely possible!
Thanks! I didn't realize the "drawn" trigger could go off from the hand (I didn't know triggers in general could go off from there).

Hmmm... triggered abilities that go off from the library. That sounds horrific, but I'm already getting an idea for an undercosted Demon that drains your life as long as he's in your library or something. It's nice that Forge lets you explore things that would be untenable in paper.
Sprague
 
Posts: 17
Joined: 13 Nov 2017, 17:39
Has thanked: 19 times
Been thanked: 1 time

PreviousNext

Return to Forge

Who is online

Users browsing this forum: No registered users and 59 guests


Who is online

In total there are 59 users online :: 0 registered, 0 hidden and 59 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 59 guests

Login Form