It is currently 11 Sep 2025, 20:47
   
Text Size

please let me refactor references to static fields, etc.

Post MTG Forge Related Programming Questions Here

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

Re: please let me refactor references to static fields, etc.

Postby 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
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: please let me refactor references to static fields, etc.

Postby Braids » 27 Jun 2011, 15:22

Sloth wrote:Maybe this is the dreaded unplayable card in your hand bug?
You mean the one that is marked as summoning sick even though it is in my hand?
"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. ;)
User avatar
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.

Postby Braids » 27 Jun 2011, 15:29

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.
say, , ... say what?
"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. ;)
User avatar
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.

Postby Hellfish » 27 Jun 2011, 15:31

heh,sorry, mistyped. :P 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
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

ManaPool bug

Postby 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?
"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. ;)
User avatar
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.

Postby 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
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: please let me refactor references to static fields, etc.

Postby Braids » 27 Jun 2011, 16:55

Hellfish wrote:I committed a hack that sets the ManaPools ID to 0, forge.card.mana.ManaPool.java:41.
Thank you. What about the AI's ManaPool? Or does it not yet have one?
"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. ;)
User avatar
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.

Postby 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
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: please let me refactor references to static fields, etc.

Postby 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. :mrgreen:
User avatar
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.

Postby Sloth » 27 Jun 2011, 19:23

Braids wrote:
Hellfish wrote:I committed a hack that sets the ManaPools ID to 0, forge.card.mana.ManaPool.java:41.
Thank you. What about the AI's ManaPool? Or does it not yet have one?
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.

UPDATE: There is some weird stuff going on now (at least the displaying of AI mana is wrong), we should better find another solution.
User avatar
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.

Postby 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
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: please let me refactor references to static fields, etc.

Postby Rob Cashwalker » 27 Jun 2011, 22:40

Hellfish wrote:Ay', there's the rub, as some british bloke wrote somewhere.
Indubitably, Watson!
The Force will be with you, Always.
User avatar
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.

Postby Braids » 28 Jun 2011, 00:46

Hellfish wrote:I think I see the problem . . . Ay', there's the rub, as some british bloke wrote somewhere.
thank you!

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. ;)
User avatar
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

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 32 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 32 users online :: 0 registered, 0 hidden and 32 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 32 guests

Login Form