Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [Unofficial][Tier 3] AGK - Lua

Author
Message
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 28th Feb 2016 22:39
Hi guys,

I have spent some time on making a "Tier 3" (unofficial) which allows you to use Lua to make a game with AGK. Currently this is based on AppGameKit Version 2.0.14b; but if people are interested in this I will keep it up to date with latest version of AGK.

So far I have only tested this on Windows, however since both Lua and AppGameKit are cross-platform this should work just fine with every platform that AppGameKit supports.

At the moment the only way to try this is to compile the ".exe" yourself, that way it ensures that you actually own AGK. Maybe Paul or Rick will allow me to release a precompiled "demo" version that auto-closes after a few minutes that way people can at least try it before compiling it (though compiling it should not be very difficult).

The source/necessary files can be found here: https://github.com/SeanReg/AGK---Lua if you are not familiar with GitHub you can directly download the files from this link here: https://github.com/SeanReg/AGK---Lua/archive/master.zip


It also comes with two example games which are converted examples from AppGameKit Tier 1. They are:
SnakeSnacker - By Rick Vanner
SmackIt - By The Game Creators (not sure who the programmer is)

Below are some setup instructions:

Setup

Simply download/pull the files and place them into your AppGameKit Native folder.

Open the Template.sln and compile the project (using Visual Studio 2013, but it should work fine with Visual Studio 2015)

Upon a successful compilation a "Template.exe" will appear in the "Final" folder. This .exe can now be used to create games using Lua.

Testing the examples
To try the examples simply copy the "Template.exe" into the example's folder (along side the main.lua script). Run the "Template.exe" and the game will begin to run.

Creating your own game

To make your own game using AGK-Lua simply make a new folder and place the "Template.exe" in it.

Create a "main.lua" script and add the following lua functions to it:




The Setup() function will be called when the application starts and the Update() is your main loop. From there you can call almost all of the AppGameKit functions which can be found here: www.appgamekit.com/documentation/

The only unsupport AppGameKit functions are the math functions simply because Lua has the same functions built in. It is also suggested that you use Lua's string.format() rather than AGK's Str() function.


At the moment there is little to no error handling for improper calls to AppGameKit functions, so when calling an AppGameKit function make sure you are providing it with the correct arguments.







Sean
JohnnyMeek
11
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 1st Mar 2016 07:10
Awesome work.

This is a nice feature for people coming from another LUA based engine.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 1st Mar 2016 10:02
Wouldn't this be Tier 4? Pacal is considered Tier 3. Or perhaps you want to call all of these Tier 3?
Hockeykid
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 1st Mar 2016 14:50
Quote: "Wouldn't this be Tier 4? Pacal is considered Tier 3"


Wasn't sure if Pascal was called Tier 3 or not, but sure Tier 4 is fine. It's just a way to get the point across that there's another language to program in.

Quote: "Awesome work.

This is a nice feature for people coming from another LUA based engine."


Thanks. That's what I was thinking too.



Seab

Login to post a reply

Server time is: 2024-11-25 09:22:49
Your offset time is: 2024-11-25 09:22:49