Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
First DotP2014 modding problems
Moderator: CCGHQ Admins
Re: First DotP2014 modding problems
by RiiakShiNal » 30 Jun 2013, 13:35
Have you tried overriding the event using "MTG():OverrideEvent()"?
Maybe something like this:
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>
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: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: First DotP2014 modding problems
by 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...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: First DotP2014 modding problems
by 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:
"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>
Re: First DotP2014 modding problems
by 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...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: First DotP2014 modding problems
by gorem2k » 30 Jun 2013, 20:53
If Knight of the Holy Nimbus WOULD be destroyed... regenerate it.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.
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>
Last edited by gorem2k on 30 Jun 2013, 22:12, edited 1 time in total.
Re: First DotP2014 modding problems
by thefiremind » 30 Jun 2013, 22:11
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?gorem2k wrote:If Knight of the Holy Nimbus WOULD be destroyed... regenerate it.
would suggest it's not happening..
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...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: First DotP2014 modding problems
by gorem2k » 30 Jun 2013, 22:26
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.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?
I'm sure if more are experimenting on this, we'll get some results.
Re: First DotP2014 modding problems
by thefiremind » 30 Jun 2013, 22:31
But Disintegrate is "if would, do something instead".gorem2k wrote:This sentence is very similar to the last one on Disintegrate. if would, do something.
< 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: 721 times
Re: First DotP2014 modding problems
by gorem2k » 30 Jun 2013, 22:39
hence why I'm not saying it's an exact sentence. come on!!thefiremind wrote:But Disintegrate is "if would, do something instead".gorem2k wrote:This sentence is very similar to the last one on Disintegrate. if would, do something.
Re: First DotP2014 modding problems
by thefiremind » 30 Jun 2013, 22:42
I was only trying to explain where's the difference.gorem2k wrote:hence why I'm not saying it's an exact sentence. come on!!
I really hope so.gorem2k wrote:I'm sure if more are experimenting on this, we'll get some results.
< 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: 721 times
Re: First DotP2014 modding problems
by gorem2k » 01 Jul 2013, 00:47
could you provide an example of said Destroy event?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()?
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>
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
Re: First DotP2014 modding problems
by thefiremind » 01 Jul 2013, 08:30
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: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.
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: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.
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).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
< 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: 721 times
Re: First DotP2014 modding problems
by 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!
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!
Re: First DotP2014 modding problems
by thefiremind » 01 Jul 2013, 19:06
No, but of course the Knight shouldn't be able to regenerate upon that.gorem2k wrote:if I understand, the command "DestroyWithoutRegenerate()" is using a different priority ?
Then it wouldn't be auto-regeneration anymore.gorem2k wrote:maybe if the auto-regeneration of Knight was in a <ACTIVATED_ABILITY> block, it would work properly?
< 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: 721 times
Re: First DotP2014 modding problems
by 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...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
67 posts
• Page 2 of 5 • 1, 2, 3, 4, 5
Who is online
Users browsing this forum: No registered users and 36 guests