Lua is a powerful, fast, lightweight, embeddable scripting language. Lua is widely used as a scripting language by game programmers, perhaps owing to how easy it is to embed, its fast execution, and its short learning curve.

learn more… | top users | synonyms

4
votes
3answers
159 views

Scripting: to block or not to block

Context: I'm making a little "program your robot army" sort of game in Java in which the player writes Lua scripts (which are then run by LuaJ) to program their robots to do stuff. So far there are ...
1
vote
2answers
39 views

How do I handle objects with a width and height in grid-based pathfinding?

I'm using the Jumper library for Love2D to do grid-based pathfinding, which worked fine until I wanted to make larger enemies (with larger collision boxes). How do i do that? My initial idea was to ...
2
votes
1answer
127 views

Passing an SDL KeyboardState(Uint8*) to Lua

I'm working on my first big project and I've decided to integrate Lua with my C++ framework. Everything's worked out so far, but the only way I've managed to pass the SDL_GetKeyboardState(NULL) array ...
0
votes
1answer
15 views

How to calculate the magnitude of the drag in Corona-sdk?

I'm making a game on Corona that launches a ball. The force is based on the magnitude of the drag: the larger is the drag -> the higher is the force. I'm having some trouble to do this, because I ...
0
votes
1answer
44 views

Console Invoke from Lua

Is there any possible way I can invoke the console with lua? The documentation for cryengine lua functions isn't very helpful.
3
votes
0answers
63 views

Easing towards stepped value

I'm currently developing this rhythm game in lua (on top of a c++ engine) and I'm having trouble keeping a steady playhead position for the song currently playing. The playhead position that the ...
1
vote
0answers
11 views

How to include moai in lua code for running it using luajit?

I'm running moai from ubuntu for some simulation purposes. I have a lua script that is executed using luaJIT. Now I want to run a simulation written based on moai from within this script. As of now,...
1
vote
0answers
35 views

How to fix my camera angle in ROBLOX?

I am trying to make my own camera in ROBLOX. Here's my problem, I am using an inverse function to make the camera look nice and smooth but it only works on the x axis in the positive side. Here's an ...
1
vote
0answers
40 views

GMod Lua Scripting - Playing sounds only for specified player entities

I'm making a game mode for Garry's Mod, and I'm trying to write a system in which I play sounds only for certain players. The problem I'm running across is that doing so from server-side would take a ...
1
vote
0answers
171 views

What LuaJit threading archietecture should I use?

I am in the process of designing my own Game Engine for use in a real time CRPG - think Baulder's Gate. I know most of my specifications right now, and I am currently in a planning phase. I chose Lua ...
1
vote
0answers
208 views

Determine required camera pitch/yaw change based on mouse movement and roll?

I'm sure this is going to be a pretty simple answer but I can't quite figure it out on my own. Each frame, I'm getting the mouse's distance from the center of the screen (left/up is positive) and ...
0
votes
0answers
28 views

Spawning multiple objects randomly

I have gold spawning all the time though I sometimes ( rarely ) want to spawn a gem, and at other times I want to spawn boosts, how would I make a function to choose between what item to spawn. I ...
0
votes
0answers
30 views

What's the best way to store tiles' infos in a 2D table?

I need to know what's the less time / memory consuming way to store the infos about each tile in a 2D table. The first thing that came to my mind was creating a table holding the infos, and then ...
0
votes
0answers
51 views

Why does my world generation code perform poorly on large inputs?

I'm writing some code to procedurally generate some islands in real time. The idea is to choose some points for each chunk, and for each tile calculate the distance from those points, then combine it ...
0
votes
0answers
20 views

Wow backdrop adding a fade color

I'm a bit stuck on my frame border. It adds 3 lines at the border and it should be 2 and i can't seem to fix it. Here is a image for better understanding. My backdrop looks like this PANEL_3 = { ...
0
votes
0answers
17 views

Cocos2dx : Lua with C++: lua_pcall closing my app

I'll try to explain what is happening with my current project: I want to make some custom scripts myself without using the lua script engine from cocos2dx, so I linked lua51.lib on Linker->Input, and ...
0
votes
0answers
41 views

Balancing teams based on player count and skill

I am creating a lua script which should balance teams. Now I have a table of players for each team. And each player has a certain skill (float value), and well second problem is the player count in ...
0
votes
0answers
28 views

How can I clear the screen on Corona SDK

I have objects on the screen that create the main menu, and I want the the screen to clear when I get press the play button. I did it the way the other question on this subject said, but when I ...
0
votes
0answers
73 views

How to implement Lua thread for Sleep function

I am running into a problem in my game engine right now. I want to be able to call Sleep(number_of_seconds) from .lua file (1 only) and halt the execution of the lua file, WHILE the game is running ...