It is currently 26 Apr 2024, 04:05
   
Text Size

First DotP2014 modding problems

Moderator: CCGHQ Admins

Re: First DotP2014 modding problems

Postby RiiakShiNal » 30 Jun 2013, 13:35

Have you tried overriding the event using "MTG():OverrideEvent()"?

Maybe something like this:
Code: Select all
      <TRIGGERED_ABILITY replacement_effect="1">
        <!-- Localized Text Omitted -->
        <TRIGGER value="DESTROYED" simple_qualifier="self" pre_trigger="1">
        if EffectSource() ~= nil then
           EffectSource():GiveRegeneration()
        end
        MTG():OverrideEvent()
        return true
        </TRIGGER>
        <RESOLUTION_TIME_ACTION>
        EffectDC():Set_Int(0, 0)
        </RESOLUTION_TIME_ACTION>
      </TRIGGERED_ABILITY>
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: First DotP2014 modding problems

Postby thefiremind » 30 Jun 2013, 14:07

Actually, overriding is exactly what I'd like to avoid... and that's the problem, the regeneration always comes too late when I don't override. But if I override, I can't tell whether the original destruction was a Destroy() or a DestroyWithoutRegenerate(), so I can't replicate it correctly in all scenarios.
< 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: First DotP2014 modding problems

Postby gorem2k » 30 Jun 2013, 20:34

According to last rule of Disintegrate,

"If the creature would die this turn, exile it instead."

there's this code:

Code: Select all
  <TRIGGERED_ABILITY resource_id="1" active_zone="ZONE_BATTLEFIELD">
    <CLEANUP simple_cleanup="EndOfTurn" />
    <TRIGGER value="ZONECHANGE_CONSIDERED" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_BATTLEFIELD" pre_trigger="1">
    if (TriggerObject() == EffectDC():Get_CardPtr(0)) then
       MTG():OverrideEvent()
       TriggerObject():Exile()
       return true
    end
    return false
    </TRIGGER>
  </TRIGGERED_ABILITY>
Maybe this could be modified to regenerate instead of exile?
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: First DotP2014 modding problems

Postby thefiremind » 30 Jun 2013, 20:41

But Disintegrate substitutes the "death" with the exile, while I don't want to substitute the destruction: I want it to happen, but after applying the regeneration.
< 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: First DotP2014 modding problems

Postby gorem2k » 30 Jun 2013, 20:53

thefiremind wrote:But Disintegrate substitutes the "death" with the exile, while I don't want to substitute the destruction: I want it to happen, but after applying the regeneration.
If Knight of the Holy Nimbus WOULD be destroyed... regenerate it.

would suggest it's not happening.. oh well, I'll try some things on my side.

this is just an alternate coding:

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>
    <TRIGGER value="ZONECHANGE_CONSIDERED" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_BATTLEFIELD" pre_trigger="1">
    if EffectSource() ~= nil then
       EffectSource():GiveRegeneration()
       return true
    end
    return false
    </TRIGGER>
  </TRIGGERED_ABILITY>
Flame Slash doesn't kill Knight, it becomes tapped and regenerate (without regenerate badge?). BUT disintegrate doesn't kill the Knight and gets a regenerate badge. surely because it consider only to_zone ZONE_GRAVEYARD, not the exiles.. and worst of all, EVERY creatures in play don't go to graveyards :lol: :lol: :lol:
Last edited by gorem2k on 30 Jun 2013, 22:12, edited 1 time in total.
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: First DotP2014 modding problems

Postby thefiremind » 30 Jun 2013, 22:11

gorem2k wrote:If Knight of the Holy Nimbus WOULD be destroyed... regenerate it.

would suggest it's not happening..
The wording has been chosen like that because most of the times the regeneration prevents the destruction, but the destruction must try to do its work, otherwise why regenerating? :lol:

I thought about the ZONECHANGE_CONSIDERED version, but I guessed it would have too many flaws (and you found one with Disintegrate).
< 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: First DotP2014 modding problems

Postby gorem2k » 30 Jun 2013, 22:26

thefiremind wrote:The wording has been chosen like that because most of the times the regeneration prevents the destruction, but the destruction must try to do its work, otherwise why regenerating? :lol:
This sentence is very similar to the last one on Disintegrate. if would, do something. figured it would be useful, turns out it's not.

I'm sure if more are experimenting on this, we'll get some results.
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: First DotP2014 modding problems

Postby thefiremind » 30 Jun 2013, 22:31

gorem2k wrote:This sentence is very similar to the last one on Disintegrate. if would, do something.
But Disintegrate is "if would, do something instead". :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: First DotP2014 modding problems

Postby gorem2k » 30 Jun 2013, 22:39

thefiremind wrote:
gorem2k wrote:This sentence is very similar to the last one on Disintegrate. if would, do something.
But Disintegrate is "if would, do something instead". :wink:
hence why I'm not saying it's an exact sentence. come on!!
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: First DotP2014 modding problems

Postby thefiremind » 30 Jun 2013, 22:42

gorem2k wrote:hence why I'm not saying it's an exact sentence. come on!!
I was only trying to explain where's the difference.

gorem2k wrote:I'm sure if more are experimenting on this, we'll get some results.
I really hope so. :)
< 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: First DotP2014 modding problems

Postby gorem2k » 01 Jul 2013, 00:47

thefiremind wrote: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()?
could you provide an example of said Destroy event?

I used your last code then I played a Disintegrate on the Knight and it died as expected.

which Destroy event is causing issue?

EDIT: nevermind, I tried Dark Hatchling.

EDIT2: (late?) discovery.

Code: Select all
    <TRIGGER value="DESTROYED" simple_qualifier="self" />
    <RESOLUTION_TIME_ACTION>
    if TriggerObject() ~= nil then
       EffectDC():Protect_CardPtr(COMPARTMENT_ID_PARAM_TRIGGER_OBJECT)
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    if TriggerObject() ~= nil then
       TriggerObject():PutInHand()
    end
    </RESOLUTION_TIME_ACTION>
Using PutInHand() works, but GiveRegeneration() is still too slow. and I suspect pre_trigger="1" isn't necessary for this case. not sure if first resolution_time_action is needed - just took it from Aetherplasm.

What a puzzle !

On the other hand, I could signal a bug to Stainless Games about their Mossbridge Troll dying in Challenge 7 ? didn't play any challenge yet tho :lol:
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: First DotP2014 modding problems

Postby thefiremind » 01 Jul 2013, 08:30

gorem2k wrote:could you provide an example of said Destroy event?

I used your last code then I played a Disintegrate on the Knight and it died as expected.
Disintegrate gives the CANT_BE_REGENERATED characteristic which is OK. If you want a handy example, copy the activated ability from Avatar of Woe onto the Knight. As long as that ability cannot kill the Knight himself, then it doesn't work.

gorem2k wrote:Using PutInHand() works, but GiveRegeneration() is still too slow. and I suspect pre_trigger="1" isn't necessary for this case. not sure if first resolution_time_action is needed - just took it from Aetherplasm.
Your PutInHand() example works because you are protecting the card pointer, so the card gets destroyed, goes to the graveyard, then the pointer is still valid and you can bring it back to your hand.

gorem2k wrote:On the other hand, I could signal a bug to Stainless Games about their Mossbridge Troll dying in Challenge 7 ? didn't play any challenge yet tho :lol:
I haven't played any challenge yet as well, so I don't know if it's possible for the Troll to die (probably not, otherwise they would have noticed the bug).
< 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: First DotP2014 modding problems

Postby gorem2k » 01 Jul 2013, 18:57

if I understand, the command "DestroyWithoutRegenerate()" is using a different priority ?

I must say that I only saw 3 cards on gatherer that have this auto-regenerate ability. maybe if the auto-regeneration of Knight was in a <ACTIVATED_ABILITY> block, it would work properly? most other cards I can think of, have Pay "whatever": regenerate this creature!
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: First DotP2014 modding problems

Postby thefiremind » 01 Jul 2013, 19:06

gorem2k wrote:if I understand, the command "DestroyWithoutRegenerate()" is using a different priority ?
No, but of course the Knight shouldn't be able to regenerate upon that.

gorem2k wrote:maybe if the auto-regeneration of Knight was in a <ACTIVATED_ABILITY> block, it would work properly?
Then it wouldn't be auto-regeneration anymore. :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: First DotP2014 modding problems

Postby thefiremind » 02 Jul 2013, 21:05

I stumbled onto another problem. Now that I can grant activated abilities to cards in the graveyard, I have another issue that prevents me from coding Sedris, the Traitor King. In DotP2014 you can't refer to resource_id's of the original card from an ability granted to another card. This doesn't allow me to create the exiling delayed triggers when I unearth a creature using the ability granted by Sedris. Does anyone have a clever idea to overcome the problem?
< 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

PreviousNext

Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 36 guests


Who is online

In total there are 36 users online :: 0 registered, 0 hidden and 36 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 36 guests

Login Form