It is currently 18 Sep 2025, 20:57
   
Text Size

Card Development Questions

Post MTG Forge Related Programming Questions Here

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

Re: Card Development Questions

Postby Iran » 16 Oct 2011, 02:56

Is possible to know when the control of one card changes? I'd like to script Bronze Bombshell.

Is possible to script cards lile Bazaar Trader, Homeward Path, Scrambleverse in forge?
Maybe with AF_GainControl?

Thanks
Last edited by Iran on 16 Oct 2011, 03:01, edited 1 time in total.
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby Iran » 16 Oct 2011, 02:58

friarsol wrote:The third ability isn't targeted, it's defined.
How so? I didn't understand.

Thanks
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby slapshot5 » 16 Oct 2011, 03:34

Iran wrote:Is possible to know when the control of one card changes? I'd like to script Bronze Bombshell.

Is possible to script cards lile Bazaar Trader, Homeward Path, Scrambleverse in forge?
Maybe with AF_GainControl?
None of those are currently possible.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby friarsol » 16 Oct 2011, 03:54

Iran wrote:
friarsol wrote:The third ability isn't targeted, it's defined.
How so? I didn't understand.

Thanks
The third ability doesn't say the word target, yet the way you scripted it it's using the Target parameters. Also, you need to be using the Hidden$ True parameter.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby jeffwadsworth » 16 Oct 2011, 04:16

Iran wrote:
friarsol wrote:The third ability isn't targeted, it's defined.
How so? I didn't understand.

Thanks
The third ability is not doable right now. ChangeZone will not present you with a list of the Remembered cards.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby Sloth » 16 Oct 2011, 07:20

.Planar Guide.
jeffwadsworth wrote:I am pretty sure I did that one and it was working. Long time ago though.

Okay, it turns out some clown must have screwed around with the script. Here is a working version of it.

| Open
Name:Planar Guide
ManaCost:W
Types:Creature Human Cleric
Text:no text
PT:1/1
A:AB$ ChangeZoneAll | Cost$ 3 W Exile<1/CARDNAME> | ChangeType$ Creature | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | SubAbility$ DelTrig | SpellDescription$ Exile all creatures. At the beginning of the next end step, return those cards to the battlefield under their owners' control.
SVar:DelTrig:DB$DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturn | TriggerDescription$ Return cards exiled by CARDNAME to the battlefield.
SVar:TrigReturn:AB$ChangeZoneAll | Cost$ 0 | Defined$ Remembered | Origin$ Exile | Destination$ Battlefield | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/planar_guide.jpg
SetInfo:LGN|Rare|http://magiccards.info/scans/en/le/18.jpg
Oracle:{3}{W}, Exile Planar Guide: Exile all creatures. At the beginning of the next end step, return those cards to the battlefield under their owners' control.
End


EDIT: I spoke too soon. The first test of this looked fine, but then Instants from the graveyard started being pulled into the battlefield. Very strange.
The clown who screwed around with the script was me, because using the ability twice would have cleared the remembered list (even though it's unliky to be able to).

The script was ok, I fixed it by using AllZoneUtil.getCardState to search the card the Remembered object gets added to. Maybe this should also be done in the other places Remembered objects get added?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby jeffwadsworth » 16 Oct 2011, 14:53

Sloth wrote:.Planar Guide.
jeffwadsworth wrote:I am pretty sure I did that one and it was working. Long time ago though.

Okay, it turns out some clown must have screwed around with the script. Here is a working version of it.

| Open
Name:Planar Guide
ManaCost:W
Types:Creature Human Cleric
Text:no text
PT:1/1
A:AB$ ChangeZoneAll | Cost$ 3 W Exile<1/CARDNAME> | ChangeType$ Creature | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | SubAbility$ DelTrig | SpellDescription$ Exile all creatures. At the beginning of the next end step, return those cards to the battlefield under their owners' control.
SVar:DelTrig:DB$DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturn | TriggerDescription$ Return cards exiled by CARDNAME to the battlefield.
SVar:TrigReturn:AB$ChangeZoneAll | Cost$ 0 | Defined$ Remembered | Origin$ Exile | Destination$ Battlefield | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/planar_guide.jpg
SetInfo:LGN|Rare|http://magiccards.info/scans/en/le/18.jpg
Oracle:{3}{W}, Exile Planar Guide: Exile all creatures. At the beginning of the next end step, return those cards to the battlefield under their owners' control.
End


EDIT: I spoke too soon. The first test of this looked fine, but then Instants from the graveyard started being pulled into the battlefield. Very strange.
The clown who screwed around with the script was me, because using the ability twice would have cleared the remembered list (even though it's unliky to be able to).

The script was ok, I fixed it by using AllZoneUtil.getCardState to search the card the Remembered object gets added to. Maybe this should also be done in the other places Remembered objects get added?
I always liked clowns...
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby jeffwadsworth » 20 Oct 2011, 21:52

I posted Venomous Breath and Gaze of the Gorgon and noticed there might be an issue with them via the rulings section on gatherer.

| Open
Name:Venomous Breath
ManaCost:3 G
Types:Instant
Text:no text
A:SP$ Animate | Cost$ 3 G | ValidTgts$ Creature | TgtPrompt$ Select target creature | Triggers$ TrigBlocker,TrigAttacker | sVars$ DelTrigAttacker,DelTrigBlocker,TrigDestroyAttacker,TrigDestroyBlocker | SpellDescription$ Choose target creature. At end of combat, destroy all creatures that blocked or were blocked by it this turn.
SVar:TrigBlocker:Mode$ Blocks | ValidCard$ Creature | ValidBlocked$ Card.Self | DelayedTrigger$ DelTrigBlocker | TriggerDescription$ At end of combat, destroy all creatures that blocked or were blocked by it this turn.
SVar:TrigAttacker:Mode$ Blocks | ValidCard$ Card.Self | ValidBlocked$ Creature | DelayedTrigger$ DelTrigAttacker | Secondary$ True | TriggerDescription$ At end of combat, destroy all creatures that blocked or were blocked by it this turn.
SVar:DelTrigBlocker:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ You | Execute$ TrigDestroyBlocker | TriggerDescription$ At end of combat, destroy all creatures that blocked or were blocked by it this turn.
SVar:DelTrigAttacker:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Opponent | Execute$ TrigDestroyAttacker | TriggerDescription$ At end of combat, destroy all creatures that blocked or were blocked by it this turn.
SVar:TrigDestroyBlocker:AB$ Destroy | Cost$ 0 | Defined$ TriggeredBlocker
SVar:TrigDestroyAttacker:AB$ Destroy | Cost$ 0 | Defined$ TriggeredAttacker
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/venomous_breath.jpg
End



| Open
Name:Gaze of the Gorgon
ManaCost:3 BG
Types:Instant
Text:no text
A:SP$ Regenerate | Cost$ 3 BG | ValidTgts$ Creature | TgtPrompt$ Select target creature | SubAbility$ DBAnimate | SpellDescription$ Regenerate target creature. At end of combat, destroy all creatures that blocked or were blocked by that creature this turn.
SVar:DBAnimate:DB$ Animate | Defined$ Targeted | Triggers$ TrigBlocker,TrigAttacker | sVars$ DelTrigAttacker,DelTrigBlocker,TrigDestroyAttacker,TrigDestroyBlocker | SpellDescription$ Regenerate target creature. At end of combat, destroy all creatures that blocked or were blocked by that creature this turn.
SVar:TrigBlocker:Mode$ Blocks | ValidCard$ Creature | ValidBlocked$ Card.Self | DelayedTrigger$ DelTrigBlocker | TriggerDescription$ At end of combat, destroy all creatures that blocked or were blocked by it this turn.
SVar:TrigAttacker:Mode$ Blocks | ValidCard$ Card.Self | ValidBlocked$ Creature | DelayedTrigger$ DelTrigAttacker | Secondary$ True | TriggerDescription$ At end of combat, destroy all creatures that blocked or were blocked by it this turn.
SVar:DelTrigBlocker:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ You | Execute$ TrigDestroyBlocker | TriggerDescription$ At end of combat, destroy all creatures that blocked or were blocked by it this turn.
SVar:DelTrigAttacker:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Opponent | Execute$ TrigDestroyAttacker | TriggerDescription$ At end of combat, destroy all creatures that blocked or were blocked by it this turn.
SVar:TrigDestroyBlocker:AB$ Destroy | Cost$ 0 | Defined$ TriggeredBlocker
SVar:TrigDestroyAttacker:AB$ Destroy | Cost$ 0 | Defined$ TriggeredAttacker
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/gaze_of_the_gorgon.jpg
End


Does anyone see a problem with the implementation? For example, if the card is cast after the declare blockers or attackers step?
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby jeffwadsworth » 26 Oct 2011, 23:08

Looking at Mana Vapors. This card requires an effect that notes the targeted player, etc. Does anyone know if this is possible currently?
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby SoulStorm » 27 Oct 2011, 12:41

I attempted to add Explorer's Scope. Everything works fine, except that the land doesn't enter the battlefield tapped.

Here's the script:
| Open
Name:Explorer's Scope
ManaCost:1
Types:Artifact Equipment
K:eqPump 1:0/0
T:Mode$ Attacks | ValidCard$ Card.AttachedBy | Execute$ TrigDig | TriggerDescription$ Whenever equipped creature attacks, look at the top card of your library. If it's a land card, you may put it onto the battlefield tapped.
SVar:TrigDig:AB$Dig | Cost$ 0 | DigNum$ 1 | ChangeNum$ All | Optional$ True | ChangeValid$ Land | DestinationZone$ Battlefield | Tapped$ True | LibraryPosition2$ 0
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/explorers_scope.jpg
End


I tried Tapped$ True, but that's not supported apparently. Suprisingly, having Tapped$ True in the script doesn't crash the game.

Anyway, there are only two colorless nonbasic land acceleration cards in the game that I'm aware of, Explorer's Scope and Druidic Satchel, so it would be nice to have one or both of them in the game.

Thanks!
SoulStorm
 
Posts: 423
Joined: 24 Jun 2010, 22:48
Has thanked: 16 times
Been thanked: 11 times

Re: Card Development Questions

Postby slapshot5 » 27 Oct 2011, 12:57

SoulStorm wrote:I attempted to add Explorer's Scope. Everything works fine, except that the land doesn't enter the battlefield tapped.

Here's the script:
| Open
Name:Explorer's Scope
ManaCost:1
Types:Artifact Equipment
K:eqPump 1:0/0
T:Mode$ Attacks | ValidCard$ Card.AttachedBy | Execute$ TrigDig | TriggerDescription$ Whenever equipped creature attacks, look at the top card of your library. If it's a land card, you may put it onto the battlefield tapped.
SVar:TrigDig:AB$Dig | Cost$ 0 | DigNum$ 1 | ChangeNum$ All | Optional$ True | ChangeValid$ Land | DestinationZone$ Battlefield | Tapped$ True | LibraryPosition2$ 0
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/explorers_scope.jpg
End


I tried Tapped$ True, but that's not supported apparently. Suprisingly, having Tapped$ True in the script doesn't crash the game.

Anyway, there are only two colorless nonbasic land acceleration cards in the game that I'm aware of, Explorer's Scope and Druidic Satchel, so it would be nice to have one or both of them in the game.

Thanks!
Try it now with r11489.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby friarsol » 27 Oct 2011, 13:48

SoulStorm wrote:I tried Tapped$ True, but that's not supported apparently. Suprisingly, having Tapped$ True in the script doesn't crash the game.
Not that surprising. Having extraneous information in the Script won't crash things. The Script just won't try to access that piece of information.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby SoulStorm » 27 Oct 2011, 14:01

slapshot5 wrote:Try it now with r11489.

-slapshot5
Hey slapshot, thanks for the quick revision. Unfortunately, I haven't been able to run the game using eclipse since the move from gitorious. I can update to the latest revision but when I try to run the program, I get the following error:

Could not find the main class: forge.Gui_NewGame. Program will exit.

The console spits out:

| Open
java.lang.NoClassDefFoundError: forge/Gui_NewGame
Caused by: java.lang.ClassNotFoundException: forge.Gui_NewGame
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Exception in thread "main"


And when I click java.lang.ClassNotFoundException I get:

| Open
Archive does not exist:
C:Users\SoulStorm\.m2\repository\org\mantisbt\mantisconnect-client-apt\1.11\mantisconnect-client-api-1.1.1.jar


If you have a solution to this, I'm listening. If not, feel free to add Explorer's Scope and at least I'll have it for the next release.

Thanks again!
SoulStorm
 
Posts: 423
Joined: 24 Jun 2010, 22:48
Has thanked: 16 times
Been thanked: 11 times

Re: Card Development Questions

Postby moomarc » 27 Oct 2011, 16:24

SoulStorm wrote:
java.lang.ClassNotFoundException | Open
Archive does not exist:
C:Users\SoulStorm\.m2\repository\org\mantisbt\mantisconnect-client-apt\1.11\mantisconnect-client-api-1.1.1.jar

If you have a solution to this, I'm listening. If not, feel free to add Explorer's Scope and at least I'll have it for the next release.
Thanks again!
I know the .m2 folder referred to there has all the maven dependencies. I had a similar error where the specified file was corrupt so updating maven dependencies didn't even help. I had to go into that folder, delete the offending file and run the maven dependencies update again. After that everything worked perfectly. Hope that helps.

Edit: I assume you installed the connectors and updated the maven dependencies as explained in the wiki. Those are the main two differences I know of compared to the svn setup pre-GIT.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby Chris H. » 27 Oct 2011, 17:27

@SoulStorm

Have you tried updating your Maven dependencies as Marc suggests? Right click on the FrogeSVN folder project and select:

"Maven" -> "Update Dependencies..."

You may have to check the box labeled "Force Update of Snapshots/Release". I and others have done this a couple of times and it can help the situation if you do not have a corrupted file in the ".m2" folder.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 72 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 72 users online :: 0 registered, 0 hidden and 72 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 72 guests

Login Form