It is currently 20 Apr 2024, 02:00
   
Text Size

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

Moderator: 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: 102
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: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 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: 102
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: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 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: 102
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: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

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

Postby Shatterhouse » 29 Jan 2022, 21:55

Hi, sorry for being late to this.

I had a simple solution in my 2013 mods that'll probably work. What I did was not give the land any land types. Instead the card had a static ability that granted itself two land types, and the ability would be active at all times in all zones. It would only *show* the types on its typeline while on the battlefield, but it was still searchable with fetchlands. So as long as you don't animate the land as a creature while also removing all the abilities from said creature, the land will have two land types as long as you're playing the actual game. While deckbuilding, the land would have no types and shouldn't act weird around the basics.

The issue that brought this up in 2013 was some strange bug that caused dual lands from one deck to appear in an opponent's deck during the match, somehow.
Shatterhouse
 
Posts: 72
Joined: 20 Apr 2011, 00:07
Has thanked: 0 time
Been thanked: 2 times

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

Postby RiiakShiNal » 14 Feb 2022, 11:56

Shatterhouse wrote:I had a simple solution in my 2013 mods that'll probably work. What I did was not give the land any land types. Instead the card had a static ability that granted itself two land types, and the ability would be active at all times in all zones. It would only *show* the types on its typeline while on the battlefield, but it was still searchable with fetchlands. So as long as you don't animate the land as a creature while also removing all the abilities from said creature, the land will have two land types as long as you're playing the actual game. While deckbuilding, the land would have no types and shouldn't act weird around the basics.
While this might solve the initial problem of making the land not be grouped with other basic lands it does not solve other issues like when a card contains more than 1 active mana ability (basic land types automatically grant this) then a bug in the DotP engine allows using both/all abilities simultaneously without tapping the card (which depending on how it is used could result in gaining unfair significant mana advantages).

I still stand by my original comments. Since the name of the topic is "Is there a way to get dual-lands truly working?" your method can't be described as truly working due to the bug with mana tapping. My method would allow dual-lands to fully work (as long as mana generation is done using a manual tapping method like my Manual Mana functions and/or by switching between a single active mana ability), but as I previously stated would require so much work that I doubt anyone would actually want to do it.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

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

Postby Shatterhouse » 22 Oct 2022, 16:23

Hi, sorry I'm late again.

My dual lands have two mana abilities, and an activated 'toggle' ability that turns one color on and the other color off. They use the landwalk badges to display which color mana the land is currently allowed to produce.
Shatterhouse
 
Posts: 72
Joined: 20 Apr 2011, 00:07
Has thanked: 0 time
Been thanked: 2 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 38 guests


Who is online

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

Login Form