Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk



Lord of the Unreal, Team Hexproof bug..
Moderator: CCGHQ Admins
Lord of the Unreal, Team Hexproof bug..
by Jace11 » 12 Apr 2012, 01:20
This is from Lord of the Unreal (the original game, not a modded DLC), there is a bug with this card in that in 2-Headed Giant games it bestows Hexproof on your teammates illusions as well as your own (but the badges only appear on your own illusions, while your teammates cannot be targetted.
Anyway, I'm getting rid of a few bugs on cards (call to the grave was an easy fix) and wanted to check this bit.. which I think it what determines hexproof, it would be easy if the game had a characteristic for hexproof, like it does for most other effects, but it doesn't and it seems targeting has been coded manually in lua on all cards, creatures -enchantments alike etc..
What would be the correct code? I understand the filter, but I know little about the TriggerObject, Object and secondary object...
It should still be targetable by your teamates? According to real hexproof rules, it seems it ...
ah I dunno, any help would be appreciated...
Anyway, I'm getting rid of a few bugs on cards (call to the grave was an easy fix) and wanted to check this bit.. which I think it what determines hexproof, it would be easy if the game had a characteristic for hexproof, like it does for most other effects, but it doesn't and it seems targeting has been coded manually in lua on all cards, creatures -enchantments alike etc..
- Code: Select all
<TRIGGER value="CARD_CONSIDERED_FOR_TARGETTING">
return ( TriggerObject() ~= nil and TriggerObject():GetSubType():Test( CREATURE_TYPE_ILLUSION ) ~= 0) and (TriggerObject():GetZone() == ZONE_IN_PLAY)
and ( TriggerObject():GetPlayer():GetTeam() == Object():GetPlayer():GetTeam() )
and ( SecondaryObject() ~= nil and SecondaryObject():GetPlayer():GetTeam() ~= Object():GetPlayer():GetTeam() )
</TRIGGER>
What would be the correct code? I understand the filter, but I know little about the TriggerObject, Object and secondary object...
It should still be targetable by your teamates? According to real hexproof rules, it seems it ...
ah I dunno, any help would be appreciated...
Re: Lord of the Unreal, Team Hexproof bug..
by thefiremind » 12 Apr 2012, 08:52
Briefly:
I don't know the exact Two-Headed Giant rules: when I was playing paper Magic some years ago, I sometimes played with friends using rules that we called Two-Headed Giant but probably had some "casual" tweaks, for example each teammate could tap the other teammate's nonland permanents whenever he needed their activated abilities. In DotP2012 I'm pretty sure that you don't really control the other teammate's permanents, so yeah, this is a bug.
The line that says
- Object is the card you are coding.
- TriggerObject is the card that called the trigger (in this case, the card "considered for targetting").
- SecondaryObject generally is the card that does something to TriggerObject (in this case, the card that targets it).
I don't know the exact Two-Headed Giant rules: when I was playing paper Magic some years ago, I sometimes played with friends using rules that we called Two-Headed Giant but probably had some "casual" tweaks, for example each teammate could tap the other teammate's nonland permanents whenever he needed their activated abilities. In DotP2012 I'm pretty sure that you don't really control the other teammate's permanents, so yeah, this is a bug.
The line that says
- Code: Select all
and ( TriggerObject():GetPlayer():GetTeam() == Object():GetPlayer():GetTeam() )
- Code: Select all
and ( TriggerObject():GetPlayer() == Object():GetPlayer() )
< 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: 722 times
Re: Lord of the Unreal, Team Hexproof bug..
by Jace11 » 12 Apr 2012, 12:13
Thanks dude,
I fixed it already, majority on wizards forum say it shouldn't give allied illusions hexproof, and indeed the badge for hexproof is only coded to be place on your illusions, so it looks like the extra protection on allied illusions was an oversight.
I got the corrections from LEONIN_ABUNAS_244957 which does the same, but to artifacts. However it seems to do it correctly and the script for targetting is the same as you just posted...(pretty much)
Incidentally, although people can't replace the Data_Core I have found it possible to fix bugged cards in decks. The process requires a bit of messing around though.
Putting a fixed card from the core into one of the DLC wads, doesn't work, cards in the core cannot be overwritten, however, if you take core decks from Data_Core and put them into Data_DLC_003, 004 etc, they overwrite the original in the core, allowing easy editing of some of the poorer standard decks (like Dragon's Roar etc) so I added and swapped a few cards around in that deck (added Terminate, some Terramorhic expanses etc to help swamp fetch).
If you want to replace a bugged card from a DLC, you can just edit that cards script in the Data_DLC_000* and recompile the wad and it works fine, but replacing a bugged card that is in the original core requires you overwrite the original deck, or unlocks with a new one that specifies a new card ( I use same name, but new identifer number). So I have Data_DLC_004 with a a D12_Jace1v1 unlock.xml that contains a Lord_of_the_Unreal_(NEW####) and the correspondingly numbered card (and its internal filename in the script has to be changed too) in the DLC's card folder and it works. The bug is fixed now... I just tested it.
You guys probably knew this already though but I didn't know this was possible..
Thanks for your help though... I read several of your posts and other people's scripting problems / advice last night.
I fixed it already, majority on wizards forum say it shouldn't give allied illusions hexproof, and indeed the badge for hexproof is only coded to be place on your illusions, so it looks like the extra protection on allied illusions was an oversight.
I got the corrections from LEONIN_ABUNAS_244957 which does the same, but to artifacts. However it seems to do it correctly and the script for targetting is the same as you just posted...(pretty much)
Incidentally, although people can't replace the Data_Core I have found it possible to fix bugged cards in decks. The process requires a bit of messing around though.
Putting a fixed card from the core into one of the DLC wads, doesn't work, cards in the core cannot be overwritten, however, if you take core decks from Data_Core and put them into Data_DLC_003, 004 etc, they overwrite the original in the core, allowing easy editing of some of the poorer standard decks (like Dragon's Roar etc) so I added and swapped a few cards around in that deck (added Terminate, some Terramorhic expanses etc to help swamp fetch).
If you want to replace a bugged card from a DLC, you can just edit that cards script in the Data_DLC_000* and recompile the wad and it works fine, but replacing a bugged card that is in the original core requires you overwrite the original deck, or unlocks with a new one that specifies a new card ( I use same name, but new identifer number). So I have Data_DLC_004 with a a D12_Jace1v1 unlock.xml that contains a Lord_of_the_Unreal_(NEW####) and the correspondingly numbered card (and its internal filename in the script has to be changed too) in the DLC's card folder and it works. The bug is fixed now... I just tested it.
You guys probably knew this already though but I didn't know this was possible..
Thanks for your help though... I read several of your posts and other people's scripting problems / advice last night.
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 23 guests