please let me refactor references to static fields, etc.
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
28 posts
• Page 2 of 2 • 1, 2
Re: please let me refactor references to static fields, etc.
by Hellfish » 27 Jun 2011, 15:15
No no, the card is played properly, but is nowhere to be seen afterwards.If I change the ID of the ManaPool to, say0 , there is no problem.
Last edited by Hellfish on 27 Jun 2011, 15:30, edited 1 time in total.
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: please let me refactor references to static fields, etc.
by Braids » 27 Jun 2011, 15:22
You mean the one that is marked as summoning sick even though it is in my hand?Sloth wrote:Maybe this is the dreaded unplayable card in your hand bug?
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: please let me refactor references to static fields, etc.
by Braids » 27 Jun 2011, 15:29
say, , ... say what?Hellfish wrote:No no, the card is played properly, but is nowhere to be seen afterwards.If I change the ID of the ManaPool to say, , there is no problem.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: please let me refactor references to static fields, etc.
by Hellfish » 27 Jun 2011, 15:31
heh,sorry, mistyped.
If I set the CardID to 0 or something over the number of cards in my deck, it's fine.

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
ManaPool bug
by Braids » 27 Jun 2011, 15:53
I'm, I'm... going to need some help.
Can someone point me to where this bug might be?

Can someone point me to where this bug might be?
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: please let me refactor references to static fields, etc.
by Hellfish » 27 Jun 2011, 16:01
I don't know why the ManaPool overwrites cards just because it shares a card ID with them, but I committed a hack that sets the ManaPools ID to 0, forge.card.mana.ManaPool.java:41.
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: please let me refactor references to static fields, etc.
by Braids » 27 Jun 2011, 16:55
Thank you. What about the AI's ManaPool? Or does it not yet have one?Hellfish wrote:I committed a hack that sets the ManaPools ID to 0, forge.card.mana.ManaPool.java:41.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: please let me refactor references to static fields, etc.
by Hellfish » 27 Jun 2011, 17:31
I believe it recently got one, but it doesn't have a card representation of it that can overwrite anything.
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: please let me refactor references to static fields, etc.
by Chris H. » 27 Jun 2011, 17:34
`Hellfish wrote:I believe it recently got one, but it doesn't have a card representation of it that can overwrite anything.
Choppic had some wonderful ideas in reference to how we could do a graphical update to the player panels in the battlefield display. Something else for all of us to look forward to one day.

-
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
Re: please let me refactor references to static fields, etc.
by Sloth » 27 Jun 2011, 19:23
The AI mana pool is created just like the human mana pool which would mean they have both the ID 0 now. I will test if this will create any problems.Braids wrote:Thank you. What about the AI's ManaPool? Or does it not yet have one?Hellfish wrote:I committed a hack that sets the ManaPools ID to 0, forge.card.mana.ManaPool.java:41.
UPDATE: There is some weird stuff going on now (at least the displaying of AI mana is wrong), we should better find another solution.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: please let me refactor references to static fields, etc.
by Hellfish » 27 Jun 2011, 20:53
Ah, my mistake, there *is* a card representation of the AI's mana pool, it just isn't shown on the battlefield, like the human player's is. FAKE EDIT: I think I see the problem, there are two different places in the code that each does it's own thing with UniqueNumber. A static field in Card and a block in GameAction.newGame. The static field starts at 0 at program initialization, shortly before a null card and the two ManaPools are created, numbered 1 and 2. Then, at each newgame, the other code loops through the cards in each deck and renumbers them 1-60 again.Ay', there's the rub, as some british bloke wrote somewhere.
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: please let me refactor references to static fields, etc.
by Rob Cashwalker » 27 Jun 2011, 22:40
Indubitably, Watson!Hellfish wrote:Ay', there's the rub, as some british bloke wrote somewhere.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: please let me refactor references to static fields, etc.
by Braids » 28 Jun 2011, 00:46
thank you!Hellfish wrote:I think I see the problem . . . Ay', there's the rub, as some british bloke wrote somewhere.
edit 1: because the static field changes and removals seem to be stable, i started a new topic to focus on the lazy CardFactory changes at http://www.slightlymagic.net/forum/viewtopic.php?f=52&t=4904
edit 2: also because the java 5/6 changes seem to be ok.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
28 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 34 guests