Page 1 of 1

How to code Feldon's Cane

PostPosted: 03 Oct 2012, 22:29
by Marcel Costa
Hi I'm a modding newbie so forgive me for stupidity.

I was trying to code Feldon's Cane using

Code: Select all
<RESOLUTION_TIME_ACTION>
    EffectController():ShuffleLibrary()
</RESOLUTION_TIME_ACTION>
But it seems this only Suffled my Library and not the Graveyard into the library. I looked around to find similar code like Quest for Ancient Secrets with no success.

I presume I must use
ZONE_GRAVEYARD
Somewhere but has no clue where to start.

Anyone?

Thanks

Re: How to code Feldon's Cane

PostPosted: 03 Oct 2012, 23:22
by RiiakShiNal
You can move the cards in the graveyard to the library with:
Code: Select all
EffectController():MoveLocalZone( ZONE_GRAVEYARD, ZONE_LIBRARY )
Note: This does not shuffle the graveyard into the library so you still need to shuffle.

Re: How to code Feldon's Cane

PostPosted: 04 Oct 2012, 01:53
by Marcel Costa
Great, it worked! Thanks

Now I am trying to propperly remove it from the game after use and as far as I could dig here I couldn't find how to do it.
Here is what I have\tried:

Code: Select all
<COST type="TapSelf" />
<COST type="SacrificeSelf" />   
<RESOLUTION_TIME_ACTION>
      EffectController():MoveLocalZone( ZONE_GRAVEYARD, ZONE_LIBRARY )
      EffectController():ShuffleLibrary()
</RESOLUTION_TIME_ACTION>
I believe that I could use an
Code: Select all
IF PutInGraveyard()THEN RemoveFromGame()
But I couldn't find what is the propper sintax for it.
Anyone knows?

Re: How to code Feldon's Cane

PostPosted: 04 Oct 2012, 10:11
by thefiremind
Feldon's Cane is a bit strange because it is exiled as part of the cost...
I'm not sure if it works (probably not) but try substituting "SacrificeSelf" with "Remove_from_gameSelf". If that doesn't work, remove the whole "SacrificeSelf" cost block and add this:
Code: Select all
<PLAY_TIME_ACTION>
Object():RemoveFromGame()
</PLAY_TIME_ACTION>

Re: How to code Feldon's Cane

PostPosted: 04 Oct 2012, 15:56
by Marcel Costa
CODE: SELECT ALL
<PLAY_TIME_ACTION>
Object():RemoveFromGame()
</PLAY_TIME_ACTION>
Worked like a charm. I was using the effects controller between <RESOLUTION_TIME_ACTION> tags instead <PLAY_TIME_ACTION>. I simply added Object():RemoveFromGame() and it worked perfect as well. The final code is as shown:

Code: Select all
<COST type="TapSelf" />   
<RESOLUTION_TIME_ACTION>
      EffectController():MoveLocalZone( ZONE_GRAVEYARD, ZONE_LIBRARY )
      EffectController():ShuffleLibrary()
      Object():RemoveFromGame()
</RESOLUTION_TIME_ACTION>
Now I am having a hard time assigning propperly the TDX to the card. I followed the instructions about Paint.NET and the TDX Plugin and had a very nice Cane's image from that but when I put it into the \ART_ASSETS\ILLUSTRATIONS the ingame card frame glows white so hard that one cannot read it. Besides the card picture place keeps black.
What could be this effect? Any suggestions on how to fix it?

Re: How to code Feldon's Cane

PostPosted: 04 Oct 2012, 16:41
by RiiakShiNal
Marcel Costa wrote:Now I am having a hard time assigning propperly the TDX to the card. I followed the instructions about Paint.NET and the TDX Plugin and had a very nice Cane's image from that but when I put it into the \ART_ASSETS\ILLUSTRATIONS the ingame card frame glows white so hard that one cannot read it. Besides the card picture place keeps black.
What could be this effect? Any suggestions on how to fix it?
It has been suggested that the overly white glow is due to uncompressed TDX files and that compressing them with DXT1 (for card pictures, or DXT5 for pictures with transparency) will fix that problem.

Re: How to code Feldon's Cane

PostPosted: 04 Oct 2012, 16:50
by thefiremind
Marcel Costa wrote:I simply added Object():RemoveFromGame() and it worked perfect as well.
Yes but rule-wise it's not correct: exiling the artifact as a cost means that nobody should be able to respond to it, so you should exile it in a PLAY_TIME_ACTION, that activates before resolution. It would matter if you had an ability that allowed you to return an artifact to your hand because you could play it again and activate it again.

Re: How to code Feldon's Cane

PostPosted: 04 Oct 2012, 17:04
by RiiakShiNal
thefiremind wrote:Yes but rule-wise it's not correct: exiling the artifact as a cost means that nobody should be able to respond to it, so you should exile it in a PLAY_TIME_ACTION, that activates before resolution. It would matter if you had an ability that allowed you to return an artifact to your hand because you could play it again and activate it again.
Or if there was an ability that could counter an activated ability (I know they exist in the card game, but I'm not sure if we can make them work in DotP 2013 at the moment).

Re: How to code Feldon's Cane

PostPosted: 05 Oct 2012, 06:59
by Marcel Costa
thefiremind wrote:Yes but rule-wise it's not correct: exiling the artifact as a cost means that nobody should be able to respond to it, so you should exile it in a PLAY_TIME_ACTION, that activates before resolution. It would matter if you had an ability that allowed you to return an artifact to your hand because you could play it again and activate it again.
Thanks. I returned the play_time_action tag. Also used the DTX1 to compress the images (I used DTX5 before) and now the glow is gone but the card picture is black. I checked the folder and it is there in the ILUSTRATIONS directory WADEdit created for the deck. I also checked the artID (that by the way I have no clue if there is a pattern/rule I should follow so I added a random number for it). I looked for an Art tutorial for 2013 I have passed by somewhere here but couldn't find it again. Maybe there is some detail I am missing. Any ideas are welcome.

Re: How to code Feldon's Cane

PostPosted: 05 Oct 2012, 08:41
by thefiremind
If the card picture is black with gray noise like an untuned TV-set, then it means that the picture is missing (because that's the placeholder image for missing pictures). If it's totally black, then it must be another problem.
The most important thing: are your card picture's height and width multiples of 4? The game can read compressed pictures only if you follow that rule (you used DXT5 before so I think you already followed the rule, but checking won't hurt). If this doesn't solve the problem, maybe a compression option should be set differently. I don't use Paint.NET for card pictures: I use Gibbed Tools in order to obtain an uncompressed TDX file, then I compress it with this tool by Eglin. See if it helps.

Re: How to code Feldon's Cane

PostPosted: 05 Oct 2012, 14:36
by pcastellazzi
If we would like to be stric about the rules, exiling is part of the cost, it should be implemented like:

Code: Select all
<COST type="Generic">
 <RESOLUTION_TIME_ACTION>
 Object():RemoveFromGame()

 -- this also may work
 -- Object():SetResolutionZone(ZONE_REMOVED_FROM_GAME)
 </RESOLUTION_TIME_ACTION>
</COST>
About the art id, the game use some kind of numbering scheme, some other modders use a custom multiverse id for both, the image and the card. Personally i prefer to use CARDNAME_MULTIVERSEID pattern for both. I find it easy to follow and to search for stuff when things go wrong.

Speaking about library shiffling. Some cards like Red Sun's Zenith use Object():SetResolutionZone(ZONE_LIBRARY). Does this shuffle the library? My guess is it does not. Which make this particular card bugged.

Re: How to code Feldon's Cane

PostPosted: 06 Oct 2012, 13:58
by BlindWillow
Marcel Costa wrote:I looked for an Art tutorial for 2013 I have passed by somewhere here but couldn't find it again. Maybe there is some detail I am missing. Any ideas are welcome.
This tutorial is for 2012, but it should still apply to 2013. I think it addresses the problem you are having.

(If you need a hex editor, I use Frhed.)

Re: How to code Feldon's Cane

PostPosted: 12 Oct 2012, 00:50
by Marcel Costa
I finally got the art working. I used Gibbed Tools to compress a downloaded JPG into TDX and it worked perfectly. I will add the Gibbed pack here to help others to do the same. Much easier than the Paint.Net for me at least.
Thanks for the help. Now I will move onto Dual Lands. Or to a real challenge like Deflection. :D

Re: How to code Feldon's Cane

PostPosted: 12 Nov 2012, 01:02
by thefiremind
I just want to report that, even if it seems weird to write, "Remove_from_gameSelf" is a perfectly legal cost and works as intended. Costs that act on the card itself are probably checked as a composition of [kind of cost]+[Self], so any kind of cost is OK.