Page 2 of 4

Re: So I got a little sidetracked... again.

PostPosted: 01 May 2012, 22:02
by Hellfish
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.

Re: So I got a little sidetracked... again.

PostPosted: 02 May 2012, 02:20
by friarsol
Hellfish 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.
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$CardToughness

Re: So I got a little sidetracked... again.

PostPosted: 02 May 2012, 05:42
by Hellfish
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.

Re: So I got a little sidetracked... again.

PostPosted: 02 May 2012, 11:58
by friarsol
Hellfish 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.
Yea we're not quite setup for handling those type of cards

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.

Re: So I got a little sidetracked... again.

PostPosted: 09 May 2012, 20:01
by Hellfish
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. :)

Re: So I got a little sidetracked... again.

PostPosted: 10 May 2012, 06:04
by Sloth
Hellfish wrote:I'll try to work out a build for the named parameters you suggested, just to have something concrete to compare with. :)
The named parameters should be easy to code in general, but a lot of work to convert. I'm willing to help with whatever. :D

Re: So I got a little sidetracked... again.

PostPosted: 10 May 2012, 10:17
by Chris H.
Sloth wrote:
Hellfish wrote:I'll try to work out a build for the named parameters you suggested, just to have something concrete to compare with. :)
The named parameters should be easy to code in general, but a lot of work to convert. I'm willing to help with whatever. :D
 
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.

Re: So I got a little sidetracked... again.

PostPosted: 10 May 2012, 14:35
by ArsenalNut
Chris H. wrote:
Sloth wrote:
Hellfish wrote:I'll try to work out a build for the named parameters you suggested, just to have something concrete to compare with. :)
The named parameters should be easy to code in general, but a lot of work to convert. I'm willing to help with whatever. :D
 
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.
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.

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.

Re: So I got a little sidetracked... again.

PostPosted: 10 May 2012, 16:31
by moomarc
I'll also help convert scripts whenever I can find free time.

(@Chris: Good luck with the move)

Re: So I got a little sidetracked... again.

PostPosted: 10 May 2012, 17:10
by Hellfish
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.
Yes please.I'm only about 2% unsure of the process but then again, that's not 100% sure. :roll:

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! :D

Re: So I got a little sidetracked... again.

PostPosted: 10 May 2012, 23:10
by ArsenalNut
Hellfish wrote:
ArsenalNut wrote: If you need help setting up a branch, let me know.

Yes please.I'm only about 2% unsure of the process but then again, that's not 100% sure. :roll:
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:
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.
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.
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.

Re: So I got a little sidetracked... again.

PostPosted: 11 May 2012, 03:43
by ArsenalNut
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.

Re: So I got a little sidetracked... again.

PostPosted: 11 May 2012, 10:47
by Chris H.
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. =D>

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. :lol:

Re: So I got a little sidetracked... again.

PostPosted: 12 May 2012, 10:30
by Hellfish
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!

Re: So I got a little sidetracked... again.

PostPosted: 12 May 2012, 12:21
by Sloth
I'm currently testing the branch and Necrotic Ooze was working as expected with Brain Weevil. =D>

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?