COGdemo update not working

I’m having trouble with my first update to my COGdemo WIP. CoGDemos

The error I’m getting is: It is working just fine in CSIDE. But when I made my first monthly update to COGdemo, adding in my new files and uploading the modified ones, I get:
choicescript_stats line 1: Non-existent variable ‘energy’

Energy is created at in my Startup file. And it is the first variable looked at in the choicescript_stats.txt.

So whenever I load the game, and click on Show Stats, it breaks. It ALSO broke in the same way for me when I went from the first to the second chapter - but my friend did not have that problem. ???

Anything non-obvious here? I also tried deleting those two files and uploading them from scratch. No dice.

1 Like

If you already have opened the link to the game before, most probably the browser holds a copy of the files locally, so when you update new files on the site, sometimes the browser doesn’t update the files of the playtest and then you get problems.

Most times you can solve those issues with a hard refresh (usually control + F5, it depends on the browser I guess, I don’t know them all) You can also check the scenes to see if what you’re looking at is the last ones you uploaded.

2 Likes

I think that did it. Thank you!

@Loudbeat And now half the images are not resolving. Any thoughts on how to debug that one?

Go to the uploaded files and check they are okay and that the server has the ones that you meant to upload. If the command is there and the image is uploaded, then it should work.
Otherwise, I don’t know. I’ve had a few problems with that site also, but my problem was with achievements, and usually it fixes by doing the hard refresh.

@Loudbeat Ah! I see now I can download to view - that is what I missed, but now I can debug. Thank you!

So consistently the image is fine before I upload it but once I upload it, then view it, it has Zero bytes. Any thoughts on what might be messing up the upload?

Well. format, server, naming restrictions, bandwidth, browser. Try changing some and see what happens.

Thanks. Know if there is a bandwidth limit or what the naming restrictions are?

Not a limit, but if something goes too slow or there is some disturbance in between it can triggrt a timed out or something. I don’t know, I’m just guessing, but many things can happen. About naming I don’t know, that’s server dependent, but maybe some symbols or weird thing might cause problems (though I doubt it is that).

Try changing the browser or converting the image or open it and save it with another program, those things can make weird sh#t with files.

1 Like

It looks like it’s the file size - I am making it smaller and so far so good. Thank you!

Yeah, no problem, file size is limited to 2MB per image I think, that’s stated on the page if I remember correctly.

Keep in mind that’s only a limit for the COGdemos site and dashingdon. Images submitted to HG or COG don’t have that limit.

1 Like

Good to know! My entire story is about a character TAKING photos - so if they don’t show up it will be less than ideal. :slight_smile:

1 Like

I believe there’s some limitations on how big the total size of files in the game can be for published games (because the download can’t get too big), but don’t quote me on that.

Well, Adding up all the assets without counting the splashscreen and promo art, in full resolution I’m shy above 120MB :smiling_face_with_tear:

Hi folks. I hope you are well. I am having trouble with the latest monthly update to CoGDemo for Exit Through the Gift Shop.

In Chrome, I can get to the next to LAST page, when it says:

chapter1 line 1340: the achievement name albumstarted was not declared as an *achievement in startup

The variable albumstarted IS define in startup. I changed the name a few times to see if that did it, I changed the order of the achievements in startup, and no luck. The other achievements seem to work, and I am using the same code (at least I think so). Also, when I run it in CSIDE it works just fine. Any ideas?

When I START it in Firefox it immediately breaks. It says:

check_gender line 20: Non-existent variable ‘pc_he’

This is not a problem in Chrome nor CSIDE. And, yes, this variable is defined in startup. Any thoughts?

Sounds like this issue, have you cleared your cache in last 28 days?

Thanks - that’s one the first lessons I learned in this thread. So every time I upload a new version of the file to the server I clear the cache before loading it to the browser. :frowning:

I have tried to debug this. Removing the code and retyping it did not work. Removing it, copying existing code, and retyping it did not work.

This is where it gets interesting

Changing the order worked - the one that failed, when it was no longer the last one listed in startup, now works - but then the one that moved into last place stopped work. This broken one had been working all along.

How bizarre.

So I added a NEW last achievement in Startup. I kept it hidden and named it “debugging” and left it hidden. SO FAR the other achievements are now working

Anyone have any ideas about what might be going on?

@Barry_Joseph

The problem is that the code was set to save where the player left off, even when they close their browser. Unfortunately, it had no way of reloading startup.txt, so if anything was changed–i.e., new variables were added or achievements were enabled–it didn’t recognize them.

After talking to @Havenstone, I went ahead and pulled a branch that disables the code where it saves the player’s last spot in the game. It reloads everything and forces them to restart the game from the beginning (just like it does on dashingdon).

The dev has a fix for this that requires authors to create a mygame.js file (which is how Steam works and, had I to bet, how the web app works as well). I haven’t tested it yet (I decided to take a break over the holidays, both from work and from dealing with cogdemos code) but will try to do so tonight, after work. If it works, we’re going to code another button in the dashboard that will create the file for the author–they’ll have to do this any time they change startup.txt to make sure all variables exist in the js file. But we’ll worry about that when we get there!

Long story short, you should be good to go now.

2 Likes

@EvilChani Thank you so much! I appreciate learning this and all the work you did.

Is this a different problem or related to the one I experience only in Firefox: “check_gender line 20: Non-existent variable ‘pc_he’”?

1 Like