So I got a little sidetracked... again.
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
58 posts
• Page 2 of 4 • 1, 2, 3, 4
Re: So I got a little sidetracked... again.
by Hellfish » 01 May 2012, 22:02
Possibility: Add a "References$" parameter where all used (xCount)SVars will be listed. These will, when the ability is actually created, copy over SVars from the card to the ability. Every AF method should then use SpellAbility.getSVar(...) instead of Card.getSVar(...).
A bit tired from banging my head against the problem but I see no elegant way to eliminate those SVars from Card completely as, at parse-time, the abilities are still some ways from being created and if we started creating the abilities at parse-time we'd get in trouble with RemoveAbilities static effects which need the actual script to be stored anyway.
A bit tired from banging my head against the problem but I see no elegant way to eliminate those SVars from Card completely as, at parse-time, the abilities are still some ways from being created and if we started creating the abilities at parse-time we'd get in trouble with RemoveAbilities static effects which need the actual script to be stored anyway.
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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: So I got a little sidetracked... again.
by friarsol » 02 May 2012, 02:20
If we changed the parsing of Count from $ to something else (maybe like =) we could just have NumDmg$ Count=CardToughness instead of NumDmg$ X and SVar:X:Count$CardToughnessHellfish wrote:Possibility: Add a "References$" parameter where all used (xCount)SVars will be listed. These will, when the ability is actually created, copy over SVars from the card to the ability. Every AF method should then use SpellAbility.getSVar(...) instead of Card.getSVar(...).
A bit tired from banging my head against the problem but I see no elegant way to eliminate those SVars from Card completely as, at parse-time, the abilities are still some ways from being created and if we started creating the abilities at parse-time we'd get in trouble with RemoveAbilities static effects which need the actual script to be stored anyway.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: So I got a little sidetracked... again.
by Hellfish » 02 May 2012, 05:42
Then what about scripts where one SVar will reference another, like Breakout, Ceta Sanctuary or Dark Suspicions? Maybe something like "A:Count=InYourHand;B:Count=InOppHand;X:SVar=B/Minus.A"(Dark Suspicions) and use the last declared for the value, though now we're getting cluttered. :/
Also, an SVar defined in one parameter will frequently be used in more parameters, also in Costs (which will need access to the SA it belongs to) so I'm fairly certain SVars still need to be named.
Also, an SVar defined in one parameter will frequently be used in more parameters, also in Costs (which will need access to the SA it belongs to) so I'm fairly certain SVars still need to be named.
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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: So I got a little sidetracked... again.
by friarsol » 02 May 2012, 11:58
Yea we're not quite setup for handling those type of cardsHellfish wrote:Then what about scripts where one SVar will reference another, like Breakout, Ceta Sanctuary or Dark Suspicions? Maybe something like "A:Count=InYourHand;B:Count=InOppHand;X:SVar=B/Minus.A"(Dark Suspicions) and use the last declared for the value, though now we're getting cluttered. :/
Also, an SVar defined in one parameter will frequently be used in more parameters, also in Costs (which will need access to the SA it belongs to) so I'm fairly certain SVars still need to be named.
Maybe, we could have it as a named parameter inside the SpellAbility.
AB$ Draw | Amount$ X | X$ SVar=B/Minus.A | A$ Count=InYourHand | B$ Count=InOppHand
it's going to be a large undertaking which ever way we go with.
Maybe the references would be the simpler way to go.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: So I got a little sidetracked... again.
by Hellfish » 09 May 2012, 20:01
I've got a working build that uses the References parameter, just gonna clean it up (by Sunday, maybe) and let you all have a patch to look at. The problem is when(if, actually) this code is committed every single card that uses SVars must be updated to use the References$ param or they will cause a crash.
I'll try to work out a build for the named parameters you suggested, just to have something concrete to compare with.
I'll try to work out a build for the named parameters you suggested, just to have something concrete to compare with.

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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: So I got a little sidetracked... again.
by Sloth » 10 May 2012, 06:04
The named parameters should be easy to code in general, but a lot of work to convert. I'm willing to help with whatever.Hellfish wrote:I'll try to work out a build for the named parameters you suggested, just to have something concrete to compare with.

-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: So I got a little sidetracked... again.
by Chris H. » 10 May 2012, 10:17
Sloth wrote:The named parameters should be easy to code in general, but a lot of work to convert. I'm willing to help with whatever.Hellfish wrote:I'll try to work out a build for the named parameters you suggested, just to have something concrete to compare with.
My wife and I are getting ready to move on August 8th. There will be a time period where I will be off line and will be unable to participate in our project as we settle down in our new home.

We might be able to co-ordinate this work with my being preoccupied with my upcoming move. And/or you might want to consider making a branch as we have had some success in this in the recent past.
-
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: So I got a little sidetracked... again.
by ArsenalNut » 10 May 2012, 14:35
I definitely think this needs to be worked on as a branch especially if the whole SVar structure needs to change. If you need help setting up a branch, let me know.Chris H. wrote:Sloth wrote:The named parameters should be easy to code in general, but a lot of work to convert. I'm willing to help with whatever.Hellfish wrote:I'll try to work out a build for the named parameters you suggested, just to have something concrete to compare with.
My wife and I are getting ready to move on August 8th. There will be a time period where I will be off line and will be unable to participate in our project as we settle down in our new home.
We might be able to co-ordinate this work with my being preoccupied with my upcoming move. And/or you might want to consider making a branch as we have had some success in this in the recent past.
For converting card scripts, if its basically a syntax change, I can probably write a Perl or Python script to do the majority of the heavy lifting.
So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: So I got a little sidetracked... again.
by moomarc » 10 May 2012, 16:31
I'll also help convert scripts whenever I can find free time.
(@Chris: Good luck with the move)
(@Chris: Good luck with the move)
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: So I got a little sidetracked... again.
by Hellfish » 10 May 2012, 17:10
Yes please.I'm only about 2% unsure of the process but then again, that's not 100% sure.ArsenalNut wrote: If you need help setting up a branch, let me know.
For converting card scripts, if its basically a syntax change, I can probably write a Perl or Python script to do the majority of the heavy lifting.

I think the script conversion will require a bit more manual labor,sadly. Only if an ability references XCount svars (not subability svars) does it need a References parameter to list the names of those svars.
Thanks for the help offers, all!

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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: So I got a little sidetracked... again.
by ArsenalNut » 10 May 2012, 23:10
I'll try to write some step by step instructions in the wiki under the branches section. I'll write them initially assuming you're using Subclipse. I personally use TortoiseSVN so I could write those steps too.Hellfish wrote:Yes please.I'm only about 2% unsure of the process but then again, that's not 100% sure.ArsenalNut wrote: If you need help setting up a branch, let me know.![]()
I haven't given up on the script idea yet. I don't really understand the changes to the syntax you're making yet. I want to see some examples before I can really decide if a script is worth the effort.Hellfish wrote:I think the script conversion will require a bit more manual labor,sadly. Only if an ability references XCount svars (not subability svars) does it need a References parameter to list the names of those svars.ArsenalNut wrote:
For converting card scripts, if its basically a syntax change, I can probably write a Perl or Python script to do the majority of the heavy lifting.
So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: So I got a little sidetracked... again.
by ArsenalNut » 11 May 2012, 03:43
I updated the branches section in the Wiki to cover the steps to create a branch using the Subclipse plug-in. Let me know if you have any questions.
I'll try add step-by-step instructions on updating a branch from the trunk and also merging a feature branch back into the trunk over the next couple days.
I'll try add step-by-step instructions on updating a branch from the trunk and also merging a feature branch back into the trunk over the next couple days.
So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: So I got a little sidetracked... again.
by Chris H. » 11 May 2012, 10:47
ArsenalNut wrote:I updated the branches section in the Wiki to cover the steps to create a branch using the Subclipse plug-in. Let me know if you have any questions.
I'll try add step-by-step instructions on updating a branch from the trunk and also merging a feature branch back into the trunk over the next couple days.
Thank you for adding the branches section to the wiki.

I initially expected to find it under the "3 Working with the project" section. I did not expect to find it under the "2 Installations" section.
I do appreciate the step-by-step instructions. I am just wondering where the branch instructions should be placed in the getting started wiki.
Granted, I just woke up and my mind is still a little foggy while I drink my first cup of coffee.

-
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: So I got a little sidetracked... again.
by Hellfish » 12 May 2012, 10:30
The exact terminology used in Subclipse here was a bit different from your example but it was thorough enough to help me through anyway. Thanks, Arsenal!
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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: So I got a little sidetracked... again.
by Sloth » 12 May 2012, 12:21
I'm currently testing the branch and Necrotic Ooze was working as expected with Brain Weevil. 
So the big task to do is adding "References$ XY" to all activated abilities that use SVars with Count. Are there any other unsolved problems we can help with/think about?

So the big task to do is adding "References$ XY" to all activated abilities that use SVars with Count. Are there any other unsolved problems we can help with/think about?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
58 posts
• Page 2 of 4 • 1, 2, 3, 4
Who is online
Users browsing this forum: No registered users and 47 guests