It is currently 11 Jun 2025, 07:43
   
Text Size

Help with restoration angel

Moderator: CCGHQ Admins

Help with restoration angel

Postby kpruss » 17 Nov 2012, 04:16

Hi, I'm wondering if anyone has a working restoration angel card script. I'm currently trying to use one I found in blindwillow's dlc. but whenever I flash it in during the opponent's turn, the game crashes. It seems to work fine if I cast it during my turn. I'm still pretty new to editing decks and cards and I've tried comparing and splicing information from other cards that are similar like cloudshift and deciever exarch, but restoration angel seems tricky with its 'may' trigger and exclusion of other angels. I literally have no clue what most of the lines in the scripts mean. Even a partial script is fine, as long as I can flash in the angel, which is the main drawpoint of the card. Thanks in advance and also, would the AI scripting on the bottom of the file be what's crashing it?( even though that seems unlikely.)
kpruss
 
Posts: 23
Joined: 17 Nov 2012, 04:07
Has thanked: 0 time
Been thanked: 1 time

Re: Help with restoration angel

Postby thefiremind » 17 Nov 2012, 10:36

I looked at BlindWillow's code for Restoration Angel and I can't see anything wrong (except he forgot the "may", but that can't be the reason of the crash).
Crashes are hard to debug, and they can be caused by imperfections in the executable (scenarios that the original developers didn't predict), in which case it's not always possible for us modders to do something. I'll try to rewrite some parts of the code in different ways and see what happens.

EDIT: I added the "may" and an additional check on the last RESOLUTION_TIME_ACTION (which is probably redundant anyway) and I haven't seen any crash, yet I highly doubt that I fixed the crash just with that. Could the crash be caused by another card? What was your situation when the crash happened?

This is the triggered ability with my little modifications:
Code: Select all
  <TRIGGERED_ABILITY dangerous="1">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Restoration Angel enters the battlefield, you may exile target non-Angel creature you control, then return that card to the battlefield under your control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Quando l’Angelo della Restaurazione entra nel campo di battaglia, puoi esiliare una creatura non Angelo bersaglio che controlli, poi rimettere quella carta sul campo di battaglia sotto il tuo controllo.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wenn der Engel der Wiederherstellung ins Spiel kommt, kannst du eine Nichtengel-Kreatur deiner Wahl, die du kontrollierst, ins Exil schicken und diese Karte dann unter deiner Kontrolle ins Spiel zurück bringen.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Quand l’Ange de la restauration arrive sur le champ de bataille, vous pouvez exiler une créature non-ange ciblée que vous contrôlez, puis renvoyer cette carte sur le champ de bataille sous votre contrôle.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cuando el Ángel de la restitución entre al campo de batalla, puedes exiliar a la criatura objetivo que controles que no sea un Ángel, luego regresa esa carta al campo de batalla bajo tu control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[修復の天使が戦場に出たとき、あなたがコントロールする天使でないクリーチャー1体を対象とする。あなたはそれを追放し、その後そのカードをあなたのコントロール下で戦場に戻してもよい。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[복원의 천사가 전장에 들어올 때, 당신이 조종하는 생물 중 천사가 아닌 생물 한 개를 목표로 정한다. 당신은 그 생물을 추방한 후 당신의 조종하에 전장에 되돌릴 수 있다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Когда Ангел Восстановления выходит на поле битвы, вы можете изгнать не являющееся Ангелом целевое существо под вашим контролем, затем вернуть ту карту на поле битвы под вашим контролем.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Quando Anjo da Restauração entra no campo de batalha, você pode exilar uma criatura alvo que você controla que não seja Anjo e depois devolvê-la ao campo de batalha sob seu controle.]]></LOCALISED_TEXT>
    <TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
    <TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:AddSubType( CREATURE_TYPE_ANGEL )
    filter:AddExtra( FILTER_EXTRA_FLIP_SUB_TYPES )
    filter:SetController( EffectController() )
    filter:SetZone( ZONE_IN_PLAY )
    filter:May()
    filter:SetHint( HINT_ALLIED, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_CARD_TO_EXILE_AND_RETURN", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_NthCardPtr(0)
    if target ~= nil then
       EffectDC():Get_Targets(0):Protect_CardPtr(0)
       target:RemoveFromGame()
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    if EffectDC() ~= nil and EffectDC():Get_Targets(0) ~= nil then
       local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
       if target ~= nil then
          target:PutIntoPlay( EffectController() )
       end
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
< 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: Help with restoration angel

Postby kpruss » 17 Nov 2012, 20:39

Thanks for the reply! I've actually spent all night yesterday trying to narrow down certain scenarios that might have caused the crash (sorry if I did not give enough information earlier). I could just have been modifying decks incorrectly, but I'm pretty sure it's the angel that's the source of most of the crashes. Currently I only have blindwillow's dlc installed and I've edited a few of the decks with new cards. I unpacked the wads in the game currently and added cards and art into them and tweaked the decks and unlocks, like adding restoration angel to say, Ajani's Celestial light deck. The game ran fine with all the stuff I added to the Garruk and Chandra deck but when I started using restoration angel, I've been getting a lot of ctd. Sometimes, though I would not even have played the angel, just had it in my hand, so I did a check on all of the other cards. I downloaded the corefixes that were posted and changed the batterskull card I was using.

After like 2 hours of going into games and waiting to draw restoration angel, I found out it seemed to crash like 90% of the time when i flashed it in during my opponent's declare blockers and end phases, whether or not I had a creature out, or if my opponent had one. To reduce crashes I would just cast it in my main phase, or in my opponent's while he did nothing. I wondered if I had a computer issue, like if restoration angel's triggers were just too much for me to handle, but I've played with other cards similar to restoration angel, like deciever exarch and briarpack alpha and they do not crash the game. I also run this game on max graphics so I turned it way down, but that didn't help.

I tried using restoration angel again today, I tweaked jace's deck to include white and restoration angel. I still got crashes when I used it and I think I may have added it to my deck incorrectly and that might be the problem. Because I attempted to add a second color and tweak the mana base to be smaller and include evolving wilds, my deck and unlocks became all weird.

To make the deck have a minimum of 24 lands including four lands that count as spells, after some weird mix and matching, I came up with this.

Edit: I can't seem to paste the list or attach any file but I have cards in the main up to deckorder=39 (40 cards) and the unlocks starting at 41-65 and promos at 66-75. I had to add 5 cards in the main because that was the only way to get the deck to have 36 spell 24 lands(with four being evolving wilds).

The deck ended up working though, I lost one promo unlock (the 10th one). I think it's because the deck defaults to 25 lands and 35 spells, to my 40 and the default deck cannot have more than 60 but I didn't mess with anything but the cards, illustrations, and lists.

In my modded jace .wad, I included the Functions folder from blindwillow's dlc, which didn't exist before, once I started getting crashes.

Another thing I noticed was that even If I messed with the restoration angel in my jacedeck .wad file, like removing the filter for angel subtype, it still would not let me choose another restoration angel as a target so I might just be clueless on my deck editing in general or I am not remembering correctly.

After like 20 games of crashing during nicol bolas's end step, I gave up, because it's no fun using restoration angel as a sorcery. To be honestly I almost always had a stoneforge mystic or a batterskull out in either deck I used restoration angel in. (but these cards work fine all the other times I use them and even sometimes with restoration angel) And regardless of what the opponent had, whether nothing or something, if i used it in those phases( declare attackers and end step) game would explode. It had a few crashes in other situations, all regarding the angel. Like I said I thought it was my computer not handling it maybe, so I lowered the graphics to nothing but that didn't help me in said phases. I've casted the angel correctly on my opponent's turn and even on the stack countless times but I've narrowed down the worst situations for that card being during opponent's attack step and end step. I run the game on max graphics with any of my other modded decks that don't have restoration angel fine (no crashes) but then again, they don't have a flash/flying creature with a trigger that might be killing the game.

Thanks again for the reply, firemind, and I'll be trying your script (though like i said, I might not even be using it in the right place) and apologies in advance for my huge wall of text! So far, even with his new deck, jace has not casted a restoration angel on my so I do not know if he will crash using it, but overall editing the AI decks have been a blast and giving the game tons more life for me, so I hope I can learn to do it right.
kpruss
 
Posts: 23
Joined: 17 Nov 2012, 04:07
Has thanked: 0 time
Been thanked: 1 time

Re: Help with restoration angel

Postby thefiremind » 17 Nov 2012, 22:31

kpruss wrote:In my modded jace .wad, I included the Functions folder from blindwillow's dlc, which didn't exist before, once I started getting crashes.
There's no need to copy resources (card definitions or pictures) in all the WADs that use them: each WAD file "sees" each other. And be extremely careful with function files, because once I experienced crashes that were probably caused by having 2 copies of the same functions with little differences between them (I forgot to update the cascade functions in the core-fixing WAD while I was updating them in my mod). Actually, the updated MillCards function in the core-fixing WAD doesn't conflict with the original one (maybe because the original core WAD is set to a different priority, who knows)... but better not risk.

kpruss wrote:Another thing I noticed was that even If I messed with the restoration angel in my jacedeck .wad file, like removing the filter for angel subtype, it still would not let me choose another restoration angel as a target so I might just be clueless on my deck editing in general or I am not remembering correctly.
This is probably because you modified the angel in your Jace's deck, but the game still reads the angel from BlindWillow's WAD file. I'm not 100% sure about that, but it's highly possible that the WAD files are scanned in alphabetic order, and the latest one who has a copy of something "wins" over the previous ones (functions seem to be an exception sometimes, as I wrote earlier).

kpruss wrote:apologies in advance for my huge wall of text!
I often exceed in writing as well, so it won't discourage me from reading, don't worry. :lol:

I just had an idea: make a test deck that contains only Restoration Angel and original core cards (don't put more than 15 copies of the same card in a deck or the AI will play no spells), then make a mirror match against the AI with that deck, and see what happens when you try to reproduce the crash. If you need an almost empty WAD file or you just want to save time avoiding to copy one and change all the IDs, you can edit the test deck I made here:
viewtopic.php?f=65&t=8290#p99665
Eventually, try to do that with and without BlindWillow's DLC installed (of course you'll have to copy Restoration Angel to the test WAD in the latter case).
< 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: Help with restoration angel

Postby kpruss » 18 Nov 2012, 23:15

Thanks firemind, for all the help, I tried the deck full of angels and it worked fine most of the time. I cleaned up a lot of the editing i've done so there should be less or no more conflicts among the files. I think any crashes now are because all these new cards make the ai think a lot more than usual and slows the game down a lot.

And another quick question, have you played with the madness deck in the community mod? Force of will and intuition seem really buggy. Force of will usually doesn't exile a blue card, but it requires one in hand to be played with no mana. Also the AI never casts it, whether for five or zero.

Intuition, does not add any cards to hand and one card stays in the deck, probably the one chosen. I'm going to look over and see if I have outdated versions of these cards.
kpruss
 
Posts: 23
Joined: 17 Nov 2012, 04:07
Has thanked: 0 time
Been thanked: 1 time

Re: Help with restoration angel

Postby thefiremind » 18 Nov 2012, 23:31

kpruss wrote:And another quick question, have you played with the madness deck in the community mod? Force of will and intuition seem really buggy. Force of will usually doesn't exile a blue card, but it requires one in hand to be played with no mana. Also the AI never casts it, whether for five or zero.

Intuition, does not add any cards to hand and one card stays in the deck, probably the one chosen. I'm going to look over and see if I have outdated versions of these cards.
I didn't play with them, but by looking at the copies of those two cards that I downloaded from the repository long time ago, something is definitely wrong.
Force of Will uses a "remove_from_game" cost type, but with a "generic" cost type code, while Intuition probably needs a local array to store the 3 cards before moving them. They are easy fixes, unless there's something else wrong that I didn't see. I posted a fix in the Community DLC topic.
< 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: Help with restoration angel

Postby kpruss » 26 Nov 2012, 07:21

Been playing around some more, but I've been getting some consistent crashing when playing restoration angel while i have a batterskulled germ out. Crashed while i flashed in during my own combat step and crashed in my main phase one too. Just seems to crash only when that germ token is out and equipped. I've been playing with restoration angel for a while, and it's done fine but suddenly the crashes again but now I finally found this one situation. I might have thought it was stoneforge mystic at first but, now it's batterskull. (because stoneforge and batterskull tend to be out at the same time). I'm only using your code for the angel and the batterskull from your last set of core fixes, unless they didn't save correctly when I modded the angel file. When I say I only have these sets of code, is because I've reinstalled duels, put in these mods but I made a brand new angel file with your code with a new number and only used that to make sure it was the only one in case duels can find different restoration angels in some random folder outside. (which i hope not because i have tons of wads sitting in my downloads folder with restoration angel). But yes, in case a core wad had the angel I made a new number for it hoping it will only refer to that instance.

Both of these cards seem to work fine in a vacuum but man it does take a long time to get into a situation where I've played batterskull, then I play an angel, without losing. Even modded an Ai's deck at one point so i can just ramp for five turns while they do nothing.

I'm kinda at a loss now because they do work in like every other situation fine, and after so many different crashes and games I've played with different decks, it took me this long to figure it out. I just don't know why playing restoration angel is so weird with batterskull, can't even say I get to the point where I can choose to bounce the germ, because the game crashes while the angel's on the stack.
kpruss
 
Posts: 23
Joined: 17 Nov 2012, 04:07
Has thanked: 0 time
Been thanked: 1 time

Re: Help with restoration angel

Postby Miraika » 26 Nov 2012, 08:09

Let me field a theory: there's something wrong with the "Germ" creature type. When you cast Restoration Angel, it checks all of your creature's types, and it crashes when it checks the Germ.

If true:

Short-term solution: change the Germ token's creature type to something already in the game ("Licid" is a good choice, since none of those will ever be made by sane people). You don't have to change its name or filename or anything else.

Long-term solution: I don't know. The first thing to find out is if the problem is the constant (1221), or if it just needs to be put in some other file so the game can find it. I'm doing other stuff, so go at it if you're interested.
Miraika
 
Posts: 17
Joined: 10 May 2012, 04:56
Has thanked: 20 times
Been thanked: 4 times

Re: Help with restoration angel

Postby kpruss » 26 Nov 2012, 08:21

yeah, i'll try to change the germ type if i can do that without messing up the batterskull file, or tweak the angel's filters...which might be easier honestly because i've been through that file dozens of time but havent messed with batterskull's at all. The game seems to find the angel fine, but I'm not sure if i know how to mess with constants yet.

thanks for the tip btw, just going to be another slow grind to try to get a batterskull out and an angel in hand again without being forced to block early on, really trying to isolate this.

EDIT: checked to make sure i have the germ type listed in the spec folder, and it's there, but game still crashing when i play restoration angel while a batterskulled germ is out, whether or not it had summoning sickness or not, and i've been doing it during my combat step to make sure the angel's being flashed in as well. Game just crashes before it enters the battlefield, changed the dangerous label, didn't do anything.
Changed some of the filters to match those of briarpack alpha, did nothing. Definitely works whenever batterskull isn't out. Going to go try and see if just removing the creature type filter works, because i don't understand the addextra: filter sub flip types or something line tomorrow, this is really tiring at 5 in the morning but i just wanted it to work. Just can't see there being anything wrong with batterskull. There's a slight difference between thefiremind's batterskull and the one in the core which i think is just an extra end but I don't think that matters at all.
Last edited by kpruss on 26 Nov 2012, 09:37, edited 1 time in total.
kpruss
 
Posts: 23
Joined: 17 Nov 2012, 04:07
Has thanked: 0 time
Been thanked: 1 time

Re: Help with restoration angel

Postby thefiremind » 26 Nov 2012, 09:27

Miraika wrote:Let me field a theory: there's something wrong with the "Germ" creature type. When you cast Restoration Angel, it checks all of your creature's types, and it crashes when it checks the Germ.
If you are using my core-fixing WAD, this shouldn't be the problem because I added the type Germ (and RiiakShiNal added a bunch of other missing types).
< 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: Help with restoration angel

Postby kpruss » 26 Nov 2012, 18:16

Yeah, I have both your core fix wad and restoration angel by itself right now, and batterskull and restoration angel seem to hate each other.
kpruss
 
Posts: 23
Joined: 17 Nov 2012, 04:07
Has thanked: 0 time
Been thanked: 1 time

Re: Help with restoration angel

Postby thefiremind » 26 Nov 2012, 19:07

I have been able to reproduce the crash with a deck that only contains Restoration Angels and Batterskulls.
The AI was controlling 2 Restoration Angels.
I was controlling 1 Batterskull (equipped to its Germ) and 1 Restoration Angel.
The game crashed when I blocked 1 of the AI's Restoration Angels with mine. So it doesn't depend on the enters-the-battlefield trigger.

I'm going to create a test version of Batterskull that spawns a Saproling instead of a Germ. I'll let you know the results.
EDIT: No crashes with Saprolings, so the problem is definitely in the Germ.
EDIT 2: Even if I give the Licid type to the Germ, the crash happens. This makes me happy somehow because it means that the work made by RiiakShiNal and me on missing creature types wasn't the problem. But what could it be, then?
EDIT 3: If I make a test Germ that is 0/1 instead of 0/0, there are no crashes! So the crashes have something to do with the AI evaluating a 0/0 creature. It might be connected to the fact that the Batterskull can be returned to hand... I want to switch off that ability and see what happens.
EDIT 4: Crashes still happen even without the return-to-hand ability on the Batterskull.
EDIT 5: Weird! If I use another creature with flash (Ambush Viper instead of Restoration Angel) there are no crashes. But why does the AI evaluate Restoration Angel's ability even when it's not entering the battlefield?

Summing it up: the reason of the crash is the AI evaluating the interaction between Restoration Angel's ability and a 0/0 creature. I ran out of ideas for now, so if someone else has something to say, please don't hesitate.
< 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: Help with restoration angel

Postby kpruss » 26 Nov 2012, 21:47

I know this doesn't help too much, but when i remove

filter:AddExtra( FILTER_EXTRA_FLIP_SUB_TYPES )

or change the hint, the ability becomes disabled and the angel doesn't crash the game.
But...that kinda defeats the purpose.
kpruss
 
Posts: 23
Joined: 17 Nov 2012, 04:07
Has thanked: 0 time
Been thanked: 1 time

Re: Help with restoration angel

Postby thefiremind » 26 Nov 2012, 21:58

kpruss wrote:I know this doesn't help too much, but when i remove

filter:AddExtra( FILTER_EXTRA_FLIP_SUB_TYPES )

or change the hint, the ability becomes disabled and the angel doesn't crash the game.
But...that kinda defeats the purpose.
The hint could be totally removed, if it helps against the crash (I didn't try). After all you have to select something you control, so there's no need to pilot the AI's preference between allied or opponent's targets.
< 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: Help with restoration angel

Postby kpruss » 26 Nov 2012, 23:20

Using the 0/1 token and your spec file is working now i did another clean install!

Going to use this for now, freaking flashed in an angel and killed my own germ while i was attacking!

Screw this game and its inability to comprehend 0/0s
kpruss
 
Posts: 23
Joined: 17 Nov 2012, 04:07
Has thanked: 0 time
Been thanked: 1 time

Next

Return to 2013

Who is online

Users browsing this forum: No registered users and 305 guests

cron

Who is online

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

Login Form