It is currently 29 Oct 2025, 13:21
   
Text Size

ETB Replacement

Post MTG Forge Related Programming Questions Here

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

Re: ETB Replacement

Postby moomarc » 12 Sep 2012, 13:07

Hellfish, it seems that Primordial Hydra isn't working anymore. Casting it crashes with
Crash | Open
Code: Select all
java.lang.NumberFormatException: For input string: "X"
   at java.lang.NumberFormatException.forInputString(Unknown Source)
   at java.lang.Integer.parseInt(Unknown Source)
   at java.lang.Integer.parseInt(Unknown Source)
   at forge.card.abilityfactory.AbilityFactory.calculateAmount(AbilityFactory.java:1784)
   at forge.card.cost.CostMana.payHuman(CostMana.java:211)
   at forge.card.cost.CostPayment.payCost(CostPayment.java:221)
   at forge.card.spellability.SpellAbilityRequirements.startPaying(SpellAbilityRequirements.java:179)
   at forge.card.spellability.SpellAbilityRequirements.needPayment(SpellAbilityRequirements.java:165)
   
 
Never mind. Seems to be all 'pay X during resolve' costs.

Edit: Not actually sure where the problem is. Banefire works fine for example, but Endless Scream crashes here now too.
-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: ETB Replacement

Postby moomarc » 12 Sep 2012, 13:45

Commenting out ln1593 in AbilityFactory.java seems to fix the problem, but I'm not sure what you were trying to do so don't just want to remove the line.
Code: Select all
    if (ability != null) {

            svarval = ability.getSVar(amount);
            if (svarval.equals("")) {
                try {
ln 1593 ->          Integer.parseInt(amount);

                    //If this is reached, amount wasn't an integer
                    //Print a warning to console to help debug if an ability is not stolen properly.
                    System.out.println("WARNING:SVar fallback to card with ability present!");
                    System.out.println("Card:" + card.getName());
                    System.out.println("Ability:" + ability.toString());
                    svarval = card.getSVar(amount);
                }
                catch (Exception ignored) {}

            }
        }
-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: ETB Replacement

Postby Hellfish » 12 Sep 2012, 14:34

That line was meant to test if the amount is an integer or string, I thnk I know the problem, I must've relapsed to c# when I wrote that and another catch block.Will fix this afternoon,thanks!

EDIT: Should be good now, though there were more issues with the hydras and friends to fix.I'm not convinced those weren't from earlier,though.Oh well, it's fixed now.Will commit once my internet connection stops being a jerk.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: ETB Replacement

Postby Sloth » 13 Sep 2012, 06:50

I still get this error when casting Chalice of the Void:

| Open
java.lang.NumberFormatException: For input string: "X"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at forge.card.abilityfactory.AbilityFactory.calculateAmount(AbilityFactory.java:1784)
at forge.card.cost.CostMana.payHuman(CostMana.java:211)
at forge.card.cost.CostPayment.payCost(CostPayment.java:221)
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: ETB Replacement

Postby moomarc » 13 Sep 2012, 07:21

Sloth wrote:I still get this error when casting Chalice of the Void:

| Open
java.lang.NumberFormatException: For input string: "X"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at forge.card.abilityfactory.AbilityFactory.calculateAmount(AbilityFactory.java:1784)
at forge.card.cost.CostMana.payHuman(CostMana.java:211)
at forge.card.cost.CostPayment.payCost(CostPayment.java:221)
That's weird; the Chalice works fine for me this morning. :?
-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: ETB Replacement

Postby Sloth » 13 Sep 2012, 07:33

moomarc wrote:
Sloth wrote:I still get this error when casting Chalice of the Void:

| Open
java.lang.NumberFormatException: For input string: "X"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at forge.card.abilityfactory.AbilityFactory.calculateAmount(AbilityFactory.java:1784)
at forge.card.cost.CostMana.payHuman(CostMana.java:211)
at forge.card.cost.CostPayment.payCost(CostPayment.java:221)
That's weird; the Chalice works fine for me this morning. :?
Oops, forgot to refresh. Nevermind.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: ETB Replacement

Postby moomarc » 13 Sep 2012, 07:35

Sloth wrote:
moomarc wrote:
Sloth wrote:I still get this error when casting Chalice of the Void:

| Open
java.lang.NumberFormatException: For input string: "X"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at forge.card.abilityfactory.AbilityFactory.calculateAmount(AbilityFactory.java:1784)
at forge.card.cost.CostMana.payHuman(CostMana.java:211)
at forge.card.cost.CostPayment.payCost(CostPayment.java:221)
That's weird; the Chalice works fine for me this morning. :?
Oops, forgot to refresh. Nevermind.
Easiest fix EVER! :lol:
-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: ETB Replacement

Postby timmermac » 31 Dec 2012, 19:00

Un-stickied. This seems to be completed. Can re-sticky if that needs to happen.
"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

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 15 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 15 users online :: 0 registered, 0 hidden and 15 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 15 guests

Login Form