It is currently 29 Apr 2024, 13:07
   
Text Size

Modular

Post MTG Forge Related Programming Questions Here

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

Re: Modular

Postby Chris H. » 04 Oct 2009, 13:12

zerker2000 wrote:Eclipse seems to not like your code: I extract it, base a new project off of it, and get this when I try to run it:

Code: Select all
java.io.FileNotFoundException: forge.properties (No such file or directory)
`
The 10-03 source did not include the forge.properties file, I moved a copy of this file from the 10-02 version and placed it in the root folder of 10-03 project that I built. This will take care of your problem.

The 10-03 source also has the res folder along with the source code. You can also move this folder to the the root folder of 10-03 project. It should build OK. :wink:
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: Modular

Postby zerker2000 » 04 Oct 2009, 16:46

Ok got it working thanks chris.

Bug: Master Transmuter doesn't tap or require U to activate. And before you ask, this happened on a fresh downloaded version without any of my code :?.

EDIT:Caught, targeting is set beforePayMana instead of after. Anyone care to check whether that's the case in 10.02?

P.S Which should have been, by the way, be called in Input_PayManaCost similarly to beforPayMana in GameAction.PlaySpellAbility, or removed from SpellAbility completely if noone decided to use it. Either way, I have now added it where it belongs and fixed Master Transmuter.
Last edited by zerker2000 on 04 Oct 2009, 17:49, edited 1 time in total.
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.


--Eladamri, the Seed of Freyalise
zerker2000
Programmer
 
Posts: 569
Joined: 09 May 2009, 21:40
Location: South Pasadena, CA
Has thanked: 0 time
Been thanked: 0 time

Re: Modular

Postby DennisBergkamp » 04 Oct 2009, 17:02

Oh shoot, yes. I must've forgotten to include it. The 10-02 version should have it, grab it from there.
Sorry about that :(
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Modular

Postby DennisBergkamp » 04 Oct 2009, 17:17

Bug: Master Transmuter doesn't tap or require U to activate. And before you ask, this happened on a fresh downloaded version without any of my code :?.
Ah, you are right:
Fix it by updating the input code:

Code: Select all
public void selectCard(Card c, PlayerZone zone)
          {
           PlayerZone play = AllZone.getZone(Constant.Zone.Play,card.getController());
            if(c.isArtifact() && AllZone.GameAction.isCardInZone(c, play))
            {
              PlayerZone hand = AllZone.getZone(Constant.Zone.Hand,card.getController());
             
              play.remove(c);
              hand.add(c);
              ability.setTargetCard(c);
              //AllZone.Stack.add(ability);
              stopSetNext(new Input_PayManaCost(ability));
            }
          }//selectCard()
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Modular

Postby Chris H. » 04 Oct 2009, 17:45

DennisBergkamp wrote:Oh shoot, yes. I must've forgotten to include it. The 10-02 version should have it, grab it from there.
Sorry about that :(
`
Most of the forge.properties file is comments, there is only a single line that is not a comment and it is the last line of the file. It is easy for anyone to miss the fact that this file is required. :wink:
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: Modular

Postby zerker2000 » 04 Oct 2009, 17:52

DennisBergkamp wrote:
Bug: Master Transmuter doesn't tap or require U to activate. And before you ask, this happened on a fresh downloaded version without any of my code :?.
Ah, you are right:
Fix it by updating the input code:

Code: Select all
public void selectCard(Card c, PlayerZone zone)
          {
           PlayerZone play = AllZone.getZone(Constant.Zone.Play,card.getController());
            if(c.isArtifact() && AllZone.GameAction.isCardInZone(c, play))
            {
              PlayerZone hand = AllZone.getZone(Constant.Zone.Hand,card.getController());
             
              play.remove(c);
              hand.add(c);
              ability.setTargetCard(c);
              //AllZone.Stack.add(ability);
              stopSetNext(new Input_PayManaCost(ability));
            }
          }//selectCard()
Well, technically it's pay first, bounce second ... see edit above.
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.


--Eladamri, the Seed of Freyalise
zerker2000
Programmer
 
Posts: 569
Joined: 09 May 2009, 21:40
Location: South Pasadena, CA
Has thanked: 0 time
Been thanked: 0 time

Re: Modular

Postby DennisBergkamp » 04 Oct 2009, 19:37

Ah, alright, good :)
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Modular

Postby Chris H. » 04 Oct 2009, 21:12

DennisBergkamp wrote:- Added a few extra cards.
`
The spell Field of Mists has the wrong card name, it should be Cloak of Mists. Several of the jpg urls do not download a file with the .jpg extension, they are missing.
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: Modular

Postby zerker2000 » 05 Oct 2009, 03:42

Ok, I'm finished, the rats were done as a calm-down exercise :D .
ForgeSource1004.zip
The updated source.
(558.93 KiB) Downloaded 245 times
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.


--Eladamri, the Seed of Freyalise
zerker2000
Programmer
 
Posts: 569
Joined: 09 May 2009, 21:40
Location: South Pasadena, CA
Has thanked: 0 time
Been thanked: 0 time

Re: Modular

Postby DennisBergkamp » 05 Oct 2009, 16:23

NICE!! I will play with it later this afternoon :)
Which other bugs did you fix, by the way?
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Modular

Postby zerker2000 » 05 Oct 2009, 23:09

Other? As in ones that cropped up independently of the Mana Pool/Ability_Mana/Gemstone Array merging? Well, replacing all instances of
Code: Select all
card.removeInstrinsicKeyword("tap: add...
card.setText(card.getText() + ability)
card.addInstrinsicKeyword(...
with simply card.setText(card.getSpellText() + ability) might count... Also, more of a heads-up than a bug fix, SpellAbility now contains "Object[] choices_made;", to use as you see fit (so far it's used for GemstoneArray, However It could be a good idea to reroute i.e. SpellAbility. targetPlayer and SpellAbility.targetCard to choices_made[0] and choices_made[1], respectively, maybe even make set/getTagretCard(int number){...choices_made[number]} for multitargeting... just basically, use to discretion).
EDIT: Oh, and fixed a couple of String == "<value>" to String.equals("<value>") here and there ... should prevent a couple future bugs :P.
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.


--Eladamri, the Seed of Freyalise
zerker2000
Programmer
 
Posts: 569
Joined: 09 May 2009, 21:40
Location: South Pasadena, CA
Has thanked: 0 time
Been thanked: 0 time

Re: Modular

Postby DennisBergkamp » 06 Oct 2009, 01:27

Alright, awesome :)
I was just wondering, because I usually post a little changelog of all the changes whenever I upload a new version.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Modular

Postby zerker2000 » 06 Oct 2009, 02:33

Import my code as a new project in eclipse, select the two projects in project/package browser, and RClick-"Compare With"-"Each Other" should do it.
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.


--Eladamri, the Seed of Freyalise
zerker2000
Programmer
 
Posts: 569
Joined: 09 May 2009, 21:40
Location: South Pasadena, CA
Has thanked: 0 time
Been thanked: 0 time

Re: Modular

Postby DennisBergkamp » 06 Oct 2009, 02:48

Nice, didn't know this was possible in Eclipse :)
I'll make some more changes of my own, and I'll upload next release in the next day or two.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Modular

Postby zerker2000 » 06 Oct 2009, 03:09

How'd you think I did half my merging?!
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.


--Eladamri, the Seed of Freyalise
zerker2000
Programmer
 
Posts: 569
Joined: 09 May 2009, 21:40
Location: South Pasadena, CA
Has thanked: 0 time
Been thanked: 0 time

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 89 guests


Who is online

In total there are 89 users online :: 0 registered, 0 hidden and 89 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 89 guests

Login Form