Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
New MTG Cards and Decks
2013
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
New MTG Cards and Decks
2013
How to code Feldon's Cane
Moderators: Xander9009, CCGHQ Admins
How to code Feldon's Cane
by 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
I presume I must use
ZONE_GRAVEYARD
Somewhere but has no clue where to start.
Anyone?
Thanks
I was trying to code Feldon's Cane using
- Code: Select all
<RESOLUTION_TIME_ACTION>
EffectController():ShuffleLibrary()
</RESOLUTION_TIME_ACTION>
I presume I must use
ZONE_GRAVEYARD
Somewhere but has no clue where to start.
Anyone?
Thanks
-

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
by 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 )
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- 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
by 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:
Anyone knows?
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>
- Code: Select all
IF PutInGraveyard()THEN RemoveFromGame()
Anyone knows?
-

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
by 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:
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...
Currently busy with life...
-

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
by Marcel Costa » 04 Oct 2012, 15:56
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
<PLAY_TIME_ACTION>
Object():RemoveFromGame()
</PLAY_TIME_ACTION>
- Code: Select all
<COST type="TapSelf" />
<RESOLUTION_TIME_ACTION>
EffectController():MoveLocalZone( ZONE_GRAVEYARD, ZONE_LIBRARY )
EffectController():ShuffleLibrary()
Object():RemoveFromGame()
</RESOLUTION_TIME_ACTION>
What could be this effect? Any suggestions on how to fix it?
-

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
by RiiakShiNal » 04 Oct 2012, 16:41
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.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?
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- 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
by thefiremind » 04 Oct 2012, 16:50
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.Marcel Costa wrote:I simply added Object():RemoveFromGame() and it worked perfect as well.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-

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
by RiiakShiNal » 04 Oct 2012, 17:04
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).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.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- 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
by Marcel Costa » 05 Oct 2012, 06:59
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.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.
-

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
by 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.
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...
Currently busy with life...
-

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
by 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:
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.
- 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>
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.
— Ben Kuchera, Mordern Warfare 3 review.
-

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
by BlindWillow » 06 Oct 2012, 13:58
This tutorial is for 2012, but it should still apply to 2013. I think it addresses the problem you are having.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.
(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
by 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.
Thanks for the help. Now I will move onto Dual Lands. Or to a real challenge like Deflection.
- Attachments
-
duels-r6_b5.zip- Gibbed Tools
- (152.67 KiB) Downloaded 168 times
-

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
by 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...
Currently busy with life...
-

thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 719 times
14 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests
