LackeyCCG

LackeyCCG Forum => Plugins & Plugin Creation Forum => Topic started by: dmenard on April 10, 2020, 04:56:59 PM

Title: Background not loading
Post by: dmenard on April 10, 2020, 04:56:59 PM
Hello, I am creating a new plugin that uses a gameboard and I cannot get the gameboard to load.

This is what my code looks like:

<pluginpreferences>

<counterstyleimagesizetextoverimage>16</counterstyleimagesizetextoverimage>
<counterstyleimagesizeimagesonly>18</counterstyleimagesizeimagesonly>
<recentskins>default</recentskins>
<recenttablebackgrounds>gameboardnba.jpg</recenttablebackgrounds>
<recentzonebackgrounds>wide.jpg</recentzonebackgrounds>
<canned>PoP? (Pass or Play?)</canned>
<canned>Pass.</canned>
<canned>Proceed.</canned>
<canned>Thinking....</canned>
<canned>Attack!</canned>
<canned>In response...</canned>
<canned>End of turn...</canned>
<canned>Done.</canned>
<canned>You done?</canned>
<canned>Mulligan.</canned>
<canned>MISE!</canned>
<canned>/draw7</canned>
<canned>/flip 1</canned>
<canned>/roll</canned>
<canned>/clear</canned>
<canned>/draw7</canned>
<canned>/rolld20</canned>
<canned>/draw6</canned>
<canned>/draw8</canned>
<canned>Good game.</canned>
<fontkind0pos0>Lato-Reg.ttf</fontkind0pos0>
<fontkind0pos1>times.ttf</fontkind0pos1>
<fontkind1pos0>Lato-Reg.ttf</fontkind1pos0>
<fontkind1pos1>times.ttf</fontkind1pos1>
<fontkind2pos0>Lato-Reg.ttf</fontkind2pos0>
<fontkind2pos1>times.ttf</fontkind2pos1>
<fontkind3pos0>Lato-Reg.ttf</fontkind3pos0>
<fontkind3pos1>times.ttf</fontkind3pos1>
<fontsize0>12</fontsize0>
<fontsize1>11</fontsize1>
<fontsize2>11</fontsize2>
<fontsize3>20</fontsize3>
<bindingmain0>CTRL+h</bindingmain0>
<bindingmain1>CTRL+j</bindingmain1>
<bindingmain4>CTRL+n</bindingmain4>
<bindingmain5>CTRL+s</bindingmain5>
<bindingmain6>CTRL+l</bindingmain6>
<bindingmain9>CTRL+f</bindingmain9>
<bindingmain15>CTRL+SHIFT+s</bindingmain15>
<bindinggeneral0>CTRL+o</bindinggeneral0>
<bindinggeneral1>CTRL+d</bindinggeneral1>
<bindinggeneral2>CTRL+LEFTBRACKET</bindinggeneral2>
<bindinggeneral3>CTRL+RIGHTBRACKET</bindinggeneral3>
<bindinggeneral4>CTRL+ALT+3</bindinggeneral4>
<bindinggeneral5>CTRL+ALT+4</bindinggeneral5>
<bindinggeneral6>CTRL+ALT+5</bindinggeneral6>
<bindinggeneral7>ALT+f</bindinggeneral7>
<bindingcard0>SHIFT+LESS</bindingcard0>
<bindingcard1>LESS</bindingcard1>
<bindingcard2>ALT+q</bindingcard2>
<bindingcanned0>CTRL+1</bindingcanned0>
<bindingcanned1>CTRL+2</bindingcanned1>
<bindingcanned2>CTRL+3</bindingcanned2>
<bindingcanned3>CTRL+4</bindingcanned3>
<bindingcanned4>CTRL+5</bindingcanned4>
<bindingcanned5>CTRL+6</bindingcanned5>
<bindingcanned6>CTRL+7</bindingcanned6>
<bindingcanned7>CTRL+8</bindingcanned7>
<bindingcanned8>CTRL+9</bindingcanned8>
<recentformat>2</recentformat>
<filterkeystroke>1</filterkeystroke>
<deckeditorloadtozoneiscollapse>0</deckeditorloadtozoneiscollapse>
<scalefactor>1.000000</scalefactor>
<zoomfactor>1.000000</zoomfactor>
<quickzoom>4.000000</quickzoom>
<isdownloadallmissing>1</isdownloadallmissing>

</pluginpreferences>


The file I am trying to use is in the same folder from where the wooden board is that I keep getting. Any help would be appreciated.



Title: Re: Background not loading
Post by: dmenard on April 10, 2020, 05:54:27 PM
I figured this out now I need help adding tokens to the game zone. I have the button created but how do I put tokens in it?
Title: Re: Background not loading
Post by: CrazyChucky on April 10, 2020, 08:07:12 PM
Tokens are added to Lackey along with your cards, in your card file(s). As long as you have a column named "Type", any card whose type starts with "Token" will be added to Lackey as a token. It won't appear in the deckbuilder, but will be accessible from the token tab on the right of the game table.

(http://magicplugin.normalitycomics.com/stuff/tokens-open-1-19-20.jpg)

(If it's not currently visible, click the + to expand it.)

(http://magicplugin.normalitycomics.com/stuff/tokens-closed-1-19-20.jpg)

You can also spawn a token by entering "/spawn name" in the chat console, where "name" is the name of the token. This can also be bound as a right-click script on a card, or as a canned message.
Title: Re: Background not loading
Post by: dmenard on April 16, 2020, 05:48:44 PM
Awesome thank you very much it worked.

I have one more question:

I am making another plugin that uses 3 separate decks that all players draw from during the course of gameplay.

Is there a way to make the interface where for every game the 3 decks and all of the cards that go with them automatically are available for both users? Like making separate tabs with the tokens but that act as decks that can be shuffled?
Title: Re: Background not loading
Post by: CrazyChucky on April 16, 2020, 07:19:03 PM
Absolutely! To set an initial state to load each time the game starts, check out Defining Initial Game Setups (https://lackeyccg.com/tutorialplugin.html#packs2).

Shared decks are explained under GameZones (https://lackeyccg.com/tutorialplugininfo.html#plugininfo6).

You can't put tokens in a deck, however. As soon as a token is moved anywhere except the table, it ceases to exist. If you need them in a deck, or to be able to shuffle them, you need to make them count as real cards for Lackey's purposes.
Title: Re: Background not loading
Post by: dmenard on April 17, 2020, 11:35:25 AM
That all worked perfectly! Thank you!

Last question (for now). How do I make an autoupdate url?
Title: Re: Background not loading
Post by: dmenard on April 17, 2020, 11:40:43 AM
Just saw your other post on this. I guess my question is could I have my plugin stored on like Google Drive and set the autoupdate to go from there?
Title: Re: Background not loading
Post by: CrazyChucky on April 17, 2020, 03:43:34 PM
That should work, as long as Google Drive gives you a URL that points directly to the file. That is, if you paste the URL in your browser and hit enter, you should see only a plain text file and nothing else. The URL to the Google Drive web page displaying the file, with info about it, etc. will not work.
Title: Re: Background not loading
Post by: dmenard on April 17, 2020, 11:17:16 PM
Google Drive did not appear to work. What method would you suggest for storing the files online?
Title: Re: Background not loading
Post by: CrazyChucky on April 18, 2020, 12:03:10 AM
Personally, I have a domain and hosting from Namecheap (http://namecheap.com). It doesn't cost that much, really.

But Google Drive should work. What URL are you trying? Google won't automatically give you a URL directly to the file, you have to put it together yourself. Here's a guide (https://www.labnol.org/internet/direct-links-for-google-drive/28356/) on how to do that.
Title: Re: Background not loading
Post by: dmenard on April 23, 2020, 12:41:27 PM
First link I tried was the general link that pops up when you select the document. That did not work. I was looking at the article you shared for the simple url tricks and they seem anything but simple to me.

I tried the Create Direct Download Links and Skip the Web Viewer portion of it, but the url I get looks nothing like the example that he gives in the article.

His sample looks like this: https://drive.google.com/open?id=DRIVE_FILE_ID

Mine looks like this: https://drive.google.com/file/d/16kNlXbQc9oMEmSZqDSdZNpKGGX2J2LAe/view?usp=sharing

I cant find how to customize my url to fit what his looks like which would be: https://drive.google.com/uc?export=download&id=DRIVE_FILE_ID
Title: Re: Background not loading
Post by: CrazyChucky on April 23, 2020, 01:41:24 PM
Oh my bad, it looks like Google has changed the format of the shareable link since that article was published. Thankfully, it looks like the same steps still apply.

Okay, so this is your URL: https://drive.google.com/file/d/16kNlXbQc9oMEmSZqDSdZNpKGGX2J2LAe/view?usp=sharing

It doesn't look exactly like the sample URL provided, but it still has an ID. The ID is that long string of numbers and letters: 16kNlXbQc9oMEmSZqDSdZNpKGGX2J2LAe

To make direct downloading possible, the guide says to use: https://drive.google.com/uc?export=download&id=DRIVE_FILE_ID

Take that URL and replace "DRIVE_FILE_ID" with your actual file ID: https://drive.google.com/uc?export=download&id=16kNlXbQc9oMEmSZqDSdZNpKGGX2J2LAe (https://drive.google.com/uc?export=download&id=16kNlXbQc9oMEmSZqDSdZNpKGGX2J2LAe)

That link should work (I tested the same process with a file on my Drive), but you need to make sure you've made the file publicly shareable. (When you generate the shareable link, make sure the dropdown says "Anyone with the link can view.") Whether I try the sharing link or the direct link, it says I need permission to access your file.
Title: Re: Background not loading
Post by: dmenard on April 23, 2020, 06:19:17 PM
Awesome, links are now working but now I can't generate valid checksums. Here is what my updatelist file looks like:

NFL Gametime 04-23-20
plugins/NFL Gametime/plugininfo.txt   https://drive.google.com/uc?export=download&id=16kNlXbQc9oMEmSZqDSdZNpKGGX2J2LAe   
plugins/NFL Gametime/sets/carddata.txt   https://drive.google.com/uc?export=download&id=1JopDJfx9efQNSnITdVuL4MrS2UXTl4mY
plugins/NFL Gametime/sets/setimages/general/cardback.jpg   https://drive.google.com/uc?export=download&id=1gsBo09yGrzeW8JLsmq-pDgv9WrVjpywL   
plugins/NFL Gametime/sets/setimages/general/spawned.jpg   https://drive.google.com/uc?export=download&id=17_CuoFD7Wy53ixSskWoUCGYOwI1ViAyG   
CardGeneralURLS:
https://drive.google.com/uc?export=download&id=16nhGCd4O2SCkuflIHxYQn46GpwguKIUG

When I generate checksums I just get 0s. What am I missing?
Title: Re: Background not loading
Post by: CrazyChucky on April 23, 2020, 08:24:54 PM
I take it you're following the directions in the plugin tutorial (https://lackeyccg.com/tutorialplugin.html), under "Generating Checksums"?

I'm not sure what could be going wrong. First of all?it is in fact creating the updatelistNEW.txt file? And that's where you're seeing the zeros?

One thing to try might be renaming your plugin's name and folder to not have any spaces. I'm not sure that spaces cause a problem, but perhaps try "nfl-gametime" and see if that makes a difference. The other thing to check would be verify for sure that those files are in fact in your plugin's folder where your updatelist says they are.
Title: Re: Background not loading
Post by: dmenard on April 24, 2020, 12:56:36 PM
Yes I am have been referring back to that page.

Thank you! that was the first piece putting the dash in the plugin title. It is generating checksums for all of my .txt files, but I keep getting an error and a 0 for my checksum for the cardback and the spawned image.

Also I have read through this part a bunch of times but still confused on the card images. Do I need to have all of my images uploaded online with a link to them in the update list? I have over 1,000 images what would be the best way to put them into the updatelist?
Title: Re: Background not loading
Post by: CrazyChucky on April 24, 2020, 01:41:16 PM
Yay, progress!

I'm stumped as to why it would work for your text files, but not your images. You're sure they're in plugins/NFL-Gametime/sets/setimages/general/ ? If you want to attach a zip file of your whole plugin folder, I could take a look and see if I notice something.

You have three (sort of two-and-a-half) options for telling Lackey where to download your plugin files.

As far as I know, you can't use the last method with Google Drive. Even if you set your CardGeneralURL as "https://drive.google.com/uc?export=download&id=", and you set each card's imageFile to the long string of characters that represent its ID, Lackey would still attach ".jpg" to the end and it wouldn't work. (And even if it did, it would still be just as much copying and pasting as using either of the first two methods.)

Have you looked into other file-hosting locations? Perhaps Github? It's possible they might check content and get upset about hosting copyrighted images... but they do let you access your files with actual URLs that aren't made of alphabet soup.
Title: Re: Background not loading
Post by: dmenard on April 28, 2020, 06:59:43 PM
I uploaded all of my images to dropbox. I have attached my update list file. I have not added in the stuff for dropbox yet. Let me know if you see where I went wrong.
Title: Re: Background not loading
Post by: dmenard on April 28, 2020, 07:02:00 PM
Sorry missed the first part of your last post. All under set images I have 4 folders they are, general, base, 19, 20. I believe they are in the proper location unless I missed something with how they are ordered.
Title: Re: Background not loading
Post by: CrazyChucky on April 28, 2020, 07:17:04 PM
Ah, I see the issue now. The plugin tutorial mentions: "Before a proper checksum is generated, just include any number as a placeholder checksum." Just stick a zero (or something) at the end of each line (after a tab):

plugins/NFL-Gametime/plugininfo.txt https://drive.google.com/uc?export=download&id=1QYi6bonq5zgBtze4q4x4jdkejJheAHE- 0
plugins/NFL-Gametime/pluginpreferences.txt https://drive.google.com/uc?export=download&id=1gkDAiNTEivXVwh02ryt8KbUS3DYKPG8q 0
plugins/NFL-Gametime/sets/carddata.txt https://drive.google.com/uc?export=download&id=1JopDJfx9efQNSnITdVuL4MrS2UXTl4mY 0
plugins/NFL-Gametime/sets/setimages/general/cardback.jpg https://drive.google.com/uc?export=download&id=1aCkH7ARuuutsAlAjPQZfxnMdpU3_rFx7 0
plugins/NFL-Gametime/sets/setimages/general/spawned.jpg https://drive.google.com/uc?export=download&id=1_wzAag3Rg5i_LJ_RNH7DWzMJi3H523gd 0


(If you notice, the messages Lackey prints when you run the checksum command on your current file indicate that it's jumping ahead to the next line too early in search of that final column. It thinks, for instance, that 'plugins/NFL-Gametime/pluginpreferences.txt' is the checksum for your plugininfo.txt. Then it says it can't find a local file named 'https://drive.google.com/uc?export=download&id=1gkDAiNTEivXVwh02ryt8KbUS3DYKPG8q'.)

Does DropBox give you predictable URLs for file access? If so, that's good to know about. I haven't tried it out.