It is currently 04 Sep 2025, 22:12
   
Text Size

Developing Bugs

Post MTG Forge Related Programming Questions Here

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

Re: Developing Bugs

Postby friarsol » 27 May 2013, 03:27

Also, the Play/Draw dialog shows up but I can already see my opening hand, which shouldn't happen.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Developing Bugs

Postby Sloth » 29 May 2013, 17:38

r21815: Got this without attacking with anything during my Combat Begin. No problem playing onward though.

NullPointerException | Open
Code: Select all
Forge Version:    SVN
Operating System: Windows 7 6.1 amd64
Java Version:     1.6.0_38 Sun Microsystems Inc.

java.lang.NullPointerException
   at forge.gui.input.InputAttack.setCurrentDefender(InputAttack.java:147)
   at forge.gui.input.InputAttack.onOk(InputAttack.java:98)
   at forge.gui.input.InputBase.selectButtonOK(InputBase.java:64)
   at forge.gui.InputProxy.selectButtonOK(InputProxy.java:80)
   at forge.gui.match.controllers.CMessage$2.actionPerformed(CMessage.java:61)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.AbstractButton.doClick(Unknown Source)
   at javax.swing.AbstractButton.doClick(Unknown Source)
   at forge.gui.toolbox.FButton$1.keyPressed(FButton.java:87)
   at java.awt.Component.processKeyEvent(Unknown Source)
   at javax.swing.JComponent.processKeyEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
   at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$400(Unknown Source)
   at java.awt.EventQueue$2.run(Unknown Source)
   at java.awt.EventQueue$2.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(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.AccessControlContext$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)
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Developing Bugs

Postby Sloth » 29 May 2013, 17:56

r21817: Conceding the game when prompted to play or draw. After that freeze.

IllegalStateException | Open
Code: Select all
Forge Version:    SVN
Operating System: Windows 7 6.1 amd64
Java Version:     1.6.0_38 Sun Microsystems Inc.

java.lang.IllegalStateException: No opponents left ingame for Molly
   at forge.game.player.Player.getOpponent(Player.java:289)
   at forge.card.cardfactory.CardFactoryUtil.xCount(CardFactoryUtil.java:1132)
   at forge.card.ability.AbilityUtils.xCount(AbilityUtils.java:1222)
   at forge.card.ability.AbilityUtils.calculateAmount(AbilityUtils.java:348)
   at forge.card.staticability.StaticAbilityContinuous.applyContinuousAbility(StaticAbilityContinuous.java:109)
   at forge.card.staticability.StaticAbility.applyAbility(StaticAbility.java:243)
   at forge.game.GameAction.checkStaticAbilities(GameAction.java:892)
   at forge.game.GameAction.checkStateEffects(GameAction.java:940)
   at forge.game.GameAction.startGame(GameAction.java:1498)
   at forge.game.Match$1.run(Match.java:104)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Developing Bugs

Postby Max mtg » 29 May 2013, 18:45

@Sloth, I don't know how you manage to do this, but you are really great at finding concurrency problems.

(for InputAttack issue)
This time Game thread has changed defenders variable (a field of Combat class) but EDT was not aware of that, since the event didn't happen-before from ETD's point of view.
I have added a call to a block syncronized on the same variable (let it be inputLock) so that release of that lock in Game thread (and whatever was executed by same thread) is performed. When EDT thread is about to show message of a newly selected input it shall acquire lock on the same object (inputLock) . That ensures propper order or operations.

(for concede before turns start)
fixed by 21821
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: Developing Bugs

Postby swordshine » 01 Jun 2013, 12:22

The leave-play trigger of Patron of the Nezumi doesn't quite work. The rule says
2/1/2005: Patron of the Nezumi's ability triggers even if an event puts this and multiple other permanents into the graveyard at the same time (Wrath of God, gang blocks, etc.)
I cast Wrath of God, but nothing triggered. Then I tried multiple Blood Artists in play and cast Wrath of God, each Blood Artist only triggered once for himself.
Patron of the Nezumi | Open
Code: Select all
Name:Patron of the Nezumi
ManaCost:5 B B
Types:Legendary Creature Spirit
PT:6/6
K:Rat offering
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | TriggerZones$ Battlefield | ValidCard$ Card.OppOwn | Execute$ TrigLoseLife | TriggerDescription$ Whenever a permanent is put into an opponent's graveyard, that player loses 1 life.
SVar:TrigLoseLife:AB$ LoseLife | Cost$ 0 | Defined$ TriggeredCardOwner | LifeAmount$ 1
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/patron_of_the_nezumi.jpg
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Developing Bugs

Postby friarsol » 01 Jun 2013, 12:34

swordshine wrote:The leave-play trigger of Patron of the Nezumi doesn't quite work. The rule says
I believe this is an issue with this trigger in general as Blood Artist also doesn't handle this scenario correctly.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Developing Bugs

Postby Hanmac » 06 Jun 2013, 10:41

Modular Creatures like Arcbound Worker does not trigger anymore the effect of Sword of the Meek.

Modular says: "enters the Battlefield with" so its an 1/1 when entering the field and should activate the effect of the Sword
Hanmac
 
Posts: 954
Joined: 06 May 2013, 18:44
Has thanked: 229 times
Been thanked: 158 times

Re: Developing Bugs

Postby friarsol » 08 Jun 2013, 16:46

Re: r22013
Hey Max, if you are gonna tell someone to follow naming conventions, you should probably tell the person who actually had something to do with the file, not a random other person.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Developing Bugs

Postby Max mtg » 08 Jun 2013, 17:00

Huh, you were not involved, right. I am sorry. Swordshine was.
I just remember you've changed all costs at some point of time

How can I correct SVN log?
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: Developing Bugs

Postby Max mtg » 08 Jun 2013, 17:02

I am going on a vacation for the next week because I fail to understand new code works and I also mix up the things I should not.
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: Developing Bugs

Postby swordshine » 09 Jun 2013, 00:25

Max mtg wrote:Huh, you were not involved, right. I am sorry. Swordshine was.
I just remember you've changed all costs at some point of time

How can I correct SVN log?
Oops, my fault.
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Developing Bugs

Postby friarsol » 09 Jun 2013, 01:11

Max mtg wrote:I am going on a vacation for the next week because I fail to understand new code works and I also mix up the things I should not.
Heh no worries. When I was way more active in Forge codebase (2 years ago) I felt like that sometimes too. I promise I won't break too much of your stuff while you are taking a few days for mental health ;)
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Developing Bugs

Postby swordshine » 15 Jun 2013, 16:05

I'm trying to script Ayesha Tanaka.
Ayesha Tanaka | Open
Code: Select all
Name:Ayesha Tanaka
ManaCost:W W U U
Types:Legendary Creature Human Artificer
PT:2/2
K:Banding
A:AB$ Counter | Cost$ T | TgtPrompt$ Select target Activated Ability | ValidTgts$ Artifact | TargetType$ Activated | UnlessCost$ W | SpellDescription$ Counter target activated ability from an artifact source unless that ability's controller pays W.
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/ayesha_tanaka.jpg
It's weird that the TargetedController of the activated ability is always my opponent. I tried to counter a equip ability of my Sword of Body and Mind, but ai paid the cost.



Ruhan of the Fomori doesn't actually choose a player at random.
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Developing Bugs

Postby Agetian » 18 Jun 2013, 12:32

I'm getting this compilation error when trying to compile r22144:

Code: Select all
1. ERROR in D:\NetBeansProjects\trunk\src\main\java\forge\card\cardfactory\CardFactoryCreatures.java (at line 135)
   final Target abTgt = new Target("Target a creature to Hunt", new String[]{"Creature"});
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The constructor Target(String, String[]) is undefined
It seems that the relevant line has to become:
new Target("Target a creature to Hunt", new String[]{"Creature"}, "1", "1");

But I'm not sure about the min/max parameters, so I decided not to jump right into tweaking this myself...

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: Developing Bugs

Postby Chris H. » 21 Jun 2013, 16:50

I updated to the head version 22193 and Forge will not build as there are three errors:

Code: Select all
Cannot instantiate the type ArrayList<?>    ChangeTargetsEffect.java    /ForgeSVN/src/main/java/forge/card/ability/effects    line 54    Java Problem

Syntax error on token "<", ? expected after this token    ChangeTargetsEffect.java    /ForgeSVN/src/main/java/forge/card/ability/effects    line 54    Java Problem

Type mismatch: cannot convert from ArrayList<?> to List<Pair<SpellAbilityStackInstance,ITargetable>>    ChangeTargetsEffect.java    /ForgeSVN/src/main/java/forge/card/ability/effects    line 54    Java Problem
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

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 22 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 22 users online :: 0 registered, 0 hidden and 22 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 22 guests

Login Form