Kongregate API for Love2D? WHAT!

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
TheP3
Citizen
Posts: 62
Joined: Tue Dec 20, 2011 9:20 pm

Kongregate API for Love2D? WHAT!

Post by TheP3 » Sat Aug 25, 2012 12:27 am

Ok,



So, I kinda did it… Almost all the functions are really buggy… That is why I’m sharing it so people can help fix it! It needs a server to host the application because it’s Love2D WebPlayer. The game is displayed by index.html. Just past all your lua files in the in the root directory> Upload to server> use IFRAM and enter server url > Test on Kongregate website> ???? > Win! lol



Side Note: Only the game and functions will work if you have uploaded to Kongregate. Don’t worry you don’t have to publish it, you can test it and all that good stuff.

The API code is in js/KongregateAPI/LuaWebKongregateAPI.js

Link: https://www.dropbox.com/s/h5b9xq1lpz26a ... ongapi.zip PLEASE SHARE ANY CODE YOU CHANGE!

NateAGeek
I write rules for my computer... I'm not the ruler of the world(yet)... Also, I livestream stuff http://NateAGeek.com/Live

User avatar
Puzzlem00n
Party member
Posts: 171
Joined: Fri Apr 06, 2012 8:49 pm
Contact:

Re: Kongregate API for Love2D? WHAT!

Post by Puzzlem00n » Sat Aug 25, 2012 3:41 am

This is a good idea. I'll try it when the compo is over!
I LÖVE, therefore I am.

User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Kongregate API for Love2D? WHAT!

Post by Nixola » Sat Aug 25, 2012 8:43 am

Does it have love.audio and love.sound?
EDIT: I get a blue square/rectangle with every game, using Chrome on Windows 7. Console outputs:

Yifct:

Code: Select all

warning:kDefaultImageFontURL not set for this hostname/path (needed for cross-domain image-load), default font disabled main.js:61
Uncaught ReferenceError: Love_KongregateAPI_Init is not defined main.js:493
MainRunAfterPreloadFinished main.js:493
PreLoadImageFinishOne main.js:486
MainOnLoad.img.onload main.js:469

Clouds:

Code: Select all

Uncaught SyntaxError: Unexpected token < /not_found.html:1
warning:kDefaultImageFontURL not set for this hostname/path (needed for cross-domain image-load), default font disabled main.js:61
Uncaught ReferenceError: Love_KongregateAPI_Init is not defined main.js:493
No:

Code: Select all

warning:kDefaultImageFontURL not set for this hostname/path (needed for cross-domain image-load), default font disabled main.js:61
Uncaught ReferenceError: Love_KongregateAPI_Init is not defined main.js:493
MainRunAfterPreloadFinished main.js:493
PreLoadImageFinishOne main.js:486
MainOnLoad.img.onload main.js:469
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

User avatar
TheP3
Citizen
Posts: 62
Joined: Tue Dec 20, 2011 9:20 pm

Re: Kongregate API for Love2D? WHAT!

Post by TheP3 » Sat Aug 25, 2012 12:56 pm

Nixola wrote:Does it have love.audio and love.sound?
EDIT: I get a blue square/rectangle with every game, using Chrome on Windows 7. Console outputs:

Yifct:

Code: Select all

warning:kDefaultImageFontURL not set for this hostname/path (needed for cross-domain image-load), default font disabled main.js:61
Uncaught ReferenceError: Love_KongregateAPI_Init is not defined main.js:493
MainRunAfterPreloadFinished main.js:493
PreLoadImageFinishOne main.js:486
MainOnLoad.img.onload main.js:469

Clouds:

Code: Select all

Uncaught SyntaxError: Unexpected token < /not_found.html:1
warning:kDefaultImageFontURL not set for this hostname/path (needed for cross-domain image-load), default font disabled main.js:61
Uncaught ReferenceError: Love_KongregateAPI_Init is not defined main.js:493
No:

Code: Select all

warning:kDefaultImageFontURL not set for this hostname/path (needed for cross-domain image-load), default font disabled main.js:61
Uncaught ReferenceError: Love_KongregateAPI_Init is not defined main.js:493
MainRunAfterPreloadFinished main.js:493
PreLoadImageFinishOne main.js:486
MainOnLoad.img.onload main.js:469

Ok, sorry I made a derp... 9_6

I deleted the fontimage... So, no font. lol

fixed it. same url as above...

also the Kong api is called by love.knogAPI.Kongregate API function()

Last, make sure you are running on Knogregate Website!
I write rules for my computer... I'm not the ruler of the world(yet)... Also, I livestream stuff http://NateAGeek.com/Live

User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Kongregate API for Love2D? WHAT!

Post by Nixola » Sat Aug 25, 2012 1:13 pm

Do I have to host it there or what?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

User avatar
TheP3
Citizen
Posts: 62
Joined: Tue Dec 20, 2011 9:20 pm

Re: Kongregate API for Love2D? WHAT!

Post by TheP3 » Sat Aug 25, 2012 2:45 pm

Nixola wrote:Do I have to host it there or what?
You have to host it on YOUR server, then upload it as an Iframe(with server URL/IP) to Kongregate... Sucks I know... But only way... If you can find a free site to host the files please let us know!
I write rules for my computer... I'm not the ruler of the world(yet)... Also, I livestream stuff http://NateAGeek.com/Live

User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Kongregate API for Love2D? WHAT!

Post by Nixola » Sat Aug 25, 2012 2:50 pm

I already use http://www.altervista.org, it's an italian site but it should have the English language; when you register you have 500MB storage, 10GB bandwidth/month and a database with a power of 15'000 queries/hour, everything for free if you choose to create a site like "yourdomain.altervista.org"
EDIT #3: You can also upload files (but not folders) via HTTP or anything (a folder and all its contents, including subfolders, etc) through FTP

EDIT: If you don't want to register there I can upload anything you want on my site

EDIT #2: How can I upload it there as an iframe and as a "private" game, without other people seeing it?

EDIT #3:
Sucks I know...
Since I already have my site on Altervista I prefer it this way, 'cause I'm used to its interface
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

User avatar
TheP3
Citizen
Posts: 62
Joined: Tue Dec 20, 2011 9:20 pm

Re: Kongregate API for Love2D? WHAT!

Post by TheP3 » Sat Aug 25, 2012 3:03 pm

Nixola wrote:I already use http://www.altervista.org, it's an italian site but it should have the English language; when you register you have 500MB storage, 10GB bandwidth/month and a database with a power of 15'000 queries/hour, everything for free if you choose to create a site like "yourdomain.altervista.org"
EDIT #3: You can also upload files (but not folders) via HTTP or anything (a folder and all its contents, including subfolders, etc) through FTP

EDIT: If you don't want to register there I can upload anything you want on my site

EDIT #2: How can I upload it there as an iframe and as a "private" game, without other people seeing it?

EDIT #3:
Sucks I know...
Since I already have my site on Altervista I prefer it this way, 'cause I'm used to its interface
Well, you don't have to publish it. Kongregate allows you to test it before upload! Also, clear your cache because Love2D WebPlayer cache your project most of the time. So, updates will not show.
I write rules for my computer... I'm not the ruler of the world(yet)... Also, I livestream stuff http://NateAGeek.com/Live

User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Kongregate API for Love2D? WHAT!

Post by Nixola » Sat Aug 25, 2012 3:10 pm

Nothing new then, I've to do that with Altervista too :crazy:

EDIT: I tried to run my Play! with the webplayer... Here's the console output:

Code: Select all

kongregate log initialized.
OS: Windows 7, 1280x1024, current version: WIN 11,3,31,227
Konduit initialized
Uncaught SyntaxError: Unexpected token < www.facebook.com/foobar:1
kongregate log initialized.
OS: Windows 7, 1280x1024, current version: WIN 11,3,31,227
[Ansible] Initialized, loading API
[Game] Creating services...
[Game] MessageConnection init, dynamic_names=true
[Game] Listening for connection...
[Game] Bridge created, name=ansible, using JSON=true
[Game] MessageConnection established for Game!
Unsafe JavaScript attempt to access frame with URL http://www.kongregate.com/games/Nixola/love-test_preview from frame with URL http://firepx.altervista.org/giochi/LoveWebApi/game.php. Domains, protocols and ports must match.
 cdn1.kongregate.com/javascripts/kongregate_api.js:23
LoveFileList filelist.php main.js:61
profile:115 msec: LoveFileList:download:filelist.php main.js:61
warning:kDefaultImageFontURL not set for this hostname/path (needed for cross-domain image-load), default font disabled main.js:61
browser: firefox,chrome= false true main.js:61
profile:536 msec: RunLuaFromPath:download:conf.lua main.js:61
profile:160 msec: RunLuaFromPath:download:main.lua main.js:61
[Game] No message received for 10055ms, refreshing connection
profile:251 msec: love.load main.js:61
29N lua-parser.js:19
[Game] No message received for 20849ms, refreshing connection
N lua-parser.js:19
[Game] Close failed: ArgumentError: Error #2083 -> Opening another connection.
25N lua-parser.js:19
[Game] No message received for 28030ms, refreshing connection
28N lua-parser.js:19
[Game] No message received for 37080ms, refreshing connection
N lua-parser.js:19
[Game] Close failed: ArgumentError: Error #2083 -> Opening another connection.
78N lua-parser.js:19
[Game] No message received for 15219ms, refreshing connection
N lua-parser.js:19
[Game] Close failed: ArgumentError: Error #2083 -> Opening another connection.
31N lua-parser.js:19
[Game] No message received for 24033ms, refreshing connection
N lua-parser.js:19
[Game] Close failed: ArgumentError: Error #2083 -> Opening another connection.
24N lua-parser.js:19
8N lua-parser.js:19
[Game] No message received for 36068ms, refreshing connection
[Game] Close failed: ArgumentError: Error #2083 -> Opening another connection.
32N lua-parser.js:19
[Game] No message received for 47067ms, refreshing connection
N lua-parser.js:19
[Game] Close failed: ArgumentError: Error #2083 -> Opening another connection.
254N lua-parser.js:19
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics

User avatar
TheP3
Citizen
Posts: 62
Joined: Tue Dec 20, 2011 9:20 pm

Re: Kongregate API for Love2D? WHAT!

Post by TheP3 » Sun Aug 26, 2012 6:09 pm

Nixola wrote:Nothing new then, I've to do that with Altervista too :crazy:

EDIT: I tried to run my Play! with the webplayer... Here's the console output:

Code: Select all

kongregate log initialized.
OS: Windows 7, 1280x1024, current version: WIN 11,3,31,227
Konduit initialized
Uncaught SyntaxError: Unexpected token < www.facebook.com/foobar:1
kongregate log initialized.
OS: Windows 7, 1280x1024, current version: WIN 11,3,31,227
[Ansible] Initialized, loading API
[Game] Creating services...
[Game] MessageConnection init, dynamic_names=true
[Game] Listening for connection...
[Game] Bridge created, name=ansible, using JSON=true
[Game] MessageConnection established for Game!
Unsafe JavaScript attempt to access frame with URL http://www.kongregate.com/games/Nixola/love-test_preview from frame with URL http://firepx.altervista.org/giochi/LoveWebApi/game.php. Domains, protocols and ports must match.
 cdn1.kongregate.com/javascripts/kongregate_api.js:23
LoveFileList filelist.php main.js:61
profile:115 msec: LoveFileList:download:filelist.php main.js:61
warning:kDefaultImageFontURL not set for this hostname/path (needed for cross-domain image-load), default font disabled main.js:61
browser: firefox,chrome= false true main.js:61
profile:536 msec: RunLuaFromPath:download:conf.lua main.js:61
profile:160 msec: RunLuaFromPath:download:main.lua main.js:61
[Game] No message received for 10055ms, refreshing connection
profile:251 msec: love.load main.js:61
29N lua-parser.js:19
[Game] No message received for 20849ms, refreshing connection
N lua-parser.js:19
[Game] Close failed: ArgumentError: Error #2083 -> Opening another connection.
25N lua-parser.js:19
[Game] No message received for 28030ms, refreshing connection
28N lua-parser.js:19
[Game] No message received for 37080ms, refreshing connection
N lua-parser.js:19
[Game] Close failed: ArgumentError: Error #2083 -> Opening another connection.
78N lua-parser.js:19
[Game] No message received for 15219ms, refreshing connection
N lua-parser.js:19
[Game] Close failed: ArgumentError: Error #2083 -> Opening another connection.
31N lua-parser.js:19
[Game] No message received for 24033ms, refreshing connection
N lua-parser.js:19
[Game] Close failed: ArgumentError: Error #2083 -> Opening another connection.
24N lua-parser.js:19
8N lua-parser.js:19
[Game] No message received for 36068ms, refreshing connection
[Game] Close failed: ArgumentError: Error #2083 -> Opening another connection.
32N lua-parser.js:19
[Game] No message received for 47067ms, refreshing connection
N lua-parser.js:19
[Game] Close failed: ArgumentError: Error #2083 -> Opening another connection.
254N lua-parser.js:19

Did you try it without the Knog API? Link for fresh love2D webplayer: https://github.com/ghoulsblade/love-webplayer/downloads
Did it work, if not, that means it an error code wise, not the knog API or love2D webplayer...

If it did, It's most likely IFRAME do not allow stuff to load after the page has loaded, unless protocols, url, ect, match. So, stuff is just not loading...

Sorry, reallly don't know what to tell you...
I write rules for my computer... I'm not the ruler of the world(yet)... Also, I livestream stuff http://NateAGeek.com/Live

Post Reply

Who is online

Users browsing this forum: No registered users and 49 guests