Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
General DotP 2014 Coding Questions
Moderator: CCGHQ Admins
Re: General DotP 2014 Coding Questions
by 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.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: General DotP 2014 Coding Questions
by 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?
The Expanse has: <SEALED_HEURISTICS is_fixing="1" />
Is this the same thing?
-
NEMESiS - Posts: 460
- Joined: 03 Jan 2013, 04:02
- Location: Pools of Becoming
- Has thanked: 70 times
- Been thanked: 21 times
Re: General DotP 2014 Coding Questions
by thefiremind » 08 Mar 2014, 17:49
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. About the first problem, I don't know, I haven't even noticed it.NEMESiS wrote:The same issue happens when it chooses not "crack" them and get a land.
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.NEMESiS wrote:<SEALED_HEURISTICS is_fixing="1" />
< 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: 721 times
Re: General DotP 2014 Coding Questions
by NEMESiS » 08 Mar 2014, 23:47
I have noticed this issue in 2HG but I always suspected that it always plays the fetch lands last.thefiremind wrote: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. About the first problem, I don't know, I haven't even noticed it.NEMESiS wrote:The same issue happens when it chooses not "crack" them and get a land.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.NEMESiS wrote:<SEALED_HEURISTICS is_fixing="1" />
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
-
NEMESiS - Posts: 460
- Joined: 03 Jan 2013, 04:02
- Location: Pools of Becoming
- Has thanked: 70 times
- Been thanked: 21 times
Re: General DotP 2014 Coding Questions
by thefiremind » 09 Mar 2014, 09:40
My Evolving Wilds haveNEMESiS wrote:Edit: I will try
<AI_AVAILABILITY window_step="end_of_turn" window_turn="their_turn" type="window" />
EDIT2: Nope, that didn't work
- 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" />
- Code: Select all
window_turn="their_turn"
< 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: 721 times
Re: General DotP 2014 Coding Questions
by NEMESiS » 09 Mar 2014, 23:59
Has anyone seen an issue where the AI queues up 25 dragons from a dragon roost? it didn't even tap lands for them....
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....
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....
-
NEMESiS - Posts: 460
- Joined: 03 Jan 2013, 04:02
- Location: Pools of Becoming
- Has thanked: 70 times
- Been thanked: 21 times
Re: General DotP 2014 Coding Questions
by 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 :
Please can somebody help me work this out.
I would very much appreciate it.
Thanks.
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>
Please can somebody help me work this out.
I would very much appreciate it.
Thanks.
Re: General DotP 2014 Coding Questions
by thefiremind » 21 Mar 2014, 21:35
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.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.
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>
- 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>
< 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: 721 times
Re: General DotP 2014 Coding Questions
by 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.
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.
Re: General DotP 2014 Coding Questions
by RiiakShiNal » 03 Apr 2014, 22:35
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: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)?
- 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).
- 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.)
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"/>
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.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.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: General DotP 2014 Coding Questions
by 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.
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.
Re: General DotP 2014 Coding Questions
by RiiakShiNal » 04 Apr 2014, 12:20
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):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_...?
- "DATA_DLC_"
- "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.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: General DotP 2014 Coding Questions
by 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?
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
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: General DotP 2014 Coding Questions
by thefiremind » 21 Nov 2014, 22:05
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.Xander9009 wrote:Is there a limit to the number of activated abilities a card can have?
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...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Who is online
Users browsing this forum: No registered users and 18 guests