It is currently 01 Jun 2025, 18:09
   
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 SoulStorm » 27 Oct 2011, 20:38

Thanks for the help Moomarc and Chris. None of those suggestions worked, however. But then I got radical and deleted and reinstalled everything, and now it's working fine. :mrgreen:

The only thing I haven't done is download and install the Maven zip file and mess around with those dependencies. I have limited experience with such things, so I think I'll wait until I'm feeling more motivated before playing around with that. I also probably need to email someone to get commit permission again, so if someone would like to commit the Explorer's Scope in the meantime please do so.

Thanks again!

One more thing. I noticed that putting a land into play doesn't seen to be optional even though I included Optional$ True.
SoulStorm
 
Posts: 423
Joined: 24 Jun 2010, 22:48
Has thanked: 16 times
Been thanked: 11 times

Re: Card Development Questions

Postby friarsol » 28 Oct 2011, 00:33

Commit permission is given by going to User Control Panel, then Usergroups and adding yourself to Developers Forge.
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 » 28 Oct 2011, 19:17

Looking at Coalition Victory. This appears to need multiple conditionals. I am thinking something like:

SP$ WinsGame | Cost$ 0 | Defined$ You | ConditionPresent$ Swamp.YouCtrl | ConditionCompare$ GE1 | ConditionPresent2$ Plains.YouCtrl | ConditionCompare2$ GE1, etc

Does anyone see an alternative?
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 friarsol » 28 Oct 2011, 19:24

jeffwadsworth wrote:Looking at Coalition Victory. This appears to need multiple conditionals. I am thinking something like:

SP$ WinsGame | Cost$ 0 | Defined$ You | ConditionPresent$ Swamp.YouCtrl | ConditionCompare$ GE1 | ConditionPresent2$ Plains.YouCtrl | ConditionCompare2$ GE1, etc

Does anyone see an alternative?
We should be able to do this with Math and a single SVar adding up the required parts. Also, you can use Domain for the Basic Lands.(SVar:X:Count$Domain)

The Final SVar would be compared to 10 most likely.
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 » 28 Oct 2011, 19:37

friarsol wrote:
jeffwadsworth wrote:Looking at Coalition Victory. This appears to need multiple conditionals. I am thinking something like:

SP$ WinsGame | Cost$ 0 | Defined$ You | ConditionPresent$ Swamp.YouCtrl | ConditionCompare$ GE1 | ConditionPresent2$ Plains.YouCtrl | ConditionCompare2$ GE1, etc

Does anyone see an alternative?
We should be able to do this with Math and a single SVar adding up the required parts. Also, you can use Domain for the Basic Lands.(SVar:X:Count$Domain)

The Final SVar would be compared to 10 most likely.
Well, we would need a domain type deal for creatures.
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 friarsol » 28 Oct 2011, 19:42

jeffwadsworth wrote:
friarsol wrote:
jeffwadsworth wrote:Looking at Coalition Victory. This appears to need multiple conditionals. I am thinking something like:

SP$ WinsGame | Cost$ 0 | Defined$ You | ConditionPresent$ Swamp.YouCtrl | ConditionCompare$ GE1 | ConditionPresent2$ Plains.YouCtrl | ConditionCompare2$ GE1, etc

Does anyone see an alternative?
We should be able to do this with Math and a single SVar adding up the required parts. Also, you can use Domain for the Basic Lands.(SVar:X:Count$Domain)

The Final SVar would be compared to 10 most likely.
Well, the problem with that approach is if you have more than 1 of any one thing. 2 swamps, etc. Unless you have a magical way to differentiate.
Domain should only return you from 0-5 (we already use it for things). Maybe it'd be simplest to just add Property similar to Domain but for Colored Creatures. That way we'd just have Domain + "Coalition" Compared EQ 10.
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 » 28 Oct 2011, 19:53

friarsol wrote:
jeffwadsworth wrote:
friarsol wrote:[
We should be able to do this with Math and a single SVar adding up the required parts. Also, you can use Domain for the Basic Lands.(SVar:X:Count$Domain)

The Final SVar would be compared to 10 most likely.
Well, the problem with that approach is if you have more than 1 of any one thing. 2 swamps, etc. Unless you have a magical way to differentiate.
Domain should only return you from 0-5 (we already use it for things). Maybe it'd be simplest to just add Property similar to Domain but for Colored Creatures. That way we'd just have Domain + "Coalition" Compared EQ 10.
Yes, I changed my original reply, but not fast enough apparently. I will add that domain deal for creatures.
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 » 28 Oct 2011, 21:12

Anyway to get the conditionals to use X?

Example:

| Open
Name:Coalition Victory
ManaCost:3 W U B R G
Types:Sorcery
Text:no text
A:SP$ WinsGame | Cost$ 3 W U B R G | Defined$ You | ConditionDefined$ X | ConditionCompare$ EQ10 | Description$ If you have all basic lands and all colored creatures, you win dude.
SVar:Y:Count$ColoredCreatures
SVar:Z:Count$Domain
SVar:X:Count$Y/Plus.Z
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/coalition_victory.jpg
End
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 friarsol » 28 Oct 2011, 21:22

CheckSVar$ X I think?
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 » 28 Oct 2011, 21:28

friarsol wrote:CheckSVar$ X I think?
I do not believe that is the correct conditional.

| Open
When Coalition Victory resolves, it checks for the five basic land types (Plains, Island, Swamp, Mountain, Forest) and the five colors (white, blue, black, red, green). If a single land has multiple types and/or a single creature is multiple colors, it will count all those types and/or colors.


Thus, I think we need your Condition script code here...otherwise the spell does not fire.
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 friarsol » 29 Oct 2011, 03:54

jeffwadsworth wrote:I do not believe that is the correct conditional.

Thus, I think we need your Condition script code here...otherwise the spell does not fire.
I see what the problem is. The same "CheckSVar" parameter is listed in both Conditionals and Restrictions. We'll need to rename the Conditional one to ConditionCheckSVar so it's only checked on resolution, and not checked in both slots. I wonder if there's a bug with cards that use this that you can Activate them when the CheckSVar passes, but don't resolve if the CheckSVar fails during Resolution.
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 » 29 Oct 2011, 15:33

Converting Tezzeret the Seeker to script. The changezone is failing to work in the following script. If I substitute a number for X in the "ChangeType$ Artifact.cmcEQX", it works perfectly. With X, it shows me the library, but nothing after that.

| Open
Name:Tezzeret the Seeker
ManaCost:3 U U
Types:Planeswalker Tezzeret
Text:no text
Loyalty:4
A:AB$ Untap | Cost$ AddCounter<1/LOYALTY> | ValidTgts$ Artifact | TgtPrompt$ Select target artifact | TargetMin$ 0 | TargetMax$ 2 | Planeswalker$ True | SpellDescription$ Untap up to two target artifacts.
A:AB$ ChangeZone | Cost$ SubCounter<X/LOYALTY> | Origin$ Library | Destination$ Battlefield | ChangeType$ Artifact.cmcEQX | ChangeNum$ 1 | Planeswalker$ True | SpellDescription$ Search your library for an artifact card with converted mana cost X or less and put it onto the battlefield. Then shuffle your library.
A:AB$ AnimateAll | Cost$ SubCounter<5/LOYALTY> | ValidCards$ Artifact.YouCtrl | Power$ 5 | Toughness$ 5 | Types$ Creature,Artifact | Planeswalker$ True | Ultimate$ True | SpellDescription$ Artifacts you control become 5/5 artifact creatures until end of turn.
SVar:X:XChoice
SVar:Rarity:Mythic
SVar:Picture:http://www.wizards.com/global/images/magic/general/tezzeret_the_seeker.jpg
SetInfo:ALA|Mythic|http://magiccards.info/scans/en/ala/60.jpg
Oracle:[+1] Untap up to two target artifacts.\n-X: Search your library for an artifact card with converted mana cost X or less and put it onto the battlefield. Then shuffle your library.\n[-5] Artifacts you control become 5/5 artifact creatures until end of turn.
End
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 friarsol » 29 Oct 2011, 15:37

I believe you need to be using "ChosenX" as the Value. Like how it's used in other places.

Cost | Open
A:SP$ Draw | Cost$ 3 B B PayLife<X> | NumCards$ ChosenX | Defined$ You | ActivationPhases$ End of Turn | PlayerTurn$ True | SpellDescription$ Draw X cards.
SVar:X:XChoice
#ChosenX SVar created by Cost payment
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 » 29 Oct 2011, 16:05

friarsol wrote:I believe you need to be using "ChosenX" as the Value. Like how it's used in other places.

Cost | Open
A:SP$ Draw | Cost$ 3 B B PayLife<X> | NumCards$ ChosenX | Defined$ You | ActivationPhases$ End of Turn | PlayerTurn$ True | SpellDescription$ Draw X cards.
SVar:X:XChoice
#ChosenX SVar created by Cost payment
ChosenX in the place of X (ChangeType$ Artifact.cmcEQChosenX) causes this error:

| Open
This is a Crash Report. An error has occurred. Please save this message to a file.
Please follow the instructions at this address to submit this Crash Report, plus what you were doing at the time:
http://tinyurl.com/3zzrnyb
Reporting bugs in Forge is very important. We thank you for your time.

For input string: "ChosenX"


Version:
Forge version SVN

OS: Windows 7 Version: 6.1 Architecture: amd64

Java Version: 1.6.0_26 Vendor: Sun Microsystems Inc.

Detailed error trace:
java.lang.NumberFormatException: For input string: "ChosenX"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at forge.Card.hasProperty(Card.java:6643)
at forge.Card.isValid(Card.java:6302)
at forge.GameEntity.isValid(GameEntity.java:302)
at forge.CardList$16.addCard(CardList.java:812)
at forge.CardFilter.filter(CardFilter.java:268)
at forge.CardList.filter(CardList.java:639)
at forge.CardList.getValidCards(CardList.java:810)
at forge.card.abilityFactory.AbilityFactory.filterListByType(AbilityFactory.java:2168)
at forge.card.abilityFactory.AbilityFactory_ChangeZone.changeHiddenOriginResolveHuman(AbilityFactory_ChangeZone.java:789)
at forge.card.abilityFactory.AbilityFactory_ChangeZone.changeHiddenOriginResolve(AbilityFactory_ChangeZone.java:703)
at forge.card.abilityFactory.AbilityFactory_ChangeZone.changeZoneResolve(AbilityFactory_ChangeZone.java:330)
at forge.card.abilityFactory.AbilityFactory_ChangeZone.access$1(AbilityFactory_ChangeZone.java:325)
at forge.card.abilityFactory.AbilityFactory_ChangeZone$1.resolve(AbilityFactory_ChangeZone.java:72)
at forge.card.abilityFactory.AbilityFactory.resolve(AbilityFactory.java:2283)
at forge.MagicStack.resolveStack(MagicStack.java:866)
at forge.Phase.passPriority(Phase.java:805)
at forge.ComputerAI_General.stackResponse(ComputerAI_General.java:520)
at forge.ComputerAI_General.stackNotEmpty(ComputerAI_General.java:460)
at forge.gui.input.InputControl.updateInput(InputControl.java:241)
at forge.GuiInput.update(GuiInput.java:34)
at java.util.Observable.notifyObservers(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at forge.MyObservable.updateObservers(MyObservable.java:21)
at forge.gui.input.InputControl.resetInput(InputControl.java:128)
at forge.Phase.passPriority(Phase.java:795)
at forge.gui.input.Input_PassPriority.selectButtonOK(Input_PassPriority.java:54)
at forge.GuiInput.selectButtonOK(GuiInput.java:68)
at forge.GuiDisplay4.okButtonActionPerformed(GuiDisplay4.java:1416)
at forge.GuiDisplay4.access$25(GuiDisplay4.java:1415)
at forge.GuiDisplay4$33.actionPerformed(GuiDisplay4.java:1136)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
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 friarsol » 29 Oct 2011, 18:35

Ah. Well ChosenX is right for the Variable. CMC (as well as power and toughness) just don't use variables in the right manner.

Code: Select all
            if (property.substring(z).equals("X")) {
                x = CardFactoryUtil.xCount(source, source.getSVar("X"));
            } else if (property.substring(z).equals("Y")) {
                x = CardFactoryUtil.xCount(source, source.getSVar("Y"));
            } else {
                x = Integer.parseInt(property.substring(z));
            }
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 31 guests


Who is online

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

Login Form