• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 The kongregate_shell.html [Solved]

Solvius

Member
Hello

I am trying to upload my game with the API from this site:

https://help.yoyogames.com/hc/en-us/articles/216753988-Integrating-The-Kongregate-API-In-HTML5-Games

I imported the extensioon, putted the codes at the right place and found the ( I think ) the right kongregate_shell.html file. I got it from someone and with his Gamemaker its working.

When I upload the kongregate_shell.html and the zipped files to kongregate then shell file is changed into index.html. Cuasing that the API is not loading.

This is the code inside the kongregate_shell.html

What is going wrong when by someone else its working correct, but I have problems?
I use GM S Proffesional Edition 1.4.1804 from Steam.

Code kongregate_shell.html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Kongregate Game Shell</title>

<!-- Load the Kongregate Javascript API -->
<script type="text/javascript" src="https://cdn1.kongregate.com/javascripts/kongregate_api.js"></script>

<!-- Give the shell no border/scroll bars and match the Kongregate background color.
If your game needs scrollbars, you might need to modify these styles -->
<style type="text/css">
html{border: none; overflow: hidden; background-color: #333; height: 100%;}
body{border: none; background-color: #333;margin:0; padding:0;}
</style>
</head>

<body>
<script type="text/javascript">
// Called when the API is finished loading
function onLoadCompleted(){
// Get a global reference to the kongregate API. This way, pages included in the
// iframe can access it by using "parent.kongregate"
kongregate = kongregateAPI.getAPI();

// Embed the game into the "contentdiv" div, which is defined below. You can also
// manually create your own iframe, this function is just for convenience.
// This example also passes along the kongregate user_id and game_auth_token so
// that the page can use them for authentication.
var params = "kongregate_user_id=" + kongregate.services.getUserId() +
"&kongregate_game_auth_token=" + kongregate.services.getGameAuthToken() +
"&random=" + (Math.random() * 1000000000);
kongregateAPI.embedFrame("index.html?" + params);
}

// Begin the process of loading the Kongregate API:
kongregateAPI.loadAPI(onLoadCompleted);
</script>

<!-- The div that the game will be placed into. Make sure to set the width and height properly -->
<div id="contentdiv" style="top:0px; left:0px; width:1044; height:788px; borders:none;">
<!-- You can manually put your game iframe in here instead of calling embedFrame above if you wish -->
</div>
</body>
</html>

Edit 1
I named the index.html in the Global Game Settings as name_game.html, changed the index.html in the shell.html to my game name and it worked.
 
Last edited:
Top