ETB Replacement
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
23 posts
• Page 2 of 2 • 1, 2
Re: ETB Replacement
by moomarc » 12 Sep 2012, 13:07
Hellfish, it seems that Primordial Hydra isn't working anymore. Casting it crashes with
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.
- 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
-

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
by 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
-

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
by 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.
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
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
-

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
by 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)
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: ETB Replacement
by moomarc » 13 Sep 2012, 07:21
That's weird; the Chalice works fine for me this morning.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)
-Marc
-

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
by Sloth » 13 Sep 2012, 07:33
Oops, forgot to refresh. Nevermind.moomarc wrote:That's weird; the Chalice works fine for me this morning.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)
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: ETB Replacement
by moomarc » 13 Sep 2012, 07:35
Easiest fix EVER!Sloth wrote:Oops, forgot to refresh. Nevermind.moomarc wrote:That's weird; the Chalice works fine for me this morning.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)
-Marc
-

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
by 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
23 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 15 guests