It is currently 13 Jul 2020, 18:50
   
Text Size

DotP 2015: Is there a way to get dual-lands truly working?

Moderators: Xander9009, CCGHQ Admins

DotP 2015: Is there a way to get dual-lands truly working?

Postby GamerXYZ0 » 15 Jun 2020, 20:15

As many probably already know, the dual-lands that are treated as both its Basic versions such as Bayou (treated as a non-Basic Swamp and Forest, unlike Golgari Guildgate for example) don't work in DotP 2015, because the game automatically lumps together all Swamps, all Forests etcetera and this just results in a buggy land card collection.

The problem can be bypassed by removing their Subtypes, but if you do so they're not treated as their Basic versions anymore, so for example Bayou won't trigger Staff of the Death Magus anymore.

Anyone knows of an alternative way to make them treated as their Basic versions without bugging out the card collection? It's fine if it's not 100% correct (such as a triggered ability working when the Land enters the field that adds the Subtypes (too bad about stuff like Nature's Lore, but it'd already be a huge improvement), I know there's a SubType_Add function but I don't know how to code a card: I can only take pieces of code of other cards, but Spreading Seas's code doesn't help me in what I'm looking for).
GamerXYZ0
 
Posts: 100
Joined: 17 Jun 2011, 19:29
Has thanked: 10 times
Been thanked: 7 times

Re: DotP 2015: Is there a way to get dual-lands truly workin

Postby RiiakShiNal » 16 Jun 2020, 10:43

There is a way you could make it work, but it is enough work that I doubt anyone would actually want to do that.

First off you would need to remove the regular basic land sub-types and add specialized fake sub-types. For example for Bayou you would remove both Swamp and Forest basic land sub-types then add some fake sub-types (like swamp2 and forest2). The fake sub-types can have their names show up like the real sub-types in-game by adding appropriate text in the language files.

Second you would need to rewrite all cards (both standard included cards as well as mod added cards) with abilities that depend on basic land detection to work with the new sub-types as well. For some cards this may be fairly easy (adding an additional "or" condition with the new fake sub-type). For other cards this could get quite tricky because you'll need to emulate the ability (like land-walk where you would need to add a static ability that makes the creature unblockable only if the opponent has a land with the appropriate fake sub-type).

This would allow it to work with cards like Staff of the Death Magus and Nature's Lore, but requires continued work as more cards are added to maintain proper functionality (since any cards that care about land sub-types would have to be aware of the fake sub-types and coded such that they work with them).

If you can generalize most of the code into script files that will make editing the cards easier and faster. It would also allow fixing of some bugs across all related cards simpler since depending on how the code is centralized you may only need to change it in one place to fix the bug across all affected cards.

Obviously not an ideal solution, but it is one that should work (though requires a lot of work).
RiiakShiNal
Programmer
 
Posts: 2138
Joined: 16 May 2011, 21:37
Has thanked: 74 times
Been thanked: 477 times

Re: DotP 2015: Is there a way to get dual-lands truly workin

Postby GamerXYZ0 » 25 Jun 2020, 00:23

Thanks for the reply. Well, good news is I don't need to check all cards: I'm only interested in the cards showing up in AI decks, and only in decks where these specific Lands are actually used.

I've tried experimenting with this before, but due to my lack of knowledge it didn't work. What I did was (everything in DATA_000):

1. In the Specs folder, edit Land_Types.txt and added SWAMPTEST
2. In the Bayou card I added
Code: Select all
  <SUB_TYPE metaname="SWAMPTEST" />
in the correct place
3. In the Staff of the Death Magus card I took the following:
Code: Select all
    <TRIGGER value="ZONECHANGE_END" simple_qualifier="objectyoucontrol" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY">
    return TriggerObject():GetSubType():Test( LAND_TYPE_SWAMP )
    </TRIGGER>
And duplicated it, in the copy changing LAND_TYPE_SWAMP with LAND_TYPE_SWAMPTEST

However, it didn't work: I didn't get life when I played Bayou. I suppose rather than duplicating that trigger I need to use an XOR? How do you do an XOR in DotP card coding? Or if the solution is something different: how do I make it recognize SWAMPTEST? It showed up as an undefined string because I didn't add it in the language files, was that the problem?

And how would I edit a card that uses the filter, like Serpent of the Endless Sea? It has
Code: Select all
filter:Add( FE_SUBTYPE, OP_IS, LAND_TYPE_ISLAND )
, do I just replicate this with the subtype I use for Tropical Island?
GamerXYZ0
 
Posts: 100
Joined: 17 Jun 2011, 19:29
Has thanked: 10 times
Been thanked: 7 times

Re: DotP 2015: Is there a way to get dual-lands truly workin

Postby RiiakShiNal » 25 Jun 2020, 10:59

Well, you missed some necessary steps and did some things wrong.

Steps 1 & 2 were correct, but you forgot to define the constant LAND_TYPE_SWAMPTEST in a LOL file (the value would need to correspond to the position you added SWAMPTEST to the Land_Types.txt file [so you would take the value of the constant for the sub type above SWAMPTEST and add 1 to it to get the value for SWAMPTEST] and you should always add to the end of the file or you will screw up the values of the other land types).

In step 3 you do not duplicate the trigger, you simply need to modify the trigger to
Code: Select all
return TriggerObject():GetSubType():Test( LAND_TYPE_SWAMP ) or TriggerObject():GetSubType():Test( LAND_TYPE_SWAMPTEST )
You do not need to use an XOR a simple OR is all that is needed for some things, for filters you'll need to make use of "or" subfilter groups (AddSubFilter_Or) to allow making a group in the filter that if any one of the conditions is met the entire group condition returns true. So with Serpent of the Endless Sea it would become something like this:
Code: Select all
local subFilter = filter:AddSubFilter_Or()
subFilter:Add( FE_SUBTYPE, OP_IS, LAND_TYPE_ISLAND )
subFilter:Add( FE_SUBTYPE, OP_IS, LAND_TYPE_ISLANDTEST )
RiiakShiNal
Programmer
 
Posts: 2138
Joined: 16 May 2011, 21:37
Has thanked: 74 times
Been thanked: 477 times

Re: DotP 2015: Is there a way to get dual-lands truly workin

Postby GamerXYZ0 » 25 Jun 2020, 15:59

Thanks! Unfortunately I see .lol file editing has a load of problems, but in Land_Types.txt I see enough land-types that are unused for AI decks (desert, lair, locus, mine, power_plant, tower, and urzas) that I'll just use 5 of them as replacements, of course backing all the original stuff up.
GamerXYZ0
 
Posts: 100
Joined: 17 Jun 2011, 19:29
Has thanked: 10 times
Been thanked: 7 times

Re: DotP 2015: Is there a way to get dual-lands truly workin

Postby RiiakShiNal » 30 Jun 2020, 10:40

GamerXYZ0 wrote:Thanks! Unfortunately I see .lol file editing has a load of problems, but in Land_Types.txt I see enough land-types that are unused for AI decks (desert, lair, locus, mine, power_plant, tower, and urzas) that I'll just use 5 of them as replacements, of course backing all the original stuff up.
You don't have to edit one of the existing LOL files, you can create a brand new one, you just have to make sure when you define the constant it has the right value. Even then you don't have to use the same naming scheme for the constant you can name it whatever you want, it just has to be unique and when you reference it use whatever name you gave it.

Alternatively, if you don't want to create a LOL file you could just use the value directly (it's just an integer which references the place in the Land_Types.txt spec file). Using the number directly just isn't as readable so it makes things more difficult when debugging.
RiiakShiNal
Programmer
 
Posts: 2138
Joined: 16 May 2011, 21:37
Has thanked: 74 times
Been thanked: 477 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 1 guest


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 10 minutes)
Most users ever online was 1371 on 09 Feb 2020, 16:22

Users browsing this forum: No registered users and 1 guest

Login Form