Page 2 of 5

Re: DotP Universal Generator

PostPosted: 25 Sep 2014, 13:48
by Xander9009
Okay. That makes sense. What about one language having more abilities than another?

Anyway, two other things. One: Hall of the Bandit Lord also messed up. Many of the languages were put entirely into the first ability. Unfortunately, that's how it appears on Gatherer, so there's no good way to deal with that, but I thought I'd mention it anyway.

Two: For Chinese and Hong Kong Chinese, if only one is missing, I think it would be better to use the other rather than English. It probably won't matter, 'cause I don't think many people who read either language will be playing our mods, but if it would be an easy change, then why not? Unfortunately, when I was messing with the python files, I never really looked into the input one too much.

Re: DotP Universal Generator

PostPosted: 17 Oct 2014, 22:43
by Xander9009
Hey, so I've finally gotten around to trying out the batch processing with more than just one or two cards (I did that when I first downloaded it just to try it out). Just wanted to say thanks again. It helped easily add 460 cards to the CW. (Also, I credited you as a creator on those along with myself since you made the tool to produce the cards and I made the tool to isolate every card which can fully coded by it. :) )

Re: DotP Universal Generator

PostPosted: 28 Oct 2014, 13:43
by Xander9009
Hey TFM. I've gotten back around to expanding the generator's coding ability. I'm currently tackling abilities that are the same on all cards but differ slightly because they use the card's name, e.g. "Akoum Refuge enters the battlefield tapped."

I replace the card's name in the ability text with "ENGLISHCARDNAME". This standardizes the ability text, making the dictionary approach used on other abilities possible. The dictionary doesn't contain the localized text, though, since it differs from card to card. Instead, each ability with the card name has "<!--LOCALIZEDTEXT-->", instead. Then, it returns the ability like normal if it doesn't have the placeholder localized text. If it does contain it, it replaces that placeholder with the localized text extracted from the card (like when it can't find the ability at all).

It currently only adds "enters the battlefield tapped", "can't be countered (by spells and abilities)", "can't block", and "can't be blocked". Can you (or anyone else seeing this) think of similar abilities?

Also, I've got an issue with Outlast that I can't quite figure out. I've added outlast to the list of abilities, but it uses the <!--LOCALIZEDTEXT--> placeholder from above as well as <!--COST--> so I can insert the cost. It works, but ONLY if I remove the '$' from the search pattern. In other words, this doesn't match Outlast:
Code: Select all
# search for simple templates
   for sPattern, sTemplate in dicSimpleTemplates.iteritems():
      moMatch = re.search('^' + sPattern + '$', sEnglishText)
      if moMatch:
but this does
Code: Select all
# search for simple templates
   for sPattern, sTemplate in dicSimpleTemplates.iteritems():
      moMatch = re.search('^' + sPattern, sEnglishText)
      if moMatch:
Outlast's entry in the dictionary is this:
Code: Select all
(r'Outlast\W',
r"""<ACTIVATED_ABILITY>
<!--LOCALIZEDTEXT-->      <AVAILABILITY sorcery_time="1" />
<!--COST-->      <RESOLUTION_TIME_ACTION>
         if EffectSource() ~= nil then
            EffectSource():AddCounters( MTG():PlusOnePlusOneCounters(), 1)
         end
      </RESOLUTION_TIME_ACTION>
   </ACTIVATED_ABILITY>""")
This is an entry in the simple templates dictionary (the one with the other normal abilities). This means that I can't just remove '$' without allowing it to possibly incorrectly match abilities in other circumstances. Do you know of a way to alter Outlast's dictionary entry such that
Code: Select all
re.search('^' + sPattern + '$', sEnglishText)
will match it? I tried making its dictionary entry
Code: Select all
r'Outlast\W' + '$'
and
r'Outlast\W$'
but neither one worked. I don't know enough about python's strings to get it to work. I looked into it, but obviously I haven't found a solution. At worst, I can repeat the search in a completely different section of code, leaving the bit that matches endlines alone, but it would be much simpler to just do it all at once (assuming there's a way to make outlast match '^' + sPattern + '$').

Re: DotP Universal Generator

PostPosted: 04 Mar 2015, 19:16
by Xander9009
Please be aware the original DotP2014Output.py file gives the Swampwalk ability to creatures which should be granted Mountainwalk. Corrected version is here. I've also updated my modified file back here.

Re: DotP Universal Generator

PostPosted: 02 Apr 2015, 22:53
by sweetLu
I've modified the original DotP2014Output.py file to be more suitable for making cards associated with the Community Wad. This version will generate a card template that is more consistent with Community Wad conventions. I started with thefiremind's version because I didn't realize Xander had an alternate version. Here is what this version does differently:
  • The generator will now add "CW" to the card filename in the appropriate place
  • I pseudo-disabled the prefix option. You can put in your own prefix but the card generator will not apply a prefix to the filename, multiverse ID and art ID.
  • Adds CW before the art ID
  • Adds author, editors and date (including current date) nodes to the bottom of the card
  • Includes the Mountainwalk correction as pointed out by Xander

With the version included in the attachment 'username' will be added in the author and editors tags. If you would like edit the .py file and do a find/replace all for 'username' and your handle. Ideally we could modify the executable to add a username text box, similar to the prefix ID, so you would not have to modify the output file plugin. But I do not think we have access to the source and I am grateful for thefiremind as he at least gave us the option for custom plugins.

If you run into issues let me know :)

Re: DotP Universal Generator

PostPosted: 02 Apr 2015, 22:55
by Xander9009
Why not try using the prefix box, which now does nothing, as the username?

Re: DotP Universal Generator

PostPosted: 02 Apr 2015, 23:21
by sweetLu
That's a great idea I didn't think of that. Unfortunately the prefix box is a number field and not a text field so it cannot accept a username :/.

Re: DotP Universal Generator

PostPosted: 02 Apr 2015, 23:27
by Xander9009
I thought that might be the case.

In that case, you should be able to use a username variable, instead. It'll never need to be modified, so just declaring it outside of any class (such as at the very beginning of the script, right after the imports) would make it at least so only once instance needs modified.

Re: DotP Universal Generator

PostPosted: 22 Jul 2015, 19:22
by Xander9009
I'd put this in the web generator's thread by accident before, so I'll repost it here.

I've updated my modified output file. It can now handle entering the battlefield with counters. The counter list is hard coded, but VERY easily expandable (add the name to a list and it's done). It handles the number from "a" for one up to "ten". It technically isn't coded to handle, for instance "an ice counter". But there are no cards currently that enter with a single counter starting with a vowel.

It is currently coded for 'charge', 'credit', 'dream', 'echo', 'fade', 'gem', 'healing', 'ice', 'intervention', 'net', 'omen', 'ore', 'shell', 'time', and 'wish' counters, as well as '+1/+1', '+1/+0', '+0/+1', and '-1/-1'. It doesn't do '-1/-0', '-0/-1', or any combinations of positive and negative.

It will handle the registration, and it can also handle 'X counters'. However, the X is always assumed to be GetPaidX(). There is a comment warning the author to check the proliferate value in case the counter is bad (unneeded for -1/-1), and another comment to check that GetPaidX() is right if it's used.

Tested with
Briber's Purse
Carnifex Demon
Orochi Hatchery
Trigon of Corruption
All worked as they should.

EDIT: Hey TFM, did you ever notice the mountainwalk/swampwalk issue? (I don't know if you saw it and didn't care or just didn't see it, or already fixed it, so I just wanted to point it out...)

Re: DotP Universal Generator

PostPosted: 23 Jul 2015, 04:39
by Xander9009
The links aren't working for me. Says file has expired and no longer exists.

Re: DotP Universal Generator

PostPosted: 23 Jul 2015, 08:43
by thefiremind
Thanks for letting me know: I updated the links. The new ones should last forever, in theory.

EDIT: I forgot to ask:
Xander9009 wrote:EDIT: Hey TFM, did you ever notice the mountainwalk/swampwalk issue? (I don't know if you saw it and didn't care or just didn't see it, or already fixed it, so I just wanted to point it out...)
What issue are you talking about?

Re: DotP Universal Generator

PostPosted: 23 Jul 2015, 11:42
by Xander9009
Fair warning, I'm not sure the exact cause, but Chrome blocks the download. It thinks it's malware. You have to disable malware and phishing protection in the settings temporarily. (This is less for you than for others downloading it.)

Re: DotP Universal Generator

PostPosted: 23 Jul 2015, 12:02
by thefiremind
Xander9009 wrote:Fair warning, I'm not sure the exact cause, but Chrome blocks the download. It thinks it's malware. You have to disable malware and phishing protection in the settings temporarily. (This is less for you than for others downloading it.)
I can only guess that Chrome doesn't like Mega's file encryption. I added alternative links, but since they are on Zippyshare, they'll expire after 30 days of inactivity (whereas Mega links probably will never expire).

Re: DotP Universal Generator

PostPosted: 23 Jul 2015, 13:23
by Xander9009
thefiremind wrote:
Xander9009 wrote:Fair warning, I'm not sure the exact cause, but Chrome blocks the download. It thinks it's malware. You have to disable malware and phishing protection in the settings temporarily. (This is less for you than for others downloading it.)
I can only guess that Chrome doesn't like Mega's file encryption. I added alternative links, but since they are on Zippyshare, they'll expire after 30 days of inactivity (whereas Mega links probably will never expire).
I doubt it's that it's from Mega. CCGHQ picture downloads are now hosted on Mega and they don't have an issue. However, one of the criteria for being labeled malware is that it's not a file that is downloaded often. So, it's possible that warning will disappear once a few people download it.

Re: DotP Universal Generator

PostPosted: 26 Jul 2015, 14:13
by killkong1211
For some reason my copy isn't detecting plugins.
Any insight guys?