Gamehouse and QuickLua

The nice people at MadeWithMarmalade are running a promotion with gamehouse where if you integrate their game network promotion api you win money and a Marmalade license extension. There are some stiff requirements (at least for me and my apps) to get the incentives, but I decided to integrate a couple of my apps just to see what it was like (and because I am on vacation with nothing to code). What I found out is that unlike most tap or impression exchanges, gamehouse will show your app thousands a time a day for free (at least during their beta period).

Two of the apps I integrated gamehouse with are written in C++ (what all the instructions are written for), but one of my app I used Marmalade’s Lua api. What follows is how I got the gamehouse extension working with my Lua project.

1. Download the gamehouse Marmalade extension from here:  http://gpn.gamehouse.com/sdk

2. Once the sdk is unzipped copy the gamehouse folder to the extension folder inside your marmalade folder. In my case that is: C:\Marmalade\7.1\extensions.

3. Modify your project .mkb to include the gamehouse extension in the sub-project section. Your subproject section should look like this (unless you have added other projects):

options
{
s3e-data-dir = resources
app-icf = ‘resources/common.icf,resources/app.icf’
}

subproject
{
gamehouse/gpn
}

4. Download the files located here: https://devnet.madewithmarmalade.com/questions/18739/gamehouse-and-quick-integration.html.

Place the header file in the header folder. On my machine it is located here: C:\Marmalade\7.1\quick\include.

And the source file here: C:\Marmalade\7.1\quick\source

5. Modify quickuser.mkf located here: C:\Marmalade\7.1\quick

By adding  the two files you just added. It should look something like this after your changes.

includepath .

files
{
quickuser_tolua.cpp
quickuser_tolua.pkg
quickuser.h

#Gamehouse c++ files.
include/CGGameHouse.h
source/CGGameHouse.cpp
}

6. Modify quickuser_tolua.pkg also located here: C:\Marmalade\7.1\quick by adding the reference to the header file. Your file should look something like this:

//——————————————————————————
// Mark-up in header files
//——————————————————————————
$cfile “quickuser.h”
$cfile “include/CGGameHouse.h”

7. Run the quickuser_tolua.bat file. According to the documentation it should be located here: C:\Marmalade\7.1\quick. Unfortunately I have not seen it in a few releases. If you don’t have it either copy it from the same folder but the 6.4 install (the last version that had it for me).

8. At this point you can either open the quick_prebuilt.mkb or any of your Quick project in Visual Studio and compile it using the x86 Debug target.

9. From within your Lua project now you should be able to initialize gamehouse by calling:

gameHouse.initGameHouse(“yourGameHouseAppKey”)

and request the display of the ad by calling:

gameHouse.presentAd()

10. Remember to add the required items for the particular platform you are deploying it to. For example for Android you need to add the required activity to the android manifest file. Instructions can be found in the gamehouse integration document found in this thread: https://devnet.madewithmarmalade.com/questions/18456/how-can-i-integrate-the-gamehouse-extension.html

That is all, if you run into problems let me know and I’ll try to help. I am back to bill paying work after the new year.

Advertisements