It is currently 08 Sep 2025, 08:10
   
Text Size

Implementing variants

Post MTG Forge Related Programming Questions Here

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

Re: Implementing variants

Postby moomarc » 21 Feb 2013, 14:47

There seems to be a problem with the PlaneswalkedFrom trigger. I tried using it to script Orzhova but it acts exactly the same as though I'd used PlaneswalkedTo in that it triggers when I planeswalk to Orzhova. I've double-checked all the variable names and everything is right. I also inserted loads of println's and the correct card is being passed to the triggerHandler, but there's just something wierd with the timing. I've looked through the code trail and it seems straightforward and it should work... but it just doesn't. I don't get it! :?

Anyway, here's the script if someone can figure out what the issue is. The final script would use ValidCard$Plane.Self in the PlaneswalkedFrom, but for now that doesn't work because it's triggering at the wrong time so is checking the Plane left when it arrives at the new plane.
Code: Select all
Name:Orzhova
ManaCost:no cost
Types:Plane Ravnica
Text:no text
T:Mode$ PlaneswalkedFrom | ValidCard$ Plane | TriggerZones$ Command | Execute$ OrzhovaDeal | TriggerDescription$ When you planeswalk away from CARDNAME, each player returns all creature cards from his or her graveyard to the battlefield.
SVar:OrzhovaDeal:DB$ ChangeZoneAll | Origin$ Graveyard | Destination$ Battlefield | ChangeType$ Creature
T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChaos | TriggerDescription$ Whenever you roll Chaos, for each opponent, exile up to one target creature card from that player's graveyard.
SVar:RolledChaos:AB$ ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Exile | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature each opponent controls. | TargetMin$ 0 | TargetMax$ OneEach | References$ OneEach | TargetsWithDifferentControllers$ True
SVar:OneEach:PlayerCountOpponents$Amount
T:Mode$ PlanarDice | Result$ Planeswalk | TriggerZones$ Command | Execute$ RolledWalk | Secondary$ True | TriggerDescription$ Whenever you roll Planeswalk, put this card on the bottom of its owner's planar deck face down, then move the top card of your planar deck off that planar deck and turn it face up
SVar:RolledWalk:AB$ Planeswalk | Cost$ 0
A:AB$ RollPlanarDice | Cost$ X | SorcerySpeed$ True | ActivationZone$ Command | SpellDescription$ Roll the planar dice.
SVar:X:Count$RolledThisTurn
SVar:Picture:http://www.wizards.com/global/images/magic/general/orzhova.jpg
SetInfo:PC2|Common|http://magiccards.info/extras/plane/planechase-2012-edition/orzhova.jpg
Oracle:When you planeswalk away from Orzhova, each player returns all creature cards from his or her graveyard to the battlefield.\nWhenever you roll {C}, for each opponent, exile up to one target creature card from that player's graveyard.
End
Only difference between PlaneswalkedFrom/To at the moment is the valid card checked, not when the check happens.
-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: Implementing variants

Postby Hellfish » 21 Feb 2013, 15:01

Huh.You're right, it looks straightforward.. I'll take a look either today or this weekend. :-)
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: Implementing variants

Postby Hellfish » 21 Feb 2013, 20:09

I think what's happening is that the stack is frozen while the planeswalking ability resolves, hence the PlaneswalkedFrom trigger for the previous plane causes Sol's(I think Sol implemented it) WaitingTrigger system to kick in and create a WaitingTrigger for that plane and put it in a queue. Then the planeswalking ability finishes resolving, putting away the current plane and putting Orzhova in the command zone before running the WaitingTriggers. So now we have Orzhova in the command zone and a waiting PlaneswalkedFrom trigger that only now gets run, which Orzhova picks up on.

Now to figure out how to fix it :mrgreen:
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: Implementing variants

Postby friarsol » 21 Feb 2013, 20:14

Hellfish wrote:I think what's happening is that the stack is frozen while the planeswalking ability resolves, hence the PlaneswalkedFrom trigger for the previous plane causes Sol's(I think Sol implemented it) WaitingTrigger system to kick in and create a WaitingTrigger for that plane and put it in a queue. Then the planeswalking ability finishes resolving, putting away the current plane and putting Orzhova in the command zone before running the WaitingTriggers. So now we have Orzhova in the command zone and a waiting PlaneswalkedFrom trigger that only now gets run, which Orzhova picks up on.

Now to figure out how to fix it :mrgreen:
Shouldn't the script be
T:Mode$ PlaneswalkedFrom | ValidCard$ Plane.Self
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Implementing variants

Postby Hellfish » 21 Feb 2013, 20:19

Heh,true. :mrgreen: I must need glasses.
PlaneswalkedFrom still doesn't run for the plane because it's not forge-technically in the command zone (It's in the players planar deck List) at the time the WaitingTrigger runs. *This* is what I actually need to fix. :mrgreen:
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: Implementing variants

Postby moomarc » 21 Feb 2013, 20:30

friarsol wrote:
Hellfish wrote:I think what's happening is that the stack is frozen while the planeswalking ability resolves, hence the PlaneswalkedFrom trigger for the previous plane causes Sol's(I think Sol implemented it) WaitingTrigger system to kick in and create a WaitingTrigger for that plane and put it in a queue. Then the planeswalking ability finishes resolving, putting away the current plane and putting Orzhova in the command zone before running the WaitingTriggers. So now we have Orzhova in the command zone and a waiting PlaneswalkedFrom trigger that only now gets run, which Orzhova picks up on.
Now to figure out how to fix it :mrgreen:
Shouldn't the script be
T:Mode$ PlaneswalkedFrom | ValidCard$ Plane.Self
That's what I said in my original post. I just didn't post that version of the script because then nothing happened. Thought I'd post something where you could see what I was talking about more clearly.
-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: Implementing variants

Postby friarsol » 21 Feb 2013, 20:44

Hellfish wrote:Heh,true. :mrgreen: I must need glasses.
PlaneswalkedFrom still doesn't run for the plane because it's not forge-technically in the command zone (It's in the players planar deck List) at the time the WaitingTrigger runs. *This* is what I actually need to fix. :mrgreen:
I would imagine it shouldn't have a TriggerZones parameter at all. (Since this is determining when this trigger should fire.)

See how Aven Riftwatcher's leaves the battlefield trigger works?

T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.Self | Execute$ TrigGainLife | Secondary$ True | TriggerDescription$ When CARDNAME enters the battlefield or leaves the battlefield, you gain 2 life.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Implementing variants

Postby Hellfish » 21 Feb 2013, 20:54

Also true *but* the planar deck lists are not included in the "allCards" list that the triggerhandler loops through looking for triggers.That's what I meant fixing. :-)

Edit: Look at me going all politician with the misleading evasive answers :lol: Sorry about that
.
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: Implementing variants

Postby moomarc » 21 Feb 2013, 21:05

We would probably have had to make the planar deck a game zone eventually anyway so that we could script the phenomenon/plane (can't remember which, let alone the name) that let's you search your planar deck. (You might notice that I didn't study it to carefully I just saw it while scanning for a card to script)
-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: Implementing variants

Postby friarsol » 21 Feb 2013, 21:09

Hellfish wrote:Edit: Look at me going all politician with the misleading evasive answers :lol: Sorry about that
.
Apology not accepted. (In fact, I'll often use this diplomatic answer tactic, and it is quite entertaining.)
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Implementing variants

Postby Hellfish » 22 Feb 2013, 07:10

I may just have to knuckle down and implement Card Piles in the UI or this could get real hacky real fast... The daunting part is rewriting the VField bits and touching the forge.view.arcane package in general D:
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: Implementing variants

Postby friarsol » 23 Feb 2013, 01:54

Hellfish,

It looks like http://magiccards.info/query?q=Fractured+Powerstone is an easy script. If you try to roll a Planar Die in a non-Planechase game, does something still happen?
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Implementing variants

Postby Max mtg » 23 Feb 2013, 07:18

UI home screens are displayed incorrecly on large monitors. The panel moves somewhere to the right and looks misaligned.

Misaligned variants sample: http://img534.imageshack.us/img534/6641/misalign.jpg
Correctly aligned contructed menu (for reference) : http://img717.imageshack.us/img717/5467/rightalign.jpg

Images appear to be downscaled from 1920 px wide to 1024, but misalignment is visible despite of that.
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: Implementing variants

Postby Hellfish » 23 Feb 2013, 08:08

Sol: triggers will be run but nothing would care, of course.

Max:sorry about that.I couldn't test beyond 1280x1024 at the time.I'll take a look at the constraints, confusing though they are :lol:
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: Implementing variants

Postby Chris H. » 23 Feb 2013, 18:48

Hellfish wrote:Max:sorry about that.I couldn't test beyond 1280x1024 at the time.I'll take a look at the constraints, confusing though they are :lol:
 
Hey, Hellfish.

It looks like the problem is fairly widespread throughout the views. The lblTitle for the various views are pushed to the right and I think that they would look better if they were centered. I guess that the variant classes were created using the same "ax right" statement as the lblTitle add commands.
 
Screen Shot Archenemy Right.jpg
Archenemy ax right

 
Screen Shot Archenemy Center.jpg
Archenemy ax center

 
It looks like it might be a simple case of searching for "ax right" and replacing it with "ax center".

Here is the old populate method from VSubmenuArchenemy:

Code: Select all
    public void populate() {
        VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().removeAll();
        VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().setLayout(new MigLayout("insets 0, gap 0, wrap 1, ax right"));

        VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(lblTitle, "w 80%!, h 40px!, gap 0 0 15px 15px, span 2, ax right");

        for (FDeckChooser fdc : deckChoosers) {
            fdc.populate();
        }

        VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(tabPane, "gap 0 0 50px 50px, growx, growy");

        VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().add(pnlStart, "span 1, ax center");

        VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().revalidate();
        VHomeUI.SINGLETON_INSTANCE.getPnlDisplay().repaintSelf();

    }
 
I replaced the two cases of "ax right" with "ax center" and it looks a lot better. I will merge in my change so people can take a peek and see if they agree that this change should be made in other places.
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 48 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form