It is currently 07 Jul 2021, 07:22
   
Text Size

How to code Feldon's Cane

Moderators: Xander9009, CCGHQ Admins

How to code Feldon's Cane

Postby Marcel Costa » 03 Oct 2012, 22:29

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
User avatar
Marcel Costa
 
Posts: 33
Joined: 31 Jul 2011, 18:08
Has thanked: 12 times
Been thanked: 0 time

Re: How to code Feldon's Cane

Postby RiiakShiNal » 03 Oct 2012, 23:22

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.
RiiakShiNal
Programmer
 
Posts: 2160
Joined: 16 May 2011, 21:37
Has thanked: 74 times
Been thanked: 483 times

Re: How to code Feldon's Cane

Postby Marcel Costa » 04 Oct 2012, 01:53

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?
User avatar
Marcel Costa
 
Posts: 33
Joined: 31 Jul 2011, 18:08
Has thanked: 12 times
Been thanked: 0 time

Re: How to code Feldon's Cane

Postby thefiremind » 04 Oct 2012, 10:11

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>
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 719 times

Re: How to code Feldon's Cane

Postby Marcel Costa » 04 Oct 2012, 15:56

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?
User avatar
Marcel Costa
 
Posts: 33
Joined: 31 Jul 2011, 18:08
Has thanked: 12 times
Been thanked: 0 time

Re: How to code Feldon's Cane

Postby RiiakShiNal » 04 Oct 2012, 16:41

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.
RiiakShiNal
Programmer
 
Posts: 2160
Joined: 16 May 2011, 21:37
Has thanked: 74 times
Been thanked: 483 times

Re: How to code Feldon's Cane

Postby thefiremind » 04 Oct 2012, 16:50

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.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 719 times

Re: How to code Feldon's Cane

Postby RiiakShiNal » 04 Oct 2012, 17:04

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).
RiiakShiNal
Programmer
 
Posts: 2160
Joined: 16 May 2011, 21:37
Has thanked: 74 times
Been thanked: 483 times

Re: How to code Feldon's Cane

Postby Marcel Costa » 05 Oct 2012, 06:59

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.
User avatar
Marcel Costa
 
Posts: 33
Joined: 31 Jul 2011, 18:08
Has thanked: 12 times
Been thanked: 0 time

Re: How to code Feldon's Cane

Postby thefiremind » 05 Oct 2012, 08:41

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.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 719 times

Re: How to code Feldon's Cane

Postby pcastellazzi » 05 Oct 2012, 14:36

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.
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
User avatar
pcastellazzi
 
Posts: 184
Joined: 25 Apr 2012, 00:40
Location: Montevideo, Uruguay
Has thanked: 11 times
Been thanked: 30 times

Re: How to code Feldon's Cane

Postby BlindWillow » 06 Oct 2012, 13:58

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.)
BlindWillow
 
Posts: 213
Joined: 19 Jul 2012, 00:26
Has thanked: 11 times
Been thanked: 46 times

Re: How to code Feldon's Cane

Postby Marcel Costa » 12 Oct 2012, 00:50

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
Attachments
duels-r6_b5.zip
Gibbed Tools
(152.67 KiB) Downloaded 168 times
User avatar
Marcel Costa
 
Posts: 33
Joined: 31 Jul 2011, 18:08
Has thanked: 12 times
Been thanked: 0 time

Re: How to code Feldon's Cane

Postby thefiremind » 12 Nov 2012, 01:02

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.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 719 times


Return to 2013

Who is online

Users browsing this forum: No registered users and 2 guests


Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 10 minutes)
Most users ever online was 1922 on 07 Jun 2021, 06:01

Users browsing this forum: No registered users and 2 guests

Login Form