It is currently 17 Nov 2019, 00:50
   
Text Size

General DotP 2014 Coding Questions

Moderators: Xander9009, CCGHQ Admins

Re: General DotP 2014 Coding Questions

Postby RiiakShiNal » 22 Feb 2014, 23:16

As you stated just paste it into notepad and save it with the .LOL extension in the FUNCTIONS folder, no need to compile. Recommended to save using UTF-8, but not required since I didn't use any non-English characters.
Problems with base game cards: DotP 2014 Core Fixes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
RiiakShiNal
Programmer
 
Posts: 2130
Joined: 16 May 2011, 21:37
Has thanked: 73 times
Been thanked: 473 times

Re: General DotP 2014 Coding Questions

Postby NEMESiS » 08 Mar 2014, 15:40

Is there a way to make the AI prioritize playing fetch lands like Terramorphic Expanse over normal lands? For example it will rather chose to play 4 Mountains instead of the fetch land to get a Forest which is silly because 3 of its spells are green and isn't able to cast them..... The same issue happens when it chooses not "crack" them and get a land. I know some cards have a score like: <AI_BASE_SCORE score="900" zone="ZONE_HAND" />

The Expanse has: <SEALED_HEURISTICS is_fixing="1" />

Is this the same thing?
User avatar
NEMESiS
 
Posts: 460
Joined: 03 Jan 2013, 04:02
Location: Pools of Becoming
Has thanked: 68 times
Been thanked: 21 times

Re: General DotP 2014 Coding Questions

Postby thefiremind » 08 Mar 2014, 17:49

NEMESiS wrote:The same issue happens when it chooses not "crack" them and get a land.
I know a fix for this one: allowing the AI to activate the ability during the end phase (with the proper AI_AVAILABILITY) fixes the problem... don't ask me why, I have no idea. :lol: About the first problem, I don't know, I haven't even noticed it.

NEMESiS wrote:<SEALED_HEURISTICS is_fixing="1" />
The SEALED tags only affect the score given by the game to the decks you build in sealed mode. For example, "is_fixing" probably tells the game that the card should make the score higher with multi-color decks.
< 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: 717 times

Re: General DotP 2014 Coding Questions

Postby NEMESiS » 08 Mar 2014, 23:47

thefiremind wrote:
NEMESiS wrote:The same issue happens when it chooses not "crack" them and get a land.
I know a fix for this one: allowing the AI to activate the ability during the end phase (with the proper AI_AVAILABILITY) fixes the problem... don't ask me why, I have no idea. :lol: About the first problem, I don't know, I haven't even noticed it.

NEMESiS wrote:<SEALED_HEURISTICS is_fixing="1" />
The SEALED tags only affect the score given by the game to the decks you build in sealed mode. For example, "is_fixing" probably tells the game that the card should make the score higher with multi-color decks.
I have noticed this issue in 2HG but I always suspected that it always plays the fetch lands last.

As for the AI availability the expanse already has this:

<AI_AVAILABILITY type="in_response" response_source="1" />
<AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
<AI_AVAILABILITY window_step="main_2" window_turn="my_turn" type="window" />

What do you suggest I add?

Edit: I will try
<AI_AVAILABILITY window_step="end_of_turn" window_turn="their_turn" type="window" />

EDIT2: Nope, that didn't work
User avatar
NEMESiS
 
Posts: 460
Joined: 03 Jan 2013, 04:02
Location: Pools of Becoming
Has thanked: 68 times
Been thanked: 21 times

Re: General DotP 2014 Coding Questions

Postby thefiremind » 09 Mar 2014, 09:40

NEMESiS wrote:Edit: I will try
<AI_AVAILABILITY window_step="end_of_turn" window_turn="their_turn" type="window" />

EDIT2: Nope, that didn't work
My Evolving Wilds have
Code: Select all
    <AI_AVAILABILITY type="in_response" response_source="1" />
    <AI_AVAILABILITY window_step="main_1" window_turn="my_turn" type="window" />
    <AI_AVAILABILITY window_step="main_2" window_turn="my_turn" type="window" />
    <AI_AVAILABILITY window_step="end_of_turn" type="window" />
and the AI "cracks" them at the end of its own turn. I guess it's the only time window where it always happens, so it should work if you remove
Code: Select all
window_turn="their_turn"
from your newly added availability.
< 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: 717 times

Re: General DotP 2014 Coding Questions

Postby NEMESiS » 09 Mar 2014, 23:59

Has anyone seen an issue where the AI queues up 25 dragons from a dragon roost? :shock: it didn't even tap lands for them....

Image


Not sure what happened on that particular scenario, all I did was zoom in to the dragon roost and when I zoomed out there were 25 dragons queued up. After that the AI used it correctly. Really odd....
User avatar
NEMESiS
 
Posts: 460
Joined: 03 Jan 2013, 04:02
Location: Pools of Becoming
Has thanked: 68 times
Been thanked: 21 times

Re: General DotP 2014 Coding Questions

Postby Luchian » 21 Mar 2014, 21:02

Hello all,
I am a noob to coding and I am trying to code Predator's Gambit. I can get it all to work just fine if I enchant one of my own creatures. But if I enchant an opponent's creature it doesn't work.
I'm pretty sure the issue is here :
Code: Select all
      
<FILTER filter_id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    if filter:CountStopAt(2) ~= 1 then
      filter:Invalidate()
    end
    </FILTER>
And I am messing up on setting the right controller from the owner of the enchantment to the controller of the creature.
Please can somebody help me work this out.
I would very much appreciate it.

Thanks.
Luchian
 
Posts: 20
Joined: 21 Mar 2014, 20:50
Has thanked: 10 times
Been thanked: 2 times

Re: General DotP 2014 Coding Questions

Postby thefiremind » 21 Mar 2014, 21:35

Luchian wrote:Hello all,
I am a noob to coding and I am trying to code Predator's Gambit. I can get it all to work just fine if I enchant one of my own creatures. But if I enchant an opponent's creature it doesn't work.
A FILTER block isn't what you need here. You want to use FILTER blocks when you need to do something to many cards, but Predator's Gambit only affects one card.
The following is "enchanted creature has intimidate":
Code: Select all
  <STATIC_ABILITY>
    -- Localised text omitted
    <CONTINUOUS_ACTION layer="6">
    local parent = EffectSource():GetParent()
    if parent ~= nil then
       parent:GetCurrentCharacteristics():Bool_Set( CHARACTERISTIC_INTIMIDATE, 1 )
    end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
...but you want to grant intimidate only when the condition is met, so:
Code: Select all
  <STATIC_ABILITY>
    -- Localised text omitted
    <CONTINUOUS_ACTION layer="6">
    local parent = EffectSource():GetParent()
    if parent ~= nil then
       local filter = ClearFilter()
       filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
       filter:Add( FE_CONTROLLER, OP_IS, parent:GetController() )
       if filter:Count() == 1 then
          parent:GetCurrentCharacteristics():Bool_Set( CHARACTERISTIC_INTIMIDATE, 1 )
       end
    end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
The ability works only if the Aura is on the battlefield, this means that it's attached to one creature: if that creature's controller controls exactly one creature, then it's the only one.
< 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: 717 times

Re: General DotP 2014 Coding Questions

Postby Luchian » 21 Mar 2014, 22:03

Thanks, that did the trick!
Luchian
 
Posts: 20
Joined: 21 Mar 2014, 20:50
Has thanked: 10 times
Been thanked: 2 times

Re: General DotP 2014 Coding Questions

Postby Ferrix » 03 Apr 2014, 21:12

Apologies if this isn't a "coding" question per se:

How can one make sure that other versions of a card are overwritten by the one in his own WAD (for making fixes to other WADs like for example official cards)?

I want to fix some cards I got in mods and would rather have an own WAD with the fixes (that I can send to my friend with whom I play 2HG against the AI) than having to extract and repack all WADs with that card, that would need me to send around literally gigabytes of data.
Ferrix
 
Posts: 31
Joined: 02 Apr 2014, 21:14
Has thanked: 2 times
Been thanked: 2 times

Re: General DotP 2014 Coding Questions

Postby RiiakShiNal » 03 Apr 2014, 22:35

Ferrix wrote:How can one make sure that other versions of a card are overwritten by the one in his own WAD (for making fixes to other WADs like for example official cards)?
Cards/Decks/Art must of course have the exact same file names as the files you want to override. They must also be in a valid WAD that is named appropriately. To make sure the files actually override there are 2 methods:
  1. Create a WAD that loads after the mod using the same order id as the mod you want to override (WAD name should be alphabetically after the WAD you want to override).
  2. Create your WAD with a higher order id than the WAD you want to override.

In most cases creators make mods using order id 3 (the default we use for modding) so usually method 1 is the simplest to use (other than WAD name, no change to modding). There are, however, a few card WADs that use higher orders that are notable (that I know of):
  • DATA_DECKS_E14.WAD (Official) - 12
  • DATA_DECKS_F14_PACK1 (Official) - 22
  • DATA_DECKS_F14_PACK2 (Official) - 32
  • DATA_DECKS_F14_PACK3 (Official) - 42
  • Data_DLC_8192_ManualMana.wad (my Manual Mana functions) - 93 (Ensures that even if more official packs come out, which is unlikely, they will properly override the basic lands.)
  • Data_DLC_Core_Fixes (my Core Fixes mod) - 43 (Overrides all currently known official WADs, if new packs come out there will probably need to be new fixes so 1 higher is sufficient.)
If you need to override one of those or a mod that uses a higher order id then using method 2 is advisable. Though it should also be noted that we don't know what the highest order id accepted by the game is so you should try to stick to lower numbers when possible.

Order ids can be found in the WAD header in the ENTRY tag (quoted so I can bold it):
<ENTRY platform="ALL" source="Data_Decks_F14_Pack3/DATA_ALL_PLATFORMS/" alias="Content" order="42"/>
Ferrix wrote:I want to fix some cards I got in mods and would rather have an own WAD with the fixes (that I can send to my friend with whom I play 2HG against the AI) than having to extract and repack all WADs with that card, that would need me to send around literally gigabytes of data.
Overriding is definitely the way to go as there is no need to repack WADs and re-transfer all the art, etc.... Cards are much smaller.
Problems with base game cards: DotP 2014 Core Fixes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
RiiakShiNal
Programmer
 
Posts: 2130
Joined: 16 May 2011, 21:37
Has thanked: 73 times
Been thanked: 473 times

Re: General DotP 2014 Coding Questions

Postby Ferrix » 04 Apr 2014, 06:16

Thank you!

I had, in fact, already tried what you suggested yesterday with the order number (saw that myself in the header, I used number 23 since the other Magic 2014 fix also used it) but it still seems to load a function from another version of the card that prevents it from working correctly although both sources where that card can come from are order 3. Only if I undo the other mod it works. Strange. I can only assume I somehow applied the header wrong then.

EDIT: It works now. I have no clue what was wrong, it seems somehow an empty space in the header file between the "23" and > prevented it from working? Or is it because I renamed it to Data_DLC_... now instead of only Data_...?

Anyway, thank you for the help! Now I can start fixing the other cards as well.
Ferrix
 
Posts: 31
Joined: 02 Apr 2014, 21:14
Has thanked: 2 times
Been thanked: 2 times

Re: General DotP 2014 Coding Questions

Postby RiiakShiNal » 04 Apr 2014, 12:20

Ferrix wrote:EDIT: It works now. I have no clue what was wrong, it seems somehow an empty space in the header file between the "23" and > prevented it from working? Or is it because I renamed it to Data_DLC_... now instead of only Data_...?
That would be the problem. If you use only "DATA_" DotP 2014 won't recognize the file. DotP 2014 only recognizes 2 naming conventions for WAD names (DATA_CORE.WAD is an exception):
  1. "DATA_DLC_"
  2. "DATA_DECKS_"

After either of those two prefixes it doesn't really care what the name is, but the WAD must start with one of the two prefixes.

It should be noted that for Content Pack Enabling DotP 2014 will only recognize the header XML using the "DATA_DLC_" WAD prefix.
Problems with base game cards: DotP 2014 Core Fixes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
RiiakShiNal
Programmer
 
Posts: 2130
Joined: 16 May 2011, 21:37
Has thanked: 73 times
Been thanked: 473 times

Re: General DotP 2014 Coding Questions

Postby Xander9009 » 21 Nov 2014, 21:52

I was wondering if there was a thread for general questions. Apparently so.

Is there a limit to the number of activated abilities a card can have? My god mode testing card has 10, but only the first 8 are activable. If I remove the eighth one, the first 8 are still activable. Is there another reason an ability can cause the NEXT ability to not work?
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 443 times

Re: General DotP 2014 Coding Questions

Postby thefiremind » 21 Nov 2014, 22:05

Xander9009 wrote:Is there a limit to the number of activated abilities a card can have?
I'm sure there is. If I remember correctly, in DotP2013 (or 2012, or both, can't remember) I couldn't even code Windreaver properly because 4 was too much already.
You can merge some of your 10 abilities in a single activated ability with modes if you want, after all we are talking about a test card, you don't need to adhere to anything. :)
< 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: 717 times

PreviousNext

Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 4 guests


Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests (based on users active over the past 10 minutes)
Most users ever online was 546 on 15 Nov 2019, 10:18

Users browsing this forum: No registered users and 4 guests

Login Form