It is currently 03 Aug 2025, 00:49
   
Text Size

First DotP2014 modding problems

Moderator: CCGHQ Admins

First DotP2014 modding problems

Postby thefiremind » 27 Jun 2013, 10:16

The first card I tried to code in DotP2014 is Haakon, Stromgald Scourge. His first ability works great this way:
Code: Select all
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[You may cast Haakon, Stromgald Scourge from your graveyard, but not from anywhere else.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vous pouvez jouer Haakon, plaie de Stromgald depuis votre cimetière, mais pas depuis une autre zone.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Puedes jugar a Haakon, azote de Stromgald desde tu cementerio, pero desde ningún otro sitio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Du kannst Haakon, Geißel von Stromgald, nur aus deinem Friedhof spielen, nicht von woanders.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Puoi lanciare Haakon, Flagello di Stromgald dal tuo cimitero, ma non da qualsiasi altra zona.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたはあなたの墓地からストロームガルドの災い魔、ハーコンをプレイしてもよいが、それ以外からはプレイできない。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[You may cast Haakon, Stromgald Scourge from your graveyard, but not from anywhere else.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Вы можете разыгрывать Хакона, Бича Стромгальда, только со своего кладбища и больше ниоткуда.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Você pode jogar Haakon, Flagelo de Stromgald, de seu cemitério, mas de nenhum outro lugar.]]></LOCALISED_TEXT>
    <AVAILABILITY>
    return Object():GetZone() == ZONE_GRAVEYARD
    </AVAILABILITY>
  </SPELL_ABILITY>
  <UTILITY_ABILITY qualifier="Normal_Cast" active_zone="ZONE_GRAVEYARD">
    <AVAILABILITY>
    return Object():GetOwner() == EffectController()
    </AVAILABILITY>
  </UTILITY_ABILITY>
but I can't seem to get the second ability working. Knights in my graveyard glow when I can cast them, but when I try to cast them, nothing happens. This is the code:
Code: Select all
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As long as Haakon is on the battlefield, you may play Knight cards from your graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Tant que Haakon est en jeu, vous pouvez jouer des cartes de chevalier depuis votre cimetière.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Mientras Haakon esté en juego, puedes jugar cartas de Caballero desde tu cementerio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[So lange Haakon im Spiel ist, kannst du Ritterkarten aus deinem Friedhof spielen.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Fintanto che Haakon è sul campo di battaglia, puoi lanciare carte Cavaliere dal tuo cimitero.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[ストロームガルドの災い魔、ハーコンが場に出ているかぎり、あなたはあなたの墓地から騎士カードをプレイしてもよい。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[As long as Haakon is on the battlefield, you may play Knight cards from your graveyard.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Пока Хакон находится в игре, вы можете разыгрывать карты Рыцарей со своего кладбища.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Enquanto Haakon estiver em jogo, você poderá jogar cards de Cavaleiro de seu cemitério.]]></LOCALISED_TEXT>
    <FILTER filter_id="0">
    local filter = ClearFilter()
    filter:SetZone( ZONE_GRAVEYARD, EffectController() )
    filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_KNIGHT )
    </FILTER>
    <FILTER filter_id="1">
    local filter = ClearFilter()
    filter:SetZone( ZONE_STACK )
    filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_KNIGHT )
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    </FILTER>
    <CONTINUOUS_ACTION layer="8" filter_id="0">
    if FilteredCard() ~= nil then
       FilteredCard():GetCurrentCharacteristics():GrantAbility(0)
    end
    </CONTINUOUS_ACTION>
    <CONTINUOUS_ACTION layer="8" filter_id="1">
    if FilteredCard() ~= nil then
       FilteredCard():GetCurrentCharacteristics():GrantAbility(0)
    end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <UTILITY_ABILITY resource_id="0" qualifier="Normal_Cast" active_zone="ZONE_ANY">
    <AVAILABILITY>
    return true --Object():GetOwner() == EffectController()
    </AVAILABILITY>
  </UTILITY_ABILITY>
I tried to grant the ability on the stack as well, as Omniscience does, but it's been the same. I commented out the availability of the cast, but that's not the problem. Any ideas?
Last edited by thefiremind on 29 Jun 2013, 20:27, edited 1 time in total.
< 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: 722 times

Re: First DotP2014 modding problem: Haakon

Postby sumomole » 27 Jun 2013, 15:50

I code will, It seems to work fine.
Yawgmoth's Will | Open
Code: Select all
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Until end of turn, you may play cards in your graveyard as though they were in your hand. Cards put into your graveyard this turn are removed from the game instead.]]></LOCALISED_TEXT>
    <SFX text="GLOBAL_TIDE_PLAY" />
    <CONTINUOUS_ACTION layer="8">
    local filter = ClearFilter()
    filter:SetZone( ZONE_GRAVEYARD, EffectController() )
    local numCards = filter:EvaluateObjects()
    for i=0,(numCards-1) do
       local card = filter:GetNthEvaluatedObject(i)
       if card ~= nil then
         local characteristics = card:GetCurrentCharacteristics()
         characteristics:GrantAbility(1)
       end
    end
    </CONTINUOUS_ACTION>
    <DURATION simple_duration="UntilEOT" />
    <RESOLUTION_TIME_ACTION>
    MTG():CreateDelayedTrigger(2, nil)
    </RESOLUTION_TIME_ACTION>
  </SPELL_ABILITY>
  <UTILITY_ABILITY resource_id="1" qualifier="Normal_Cast" active_zone="ZONE_GRAVEYARD">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[You may cast this card from your graveyard.]]></LOCALISED_TEXT>
  </UTILITY_ABILITY>
  <TRIGGERED_ABILITY resource_id="2" replacement_effect="1">
    <CLEANUP simple_cleanup="EndOfTurn" />
    <TRIGGER value="ZONECHANGE_CONSIDERED" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_ANY" pre_trigger="1">
    if TriggerObject():GetOwner() == EffectController() then
       MTG():OverrideEvent()
       TriggerObject():Exile()
       return true
    end
    return false
    </TRIGGER>
  </TRIGGERED_ABILITY>
And I try to Haakon, Stromgald Scourge, it work too. I guess you just miss the localised text of the GrantAbility.
Haakon, Stromgald Scourge | Open
Code: Select all
  <SPELL_ABILITY>
    <AVAILABILITY>
    if Object():GetZone() == ZONE_GRAVEYARD and Object():GetOwner() == EffectController() then
       return true
    end
    return false
    </AVAILABILITY>
  </SPELL_ABILITY>
  <UTILITY_ABILITY qualifier="Normal_Cast" active_zone="ZONE_GRAVEYARD">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[You may cast Haakon, Stromgald Scourge from your graveyard, but not from anywhere else.]]></LOCALISED_TEXT>
  </UTILITY_ABILITY>
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As long as Haakon is on the battlefield, you may play Knight cards from your graveyard.]]></LOCALISED_TEXT>
    <FILTER filter_id="0">
    local filter = ClearFilter()
    filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_KNIGHT )
    filter:SetZone( ZONE_GRAVEYARD, EffectController() )
    </FILTER>
    <CONTINUOUS_ACTION layer="8" filter_id="0">
    if FilteredCard() ~= nil then
      local characteristics = FilteredCard():GetCurrentCharacteristics()
      characteristics:GrantAbility(1)
    end
    </CONTINUOUS_ACTION>
    <DURATION>
    return (EffectSource() == nil)
    </DURATION>
  </STATIC_ABILITY>
  <UTILITY_ABILITY resource_id="1" qualifier="Normal_Cast" active_zone="ZONE_GRAVEYARD">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[You may cast this card from your graveyard.]]></LOCALISED_TEXT>
  </UTILITY_ABILITY>
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Haakon dies, you lose 2 life.]]></LOCALISED_TEXT>
    <TRIGGER value="ZONECHANGE_BEGIN" simple_qualifier="self" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_BATTLEFIELD" />
    <RESOLUTION_TIME_ACTION>
    EffectController():LoseLife( 2 )
    </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: First DotP2014 modding problem: Haakon

Postby thefiremind » 28 Jun 2013, 09:24

You are right, it needs an ability text to click on... which is quite counter-intuitive for someone who clicked on the whole card with no constraints in order to cast cards with flashback in DotP2013. :P Anyway, all's well what ends well. A W/B Knight deck with Haakon will be in my DotP2014 mod. :D
< 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: 722 times

Re: First DotP2014 modding problems

Postby thefiremind » 29 Jun 2013, 20:30

I'll re-use this topic for the next problem (and sorry for double posting). I'm coding Knight of the Holy Nimbus and his activated ability seems to be fine with
Code: Select all
    <AVAILABILITY any_player="1">
    return EffectController():GetTeam() ~= Object():GetController():GetTeam()
    </AVAILABILITY>
but the problem is in his regeneration ability. Mossbridge Troll, which is an official card, has the exact same ability, so I copied it from there, but when the Knight gets beaten in battle he doesn't regenerate at all... is there a bug in Mossbridge Troll or I'm missing something again?
Code: Select all
  <TRIGGERED_ABILITY replacement_effect="1">
    -- localised text omitted
    <TRIGGER value="DESTROYED" simple_qualifier="self" pre_trigger="1" />
    <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
       EffectSource():GiveRegeneration()
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
EDIT: I tried to Murder the Knight, but the trigger still doesn't do anything, so it's not related to destruction by combat damage.
< 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: 722 times

Re: First DotP2014 modding problems

Postby gorem2k » 29 Jun 2013, 21:42

thefiremind wrote: is there a bug in Mossbridge Troll or I'm missing something again?
I can confirm Mossbridge Troll (part of a challenge) has a bug. I did a test : casted Shadowborn Demon while Moss was in play, Moss went to graveyard. DESTROYED value trigger is not working!
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: First DotP2014 modding problems

Postby thefiremind » 29 Jun 2013, 22:08

gorem2k wrote:I can confirm Mossbridge Troll (part of a challenge) has a bug. I did a test : casted Shadowborn Demon while Moss was in play, Moss went to graveyard. DESTROYED value trigger is not working!
This is really bad! I can always live with a non-working BECAME_TAPPED_FOR_MANA trigger, but a non-working DESTROYED ruins my plans! :(
< 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: 722 times

Re: First DotP2014 modding problems

Postby gorem2k » 29 Jun 2013, 22:27

thefiremind wrote:
gorem2k wrote:I can confirm Mossbridge Troll (part of a challenge) has a bug. I did a test : casted Shadowborn Demon while Moss was in play, Moss went to graveyard. DESTROYED value trigger is not working!
This is really bad! I can always live with a non-working BECAME_TAPPED_FOR_MANA trigger, but a non-working DESTROYED ruins my plans! :(
Unfortunately, there are no "totem armor" cards for D14 to help. sad indeed. I guess we will have to wait for DLC expansions for further how-to and possibilities.
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: First DotP2014 modding problems

Postby sumomole » 29 Jun 2013, 23:04

gorem2k wrote:
thefiremind wrote:
gorem2k wrote:I can confirm Mossbridge Troll (part of a challenge) has a bug. I did a test : casted Shadowborn Demon while Moss was in play, Moss went to graveyard. DESTROYED value trigger is not working!
This is really bad! I can always live with a non-working BECAME_TAPPED_FOR_MANA trigger, but a non-working DESTROYED ruins my plans! :(
Unfortunately, there are no "totem armor" cards for D14 to help. sad indeed. I guess we will have to wait for DLC expansions for further how-to and possibilities.
Totem armor is instead effect, but Mossbridge Troll isn't. TRIGGER_DESTROYED is work fine, there just has a little problem. you can use the following code. :lol:
Code: Select all
  <TRIGGERED_ABILITY replacement_effect="1">
    <TRIGGER value="DESTROYED" simple_qualifier="self" pre_trigger="1">
    EffectSource():GiveRegeneration()
    return true
    </TRIGGER>
  </TRIGGERED_ABILITY>
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: First DotP2014 modding problems

Postby gorem2k » 29 Jun 2013, 23:38

sumomole wrote:
Code: Select all
  <TRIGGERED_ABILITY replacement_effect="1">
    <TRIGGER value="DESTROYED" simple_qualifier="self" pre_trigger="1">
    EffectSource():GiveRegeneration()
    return true
    </TRIGGER>
  </TRIGGERED_ABILITY>
How did you? do you work for them? :!: :?:

I was just about to say that trigger was working but EffectSource():GiveRegeneration() inside <RESOLUTION> didn't. I tried changing it to: EffectController():DrawCard() and it resolved... strange
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: First DotP2014 modding problems

Postby thefiremind » 29 Jun 2013, 23:43

sumomole wrote:TRIGGER_DESTROYED is work fine, there just has a little problem. you can use the following code. :lol:
Code: Select all
  <TRIGGERED_ABILITY replacement_effect="1">
    <TRIGGER value="DESTROYED" simple_qualifier="self" pre_trigger="1">
    EffectSource():GiveRegeneration()
    return true
    </TRIGGER>
  </TRIGGERED_ABILITY>
It's nice to know that the trigger works, but with your code the Knight doesn't die even if I activate the ability that prevents regeneration. :lol: It seems that pre-triggers without actions implicitly override the event as in DotP2013, so I tried with "return false" but it doesn't work at all with that. Can we find a way to give regeneration before the creature gets destroyed but without overriding the destruction?

gorem2k wrote:I was just about to say that trigger was working but EffectSource():GiveRegeneration() inside <RESOLUTION> didn't. I tried changing it to: EffectController():DrawCard() and it resolved... strange
This is because the regeneration probably comes too late to save the creature when inside resolution, but you can draw a card even if the creature is already in the graveyard.

EDIT: I found the solution! I tested it only with Murder, but I think it's enough.
Code: Select all
    <TRIGGER value="DESTROYED" simple_qualifier="self" pre_trigger="1">
    if EffectSource() ~= nil then
       EffectSource():GiveRegeneration()
       EffectSource():Destroy()
    end
    return true
    </TRIGGER>
A trigger condition can't trigger itself, so while the trigger overrides the original destruction, the destruction made here happens, and you see the creature tapping because it correctly regenerates. If you activate the ability, the Knight gets destroyed, exactly as expected.
The only downside is that the AI doesn't seem to understand how the Knight works. When I used Murder on my own Knight, the AI had 2 mana available to spend, but didn't shut down the regeneration.
Last edited by thefiremind on 29 Jun 2013, 23:57, edited 1 time in total.
< 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: 722 times

Re: First DotP2014 modding problems

Postby sumomole » 29 Jun 2013, 23:56

thefiremind wrote:but with your code the Knight doesn't die even if I activate the ability that prevents regeneration.
How do you prevent regeneration? :shock:
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: First DotP2014 modding problems

Postby thefiremind » 29 Jun 2013, 23:58

sumomole wrote:
thefiremind wrote:but with your code the Knight doesn't die even if I activate the ability that prevents regeneration.
How do you prevent regeneration? :shock:
Code: Select all
  <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{2}: Knight of the Holy Nimbus can’t be regenerated this turn. Only any opponent may activate this ability.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{2} : Le Chevalier du Halo sacré ne peut pas être régénéré ce tour-ci. Seul un adversaire peut jouer cette capacité.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{2}: El Caballero del nimbo sagrado no puede ser regenerado este turno. Sólo cualquier oponente puede jugar esta habilidad.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{2}: Der Ritter des Heiligenscheins kann in diesem Zug nicht regeneriert werden. Nur beliebige Gegner können diese Fähigkeit spielen.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{2}: Il Cavaliere della Sacra Aureola non può essere rigenerato in questo turno. Solo gli avversari possono attivare questa abilità.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{2}:このターン、聖なる後光の騎士は再生できない。 いずれかの対戦相手のみがこの能力をプレイできる。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{2}: Knight of the Holy Nimbus can’t be regenerated this turn. Only any opponent may activate this ability.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{2}: Рыцарь Священного Нимба не может быть регенирирован в этом ходу. Эта способность может применяться только оппонентами.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{2}: Cavaleiro do Nimbo Sagrado não pode ser regenerado neste turno. Esta habilidade só pode ser jogada pelos oponentes.]]></LOCALISED_TEXT>
    <AVAILABILITY any_player="1">
    return EffectController():GetTeam() ~= Object():GetController():GetTeam()
    </AVAILABILITY>
    <COST mana_cost="{2}" type="Mana" />
    <CONTINUOUS_ACTION layer="8">
    if EffectSource() ~= nil then
       EffectSource():GetCurrentCharacteristics():Bool_Set( CHARACTERISTIC_CANT_BE_REGENERATED, 1 )
    end
    </CONTINUOUS_ACTION>
    <DURATION simple_duration="UntilEOT" />
    <AI_AVAILABILITY window_step="declare_blockers" type="window" />
    <AI_AVAILABILITY type="in_response" response_source="1" />
    <AI_AVAILABILITY type="in_response" response_source="1" response_target="1" />
  </ACTIVATED_ABILITY>
Anyway read the edit, the problem is solved. Maybe I could improve the AI's understanding of this ability by changing the AI_AVAILABILITY blocks? I haven't understood the response_source and response_target tags completely yet.
< 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: 722 times

Re: First DotP2014 modding problems

Postby gorem2k » 30 Jun 2013, 00:01

lmfao, i'm out of this topic... brain damage :lol:

Cudgel Troll AI block if its any help..
Code: Select all
    <AI_AVAILABILITY window_step="declare_blockers" type="window" window_in_combat="1" />
    <AI_AVAILABILITY type="in_response" response_source="1" />
    <AI_AVAILABILITY type="restriction" restriction_type="no_regeneration_shield" />
    <AI_MODIFIERS combat_immunity="1" />
EDIT: thefiremind, I think AI understands your code well, he tapped 2 mana during my turn just as I played Shadowborn Demon. so I had to destroy my creature.

Image

ps: in case you're wondering how I cast a demon with Plains; I cheated its mana cost :wink:
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: First DotP2014 modding problems

Postby sumomole » 30 Jun 2013, 05:04

thefiremind wrote:
sumomole wrote:
thefiremind wrote:but with your code the Knight doesn't die even if I activate the ability that prevents regeneration.
How do you prevent regeneration? :shock:
Anyway read the edit, the problem is solved. Maybe I could improve the AI's understanding of this ability by changing the AI_AVAILABILITY blocks? I haven't understood the response_source and response_target tags completely yet.
I'm a fool, I forget it has three abilities. #-o :mrgreen: :oops:
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: First DotP2014 modding problems

Postby thefiremind » 30 Jun 2013, 08:09

I just thought that my solution still isn't perfect: I'm issuing another Destroy() event, but what if the original destruction was a DestroyWithoutRegenerate()? I would allow the Knight to regenerate to that as well, which would be wrong. Any other ideas?

EDIT: From the new tries I made, it seems that nothing can happen before the permanent gets destroyed, unless the destruction is overridden. If you want a proof, try this:
Code: Select all
  <TRIGGERED_ABILITY replacement_effect="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[If Knight of the Holy Nimbus would be destroyed, regenerate it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Si le Chevalier du Halo sacré devait être détruit, régénérez-le.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Si el Caballero del nimbo sagrado fuera a ser destruido, regenéralo.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Würde der Ritter des Heiligenscheins zerstört, regeneriere ihn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Se il Cavaliere della Sacra Aureola sta per essere distrutto, rigeneralo.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[聖なる後光の騎士が破壊される場合、それを再生する。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[If Knight of the Holy Nimbus would be destroyed, regenerate it.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Если Рыцарь Священного Нимба должен быть уничтожен, регенерируйте его.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Se Cavaleiro do Nimbo Sagrado estiver prestes a ser destruído, regenere-o.]]></LOCALISED_TEXT>
    <TRIGGER value="DESTROYED" simple_qualifier="self" pre_trigger="1">
    if EffectSource() ~= nil then
       EffectSource():GiveRegeneration()
    end
    return true
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    EffectDC():Set_Int(0, 0)
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
Adding an action (which basically does nothing) makes the trigger non-overriding, so, even if the regeneration is inside the condition, the Knight won't be regenerated before destruction. I don't know if it's just for the DESTROYED trigger, but if it isn't, then the pre-triggers in the previous DotP versions were working much more flexibly.
< 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: 722 times

Next

Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 10 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 10 users online :: 0 registered, 0 hidden and 10 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 10 guests

Login Form