It is currently 11 Sep 2025, 22:02
   
Text Size

Quest classes refactoring

Post MTG Forge Related Programming Questions Here

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

Re: Quest classes refactoring

Postby moomarc » 16 Mar 2012, 19:59

Thanks Chris. I'll get those done.
-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: Quest classes refactoring

Postby Doublestrike » 17 Mar 2012, 07:12

Just coming back after a bit of a break, I notice my old quest datas don't work, because they're missing the "realistic" enum. When I decode them, their whole XML structure has changed also...will there be support for these in the future, or are they permanently broken? Bummer if broken, because I played these quests a lot...I suppose I could rebuild by hand.
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Quest classes refactoring

Postby Max mtg » 17 Mar 2012, 09:46

Doublestrike wrote:Just coming back after a bit of a break, I notice my old quest datas don't work, because they're missing the "realistic" enum. When I decode them, their whole XML structure has changed also...will there be support for these in the future, or are they permanently broken? Bummer if broken, because I played these quests a lot...I suppose I could rebuild by hand.
Drop here your old quest data (both unzipped and unzipped) - I'll see how it can be restored.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Quest classes refactoring

Postby moomarc » 17 Mar 2012, 10:08

Okay, I've committed the script versions of the quest pics. Move them as you see fit, but for now they're located in res/quest/bazaarcards/nursery (and /petshop)

For now I left out an image field so we must decide how we want to handle that. I've also left the pets as they currently are and will just post alternatives here for review.
-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: Quest classes refactoring

Postby Max mtg » 17 Mar 2012, 20:49

moomarc wrote:Okay, I've committed the script versions of the quest pics. Move them as you see fit, but for now they're located in res/quest/bazaarcards/nursery (and /petshop)

For now I left out an image field so we must decide how we want to handle that. I've also left the pets as they currently are and will just post alternatives here for review.
Thanks!
I've moved the formerly hadcoded data into xml and moved your text files to a more siutable place. While that data is already commited, let me add code that would read it soon.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Quest classes refactoring

Postby Max mtg » 18 Mar 2012, 18:10

I'm done with quest classes refactoring, but it does not work now =(
One thing is unclear to me for now.

The card I read from file is stored for later good times. I try to copy it before each game, but it just does not work by any means. Do you have any ideas how a Card object that is not bound to CardFactory can be copied to a new instance?
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Quest classes refactoring

Postby Chris H. » 19 Mar 2012, 14:09

Using today's snapshot build based on rev 14821 I noticed that my wolf pet was available for my next match but my plant wall was not. I went into the bazaar and had to re-purchase my plant wall and had to re-purchase the upgrades that I had made a few days ago.

I started my match and see that we still need some way to assign a token pic file name but so far this part of the project is moving forward. :)

Looking good so far.
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: Quest classes refactoring

Postby Max mtg » 20 Mar 2012, 07:55

Chris H. wrote:Looking good so far.
It is not as good =(
I managed to enable pictures, yes. But activated abilies don't work!
Looks like the card should be passed to abilityfactory or something like that?

There's another problem: sometimes as the game starts, cards are not deal at all. Empty hands have both of us - computer and I.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Quest classes refactoring

Postby Doublestrike » 20 Mar 2012, 08:33

Max mtg wrote:Drop here your old quest data (both unzipped and unzipped) - I'll see how it can be restored.
During splash screen, this happens twice:

EDIT "Your message contains 322367 characters. The maximum number of allowed characters is 60000." :lol: attached as text files.
Attachments
NPE.txt
(3.99 KiB) Downloaded 247 times
decoded.txt
(182.99 KiB) Downloaded 263 times
RG Infect.txt
Encoded (change extension to .dat)
(41.95 KiB) Downloaded 245 times
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Quest classes refactoring

Postby Doublestrike » 20 Mar 2012, 08:36

I also get the following NPE with old DAT files (that worked a week or two ago):

"NPE" | Open
java.lang.NullPointerException
at forge.quest.io.QuestDataIO.updateSaveFile(QuestDataIO.java:232)
at forge.quest.io.QuestDataIO.loadData(QuestDataIO.java:138)
at forge.gui.home.quest.CSubmenuQuestData.update(CSubmenuQuestData.java:93)
at forge.gui.home.quest.CSubmenuQuestData.initialize(CSubmenuQuestData.java:49)
at forge.view.ViewHomeUI.populateMenu(ViewHomeUI.java:216)
at forge.view.ViewHomeUI.initialize(ViewHomeUI.java:152)
at forge.view.FView.instantiateCachedUIStates(FView.java:141)
at forge.view.FView.initialize(FView.java:66)
at forge.view.Main$2.run(Main.java:66)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


Two files attached with this problem, change extension to dat.
Attachments
Affinity, Slivers, Monored, Goblins.txt
(34.07 KiB) Downloaded 287 times
Blightsteel.txt
(41.53 KiB) Downloaded 243 times
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Quest classes refactoring

Postby Chris H. » 20 Mar 2012, 13:38

Max mtg wrote:I managed to enable pictures, yes. But activated abilies don't work!
Looks like the card should be passed to abilityfactory or something like that?
`
It looks like the Wolf pet has the Flanking keyword added when it is fully trained. I see that my fully trained plant wall is missing the life gain ability.

We have a few cards that will add an AF ability to another card. I have seen the script for a few of these cards but I do not know how the code works.

Max mtg wrote:There's another problem: sometimes as the game starts, cards are not deal at all. Empty hands have both of us - computer and I.
`
I have played a few quest matches the last couple of days and have not yet experienced this bug.

We also have a report that the quest challenges are not putting the initial cards on the battlefield at the start of the match. I have not yet won enough matches to reproduce this bug.


And thank you for taking the time to perform the quest refactoring. 8)
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: Quest classes refactoring

Postby friarsol » 20 Mar 2012, 13:51

Chris H. wrote:We have a few cards that will add an AF ability to another card. I have seen the script for a few of these cards but I do not know how the code works.
This isn't what we want, we just need the Pets to continue down the full Card Creation path, so it needs to call into AbilityFactory (as well as Static Abilities and Triggered Abilities) just like a normal card does.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Quest classes refactoring

Postby Sloth » 20 Mar 2012, 22:29

Max mtg wrote:I'm done with quest classes refactoring, but it does not work now =(
One thing is unclear to me for now.

The card I read from file is stored for later good times. I try to copy it before each game, but it just does not work by any means. Do you have any ideas how a Card object that is not bound to CardFactory can be copied to a new instance?
The function copyTokens should be able to do that. It's not really complete (all abilities, triggers etc. are missing). But i can complete it for you.

EDIT: Just checking: readCard in CardReader can't be used for what you want?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Quest classes refactoring

Postby friarsol » 21 Mar 2012, 02:06

Quest mode seems to be not very stable lately. Right now I have two quests named bob one a .xml and .dat, both available on the quest saves screen. When I close and reopen, it seems like all the changes I made in one of my saves no longer exist, possibly because it was overwritten (selling most of my cards, and the deck I built).

It looks like the quests aren't being unloaded properly either, so when I switch quest saves one with 50+ wins and a new one all the challenges from the first save game are still there. I was also getting some funkiness with my Start button not being active. Soo, there's definitely some funkiness going on with it. We should make sure this all gets ironed out before the next release.

Edit: Deleting doesn't seem to do anything useful. And neither does renaming. Actually, I'm more confused after trying to do both of these actions with what is being shown. in res/quest/data I see bob.xml and tim.dat but I don't see any tim in my quest saves, but there are two bobs. Somehow one of these bobs has the deck I built, and the other doesn't.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Quest classes refactoring

Postby Max mtg » 21 Mar 2012, 03:18

Doublestrike wrote:I also get the following NPE with old DAT files (that worked a week or two ago):
`
Your saves are working now. That was quite easy.

Sloth wrote:The function copyTokens should be able to do that. It's not really complete (all abilities, triggers etc. are missing). But i can complete it for you.

EDIT: Just checking: readCard in CardReader can't be used for what you want?
`
I already use readCard, however it does not set up activated abilities of cards. Not sure about copyTokens. I need to convert the script lines into real abilities. So looks like I should use getCard2 from AbstractCardFactory
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 37 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 37 users online :: 0 registered, 0 hidden and 37 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 37 guests

Login Form