It is currently 25 Apr 2024, 00:52
   
Text Size

Duels of the Planeswalkers 2013

New decks and cards for Stainless Games' release

Moderator: CCGHQ Admins

Re: Duels of the Planeswalkers 2013

Postby thefiremind » 21 Jul 2012, 09:32

sumomole wrote:Is there any way to cancel a delayed Trigger?
Good question, I really don't know. I don't even know if a delayed trigger can have 2 CLEANUP blocks so that the first to "resolve" removes it. What I usually try to do (but it's not always possible) is to force the delayed trigger to happen, but check inside it if it's still good to let it happen.
< 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: 721 times

Re: Duels of the Planeswalkers 2013

Postby sumomole » 21 Jul 2012, 13:26

thefiremind wrote:Good question, I really don't know. I don't even know if a delayed trigger can have 2 CLEANUP blocks so that the first to "resolve" removes it. What I usually try to do (but it's not always possible) is to force the delayed trigger to happen, but check inside it if it's still good to let it happen.
Yes, I use two CLEANUP on delayed trigger of Esper Battlemage, fire_once="1" and simple_cleanup="EndOfTurn", it works properly, but I want to cancel the delay trigger when a creature leaves battlefield or other conditions, I don't know if there are statements can be use to CLEANUP.
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: Duels of the Planeswalkers 2013

Postby thefiremind » 21 Jul 2012, 13:57

I don't know either, but you could be the first to experiment... :wink: try something like DURATION and see if it works:
Code: Select all
<CLEANUP>
return EffectDC():GetCardPtr(0):GetZone() ~= ZONE_IN_PLAY
</CLEANUP>
< 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: 721 times

Re: Duels of the Planeswalkers 2013

Postby sumomole » 21 Jul 2012, 17:46

thefiremind wrote:I don't know either, but you could be the first to experiment... :wink: try something like DURATION and see if it works:
Code: Select all
<CLEANUP>
return EffectDC():GetCardPtr(0):GetZone() ~= ZONE_IN_PLAY
</CLEANUP>
Have tried this way when I make Esper Battlemage, I hope to put together two CLEANUP, but it seems to have a problem. I will try again with your code.
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: Duels of the Planeswalkers 2013

Postby sumomole » 22 Jul 2012, 03:45

I know the difference between GetObjectX() and GetEffectX(), If a spell has cost {X} also has a ability that cost {X} too, GetObjectX() denotes spell costs only, and GetEffectX() denotes the cost of ability only, If you used GetObjectX() in ability, It's no effect whether the {X} in ability is equal to any number.

I can not pay {X} for a conditional mana cost of trigger ability in D13, but D12 can, for example Flameblast Dragon.

Code: Select all
   <TRIGGERED_ABILITY LKI_shield_effect_source="1" dangerous="1" filter_zone="ZONE_IN_PLAY">
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Flameblast Dragon attacks, you may pay {X}{R}. If you do, Flameblast Dragon deals X damage to target creature or player.]]></LOCALISED_TEXT>
      <TRIGGER value="ATTACKING" simple_qualifier="self" />
      <COST type="Mana" cost="{X}{R}" qualifier="Conditional" />
      <TARGET_DEFINITION id="0">
         local filter = Object():GetFilter()
         filter:Clear()
         filter:SetFilterType( FILTER_TYPE_CARDS + FILTER_TYPE_PLAYERS )
         filter:AddCardType( CARD_TYPE_CREATURE )
         filter:SetZone( ZONE_IN_PLAY )
         filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
      </TARGET_DEFINITION>
      <TARGET_DETERMINATION>
         return AtLeastOneTargetFromDefinition(0)
      </TARGET_DETERMINATION>
      <PLAY_TIME_ACTION target_choosing="1">
         EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_DEAL_X_DAMAGE", EffectDC():Make_Targets(0) )
      </PLAY_TIME_ACTION>
      <RESOLUTION_TIME_ACTION conditional="if">
         local Xvalue = GetEffectX()
         local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
         local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
         if ( target_player ~= nil ) then
            target_player:DealDamage(Xvalue, Object())
         elseif ( target_creature ~= nil ) then
            target_creature:DealDamage(Xvalue, Object())
         end
      </RESOLUTION_TIME_ACTION>
   </TRIGGERED_ABILITY>
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: Duels of the Planeswalkers 2013

Postby thefiremind » 27 Jul 2012, 21:14

I just noticed an annoying flaw that DotP2012 didn't have: if I give the commaspace tag to an ability, it will always be placed together with the first text of the card, no matter what the ability order is. So, for example, if I write the abilities for Maelstrom Wanderer as anyone would do, I obtain this:
Creatures you control have haste., cascade

Cascade
< 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: 721 times

Re: Duels of the Planeswalkers 2013

Postby sumomole » 28 Jul 2012, 08:00

thefiremind wrote:I just noticed an annoying flaw that DotP2012 didn't have: if I give the commaspace tag to an ability, it will always be placed together with the first text of the card, no matter what the ability order is. So, for example, if I write the abilities for Maelstrom Wanderer as anyone would do, I obtain this:
Creatures you control have haste., cascade

Cascade
Yes, EMRAKUL as well.
But you can write two Cascade in one ability.
Like this.
1.JPG
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: Duels of the Planeswalkers 2013

Postby thefiremind » 28 Jul 2012, 09:23

Yes, in fact I did it like that. My worry was that I wouldn't see the name of the ability that prompts me to do something in the lower right corner when the ability with no text starts, but I saw that cascade just writes the query in the lower right corner, no matter what the ability text is. So, problem solved. :wink:
< 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: 721 times

Re: Duels of the Planeswalkers 2013

Postby RiiakShiNal » 29 Jul 2012, 15:39

Interestingly enough {2/U} actually works as a mana cost, but it does not display a symbol. Also it seems to only use {U} if it is available otherwise it will use {2} (so it tries to use the minimum possible mana for it) regardless of whether you hit the mana tapping button.

I have tried adding a symbol texture using both of the names MANA_2U.TDX and MANA_U2.TDX and neither worked. I also have not yet been able to find any config file that defines which texture to use for which symbol.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Duels of the Planeswalkers 2013

Postby thefiremind » 29 Jul 2012, 15:44

RiiakShiNal wrote:I also have not yet been able to find any config file that defines which texture to use for which symbol.
There are lots of files that we can't access... the LUBE directory in the core WAD is full of LOL files, but many of them make luadec crash when it tries to decrypt them, and even those that can be decrypted generate lots of decrypting errors and can't be understood anyway when read.
< 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: 721 times

Re: Duels of the Planeswalkers 2013

Postby RiiakShiNal » 29 Jul 2012, 16:31

While it is true that we can't decompile them we can disassemble them and in doing so I managed to glean some information about why the number of locked cards is wrong in the deck manager for our custom decks. There is a condition in the "LUBE\SKIND12\MENUS\DECK_MANAGER\MAIN.LOL" where if GetDeckLockedSize() <= 10 jump to another point. This got me thinking "Why would it need to do that?" so I looked at the unlocks and found that all the Promo unlocks are 10 cards exactly. So if we add a Promo unlock for our decks (we could fill it with virtually any card, like basic lands) with 10 cards then the number of locked cards starts displaying correctly (correct number of cards) in the deck manager and "Unlock full deck" will show up even if there are 10 or fewer cards to unlock (not counting promo unlocks).
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Duels of the Planeswalkers 2013

Postby thefiremind » 29 Jul 2012, 18:12

That's a nice finding! I really wish we could see more inside that file, I guess it also contains the function that shows the basic lands of the decks and is responsible for the visual bug with more than 2 colors.
< 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: 721 times

Re: Duels of the Planeswalkers 2013

Postby RiiakShiNal » 29 Jul 2012, 18:48

thefiremind wrote:That's a nice finding! I really wish we could see more inside that file, I guess it also contains the function that shows the basic lands of the decks and is responsible for the visual bug with more than 2 colors.
Probably, though going through the disassembly is more time consuming than going through standard LUA code and even if we could figure out what is causing the problem we still may not be able to fix it because that would entail re-writing the entire file (though hopefully it would accept plain text like we use for our functions) and fixing the bug.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Duels of the Planeswalkers 2013

Postby thefiremind » 29 Jul 2012, 20:54

On a totally unrelated note: I spent too much time looking for the reason why a deck I just made was crashing the game when ending a duel... just to discover that I forgot a TOKEN_REGISTRATION. We get 2 lessons from this:
1) If your deck crashes the game when ending a duel, first thing to check is a lack of TOKEN_REGISTRATION when needed.
2) If someone ever wondered what's the purpose of the TOKEN_REGISTRATION, well here it is: it prevents the game from crashing (I guess it acts as a sort of reminder for the game to clean up the memory used for the tokens, or something like that).
< 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: 721 times

Re: Duels of the Planeswalkers 2013

Postby RiiakShiNal » 29 Jul 2012, 21:13

Though we've also found that having too many tokens in play can also crash the game (though crashes may appear randomly later in play and not immediately). More detailed information in this topic: Problem with Rhys the Redeemed (Crashing)
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

PreviousNext

Return to Magic: The Gathering - Duels of the Planeswalkers

Who is online

Users browsing this forum: No registered users and 21 guests


Who is online

In total there are 21 users online :: 0 registered, 0 hidden and 21 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 21 guests

Login Form