Page 3 of 3

Re: Modular

PostPosted: 06 Oct 2009, 03:14
by DennisBergkamp
Well, there's other ways. Other less effective ways apparently... when I tried merging your code, I used some file by file text comparator tool :roll:

Re: Modular

PostPosted: 06 Oct 2009, 03:52
by zerker2000
Ah, the .diff files... miserably outdated, I'm afraid :P.

Re: Modular

PostPosted: 07 Oct 2009, 17:40
by Chris H.
Using zerker's mana pool code update I modified Sunastian Falconer to look like this:

Sunastian Falconer
3 R G
Legendary Creature Human Shaman
no text
4/4
tap: add 2


I ran a test and was able to select a spell to cast and then tapped the Sunastian Falconer for 2 mana, wow, success.

I then tried tapping the Sunastian Falconer to place 2 man in the mana pool and when I tapped the mana pool to cast a spell I got the following error:


Code: Select all
An error has occured. You can copy/paste this message or save it to a file.
Please report this, plus what you tried to do, to:
   http://www.slightlymagic.net/forum/viewforum.php?f=26
If you don't want to register an account, you can mail it directly to
   mtgrares@yahoo.com

String index out of range: 2

Detailed error trace:
java.lang.StringIndexOutOfBoundsException: String index out of range: 2
   at java.lang.String.charAt(String.java:686)
   at ManaPool.oraclize(ManaPool.java:98)
   at ManaPool.subtractMana(ManaPool.java:212)
   at Input_PayManaCostUtil.tapCard(Input_PayManaCostUtil.java:10)
   at Input_PayManaCost.selectCard(Input_PayManaCost.java:42)
   at GuiInput.selectCard(GuiInput.java:35)
   at GuiDisplay3$8.mousePressed(GuiDisplay3.java:309)
   at java.awt.Component.processMouseEvent(Component.java:6345)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
   at java.awt.Component.processEvent(Component.java:6113)
   at java.awt.Container.processEvent(Container.java:2085)
   at java.awt.Component.dispatchEventImpl(Component.java:4714)
   at java.awt.Container.dispatchEventImpl(Container.java:2143)
   at java.awt.Component.dispatchEvent(Component.java:4544)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4279)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
   at java.awt.Container.dispatchEventImpl(Container.java:2129)
   at java.awt.Window.dispatchEventImpl(Window.java:2475)
   at java.awt.Component.dispatchEvent(Component.java:4544)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Re: Modular

PostPosted: 07 Oct 2009, 18:57
by DennisBergkamp
Chris H. wrote:Using zerker's mana pool code update I modified Sunastian Falconer to look like this:

Sunastian Falconer
3 R G
Legendary Creature Human Shaman
no text
4/4
tap: add 2


I ran a test and was able to select a spell to cast and then tapped the Sunastian Falconer for 2 mana, wow, success.

I then tried tapping the Sunastian Falconer to place 2 man in the mana pool and when I tapped the mana pool to cast a spell I got the following error:


Code: Select all
An error has occured. You can copy/paste this message or save it to a file.
Please report this, plus what you tried to do, to:
   http://www.slightlymagic.net/forum/viewforum.php?f=26
If you don't want to register an account, you can mail it directly to
   mtgrares@yahoo.com

String index out of range: 2

Detailed error trace:
java.lang.StringIndexOutOfBoundsException: String index out of range: 2
   at java.lang.String.charAt(String.java:686)
   at ManaPool.oraclize(ManaPool.java:98)
   at ManaPool.subtractMana(ManaPool.java:212)
   at Input_PayManaCostUtil.tapCard(Input_PayManaCostUtil.java:10)
   at Input_PayManaCost.selectCard(Input_PayManaCost.java:42)
   at GuiInput.selectCard(GuiInput.java:35)
   at GuiDisplay3$8.mousePressed(GuiDisplay3.java:309)
   at java.awt.Component.processMouseEvent(Component.java:6345)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
   at java.awt.Component.processEvent(Component.java:6113)
   at java.awt.Container.processEvent(Container.java:2085)
   at java.awt.Component.dispatchEventImpl(Component.java:4714)
   at java.awt.Container.dispatchEventImpl(Container.java:2143)
   at java.awt.Component.dispatchEvent(Component.java:4544)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4279)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
   at java.awt.Container.dispatchEventImpl(Container.java:2129)
   at java.awt.Window.dispatchEventImpl(Window.java:2475)
   at java.awt.Component.dispatchEvent(Component.java:4544)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Strange, I can't reproduce this. Everything works fine for me...

I like the fact that it's possible now to use multi mana sources directly to pay for a spell.

Re: Modular

PostPosted: 07 Oct 2009, 21:37
by Chris H.
DennisBergkamp wrote:Strange, I can't reproduce this. Everything works fine for me...

I like the fact that it's possible now to use multi mana sources directly to pay for a spell.
When I built zerkers mana pool mods code I received several warnings, I did not bother to try to make any corrections. Could explain it.

I'm sure you have the code in place on your end and it is working correctly with no warnings.

I'm still learning. :wink:

Re: Modular

PostPosted: 07 Oct 2009, 22:48
by DennisBergkamp
Hmm, well it's possible there's some bug. Warnings don't mean much... I had a few too, but I fixed them.
What spell were you trying to cast with the mana from Sunastian Falconer ?

Re: Modular

PostPosted: 07 Oct 2009, 23:14
by Chris H.
DennisBergkamp wrote:Hmm, well it's possible there's some bug. Warnings don't mean much... I had a few too, but I fixed them.
What spell were you trying to cast with the mana from Sunastian Falconer ?
`
I am trying to remember. The deck had 5 mox to cast Sunastian Falconer and then there was one last card with a total cost of seven. I think that I may have picked Loamdragger Giant.

Could this have been related to hybrid mana?

Re: Modular

PostPosted: 07 Oct 2009, 23:23
by DennisBergkamp
You're right, yes it probably is hybrid mana. I'm getting the same error.

Re: Modular

PostPosted: 08 Oct 2009, 00:25
by zerker2000
Chris H. wrote:When I built zerkers mana pool mods code I received several warnings, I did not bother to try to make any corrections. Could explain it.
I think those were serialVersionUID's.
DennisBergkamp wrote:You're right, yes it probably is hybrid mana. I'm getting the same error.
Weird, I thought the code used manaCost.isNeeded, one mana at a time.