It is currently 29 Oct 2025, 10:35
   
Text Size

Simultaneous Trigger ordering test version

Post MTG Forge Related Programming Questions Here

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

Simultaneous Trigger ordering test version

Postby Hellfish » 20 Apr 2011, 14:30

First off, I know I've been sporadically/constantly missing even from topics started by me(I *will* look into the spoilered dev item, once I weasel my way into the mindset for the cost code) and probably will be somewhat absent in the coming months. Sorry about that, let's just say shit's happening and leave it at that.

However, I *have* been working on letting the player arrange the order of simultaneous triggered abilities. It's a simple little job in itself, the problem was making both the script triggers and the hardcoded triggers (spread over at least 4 places in the code, where I'm sure they could be reduced to one, two tops) play nice with the system and eachother. This has a lot of potential breaking points so I won't commit it until after the next beta. Until then, though, have a jar for testing:
http://www.megaupload.com/?d=PX7WUJMP (Just plonk it in a forge installation directory,renaming or overwriting the current jar)
Or, if you're so inclined, source patch here:
http://pastebin.com/CvjXDYQp
It's r8127 merged with my changes.I've done a bunch of quest mode run-throughs to test but the more the merrier,eh? :)
The jar is about twice the size of the regular jar, though, probably because of my IDEA settings and the dependencies.
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: Simultaneous Trigger ordering test version

Postby Chris H. » 20 Apr 2011, 20:32

Hellfish wrote:First off, I know I've been sporadically/constantly missing even from topics started by me(I *will* look into the spoilered dev item, once I weasel my way into the mindset for the cost code) and probably will be somewhat absent in the coming months. Sorry about that, let's just say shit's happening and leave it at that.

However, I *have* been working on letting the player arrange the order of simultaneous triggered abilities. It's a simple little job in itself, the problem was making both the script triggers and the hardcoded triggers (spread over at least 4 places in the code, where I'm sure they could be reduced to one, two tops) play nice with the system and eachother. This has a lot of potential breaking points so I won't commit it until after the next beta. Until then, though, have a jar for testing:
http://www.megaupload.com/?d=PX7WUJMP (Just plonk it in a forge installation directory,renaming or overwriting the current jar)
Or, if you're so inclined, source patch here:
http://pastebin.com/CvjXDYQp
It's r8127 merged with my changes.I've done a bunch of quest mode run-throughs to test but the more the merrier,eh? :)
The jar is about twice the size of the regular jar, though, probably because of my IDEA settings and the dependencies.
`
Ah, awesome. :D

I will try to release the next beta on Friday.
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: Simultaneous Trigger ordering test version

Postby Chris H. » 22 Apr 2011, 17:47

I have built the next beta version based on rev 8153. I have some of the archives uploaded but a few problems cropped up. I will figure it out and will finish the beta release.

Go ahead and merge your update into the SVN when you are ready. This will give the dev team and the Snacko Scripters a chance to bug test. And, yes, being able to arrange the order of simultaneous triggered abilities, that will be great.
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: Simultaneous Trigger ordering test version

Postby Hellfish » 22 Apr 2011, 22:24

Alright, merged.
Hardcoded triggered abilities in the future should either use the Trigger objects (See Frost Titan code) or use AllZone.Stack.addSimultaneousStackEntry(SpellAbility) when it needs to add itself to the stack. Simultaneous Stack Entries are "flushed" onto the stack in whatever order decided by their controller when priority is passed and when a phase begins(To make phase triggers work).
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: Simultaneous Trigger ordering test version

Postby Sloth » 24 Apr 2011, 13:41

I got this error a couple of times (for example if AI plays a bloodthirst creature):

Code: Select all
Mana_Part : checkMana() error, argument mana is invalid mana, mana - n


Version:
Forge -- official beta: $Date: 2011-01-06 17:34:48 +0100 (Do, 06 Jan 2011) $, SVN revision: $Revision: 4891 $

OS: Windows XP Version: 5.1 Architecture: x86

Java Version: 1.6.0_20 Vendor: Sun Microsystems Inc.

Detailed error trace:
java.lang.RuntimeException: Mana_Part : checkMana() error, argument mana is invalid mana, mana - n
   at forge.card.mana.Mana_Part.checkSingleMana(Unknown Source)
   at forge.card.mana.Mana_PartColor.<init>(Unknown Source)
   at forge.card.mana.ManaCost.getManaPart(Unknown Source)
   at forge.card.mana.ManaCost.split(Unknown Source)
   at forge.card.mana.ManaCost.<init>(Unknown Source)
   at forge.ComputerUtil.canPayCost(Unknown Source)
   at forge.ComputerUtil.playStack(Unknown Source)
   at forge.MagicStack.chooseOrderOfSimultaneousStackEntry(Unknown Source)
   at forge.MagicStack.chooseOrderOfSimultaneousStackEntryAll(Unknown Source)
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Simultaneous Trigger ordering test version

Postby Hellfish » 24 Apr 2011, 14:09

Thanks! Should be fixed now.
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: Simultaneous Trigger ordering test version

Postby Sloth » 08 May 2011, 12:15

I don't know if this worked before, but Mesmeric Orb will freeze the stack with its triggers.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Simultaneous Trigger ordering test version

Postby Hellfish » 08 May 2011, 14:19

Hmm, were there other cards whose triggers went off at the same time? If so, which ones? What and whose card untapped to trigger the Mesmeric Orb?
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: Simultaneous Trigger ordering test version

Postby friarsol » 08 May 2011, 15:08

Mesmeric Orb also has the weird distinction of triggering during an Untap Phase, but waiting to go on the stack till the Upkeep. Maybe that's part of the problem?
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Simultaneous Trigger ordering test version

Postby Sloth » 08 May 2011, 16:41

Hellfish wrote:Hmm, were there other cards whose triggers went off at the same time? If so, which ones? What and whose card untapped to trigger the Mesmeric Orb?
There were no other triggers around.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Simultaneous Trigger ordering test version

Postby Hellfish » 08 May 2011, 17:11

Okay, should be good now. Nobody recieves priority during the untap step anymore.
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


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 8 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 8 guests

Login Form