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
153 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
votes
0answers
18 views

How do i search for a word within a string? [on hold]

I want to search for a word from the Words.list["key"] and i do get it to work when i do string.find. But the problem i ran into is when i type in the game chat say thigh it will take hi out of the ...
0
votes
1answer
33 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.
0
votes
0answers
41 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
1answer
14 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 ...
1
vote
2answers
23 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 ...
1
vote
1answer
115 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 ...
1
vote
1answer
197 views

NLua - How to implement Roblox like function security?

Roblox uses Normal Identities, basicly they assign a lua block/object to a certain number. They use 2 for Scripts and LocalScripts, which can only use non-secured functions, while the command bar can ...
2
votes
0answers
53 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
1answer
91 views

In ROBLOX, how can I check what is in front of me?

In ROBLOX Studio I need to check what part is in front of the model Freddy. I need to set the variable called thingInFront to the part that is in front of the model Freddy so that I can decide ...
0
votes
1answer
83 views

Is it safe to set Lua Table data from multiple C++ threads?

As the title states. I'm curious if it's safe to set data in different Lua tables that exist in the same lua state. From multiple C++ threads. I'm asking this because my current system actually has a ...
0
votes
0answers
19 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
16 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 ...
1
vote
0answers
24 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 ...
3
votes
2answers
7k views

2D and 3D Perlin Noise Terrain Generation

I'm using 2d perlin noise to generate a heightmap and then adding 3d perlin noise to the heightmap to create overhangs and ridges. But it's not turning out like I would like it to. There are too many ...
3
votes
2answers
999 views

Does it make sense to use Lua scripting in a game developed in Python? [closed]

Well for C++ written games using Lua scripts for easy changing ai, quets etc is very reasonable and it's common. However now I'm going to write a game in pure python and I don't know if I should use ...
0
votes
2answers
168 views

Switching a project written in Lua to a compiled language [closed]

I am experimenting with game development in Lua using the Love2D framework, and while it works fine, I am getting tired of using a dynamic scripting language. I would like to have better performance, ...
1
vote
2answers
53 views

HardonCollider Error: attempt to call method 'addRectangle' (a nil value)

I want to add collision detection mechanism to my game, which is written in love2d. As i do not want to implement my own algorithm, i have found a HardonCollider library to do the heavy lifting for ...
0
votes
1answer
54 views

Corona SDK, do I need to pay for it?

I'm a single dev making simple mobile games. I was looking at corona sdk for my next project. I don't understand what the difference between the paid version and the free version is. It seems that ...
6
votes
0answers
110 views

Design patterns for live coding/script reloading [closed]

I would like to make C++/Lua combo and write scripts for a game with live script reloading. What design patterns should I be aware of so not to cause me unnecessary pain? For example if I have a ...
1
vote
2answers
101 views

How do i set Lua variables?

You can pretty easily read variables, but what about writing them to the lua file? Ive given it a little go, but it doesnt seem to work... void Lua::setBool(string path, string var, bool val) { ...
3
votes
4answers
1k views

Is it efficient to use lua to store game data?

I'm new to lua and I'm wondering, is it efficient to use lua to store game data (such as monster's description, spells). My problem is, when I try to create a monster object every second, I have to ...
2
votes
2answers
74 views

LUA form/scene loading

At the moment, I'm working on a small game project using LUA and the love2d framework. Using this framework, I've made my own assets (i.e. button images, form images, etc), and using these assets I've ...
1
vote
2answers
93 views

Binding class method to Lua

If I have class class Game { public: Game() { level = new Level(); } private: Level *level; lua_State *L; } Where the level class has member functions such as ...
8
votes
2answers
149 views

Calculating Linear force required to hit a specific vertex on a parabola

The idea is a user presses somewhere on the screen and the program will fire an object in a parabola shape from a defined start position that has it's vertex where the user touched the screen. I have ...
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
20 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 ...
1
vote
1answer
57 views

Resource management with Lua integration

I have a questions about how to better implement resource management when integrating with Lua. I have an entity system that has gameplay logic done in Lua. One of the design points was that I wanted ...
1
vote
1answer
85 views

Multiple lua scripts using newthread

I'm trying to hook lua-scripts to my entities, where several entities of the same type want to use a separate instance of the same script. Problem is, when I run two or more scripts and use any C-api ...
1
vote
3answers
2k views

corona sdk scale images

How to scale images to full screen on all devices, i want to use % The method I've seen so far is to define pixels image_variable_name = display.newImage( "testimage.jpg", 100, 300 ) I want to do ...
0
votes
1answer
224 views

load all files out of folder as resources in lua and love2d [closed]

If i use this code -- some lua file -- some code local IMAGE_FILES = {"file1";"file2";"file3";"file4} -- some code function loadRes() -- some code -- load all images: for i,v in ...
5
votes
1answer
554 views

How do I change a LÖVE2D game executable's icon?

I merged my game.love file and the love.exe with the command copy /b love.exe+app.love game.exe. But the resulting executable has the default LÖVE2D icon. Is there a way to change that icon to ...
0
votes
1answer
134 views

Calculate future 3D Position of object(Unit)?

I've looked around and almost all examples is see have a velocity vector which I do not have, or at this point am unable to figure out. Im trying to find the 3D position where i can launch a trap in ...
6
votes
3answers
190 views

Which parts of game should belong to engine and which should belong to scripts?

Often, the game is splitted into engine code (i.e. C++) and scripts (i.e. Lua). The question is which parts / modules of game code should typically belong to engine, and wchich should belong ...
1
vote
0answers
117 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 ...
0
votes
1answer
647 views

Garry's Mod HatsChat2 chat colors permissions messed up?

So I'm making a garry's mod server and I'm trying to work on my chat box addon that I installed and was working on that only premium and superadmin can use colors in the chat and only want them to be ...
1
vote
1answer
86 views

LOVE Physics - Joint Stretching

After asking a similar question yesterday I've come across another problem with using joints in box2D / LOVE and trying to create a weighted chain. Everything is set up as follows, I've tried to ...
1
vote
1answer
144 views

LOVE Physics - Breaking Joint Chains (LUA / Box2D)

Wasn't sure whether to post here or on SO so please move if needed. I've been having a look into the box2D physics API provided by LOVE to try and create a swinging flail or weighted rope but I'm ...
1
vote
1answer
176 views

Registering a C++ callback with Lua API without additional libraries

Basically, I'm trying to register a callback into a Lua state like this: class MyClass { public: int myLuaFunction(lua_State* L) { //do something } }; I ...
0
votes
1answer
35 views

Nested ipairs for basic hit detection

So i'm developing my first game using Löve, the game is a basic asteroids clone. Everything is going well so far, until I decided to actually add asteroids. I'm trying to make a basic hit-detection ...
0
votes
0answers
70 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 ...
5
votes
1answer
10k views

why is Lua so important ( frequently used ) in game development [duplicate]

I have written some small games for fun myself, but never used Lua myself. I have seen people discussing Lua's use in games everywhere. The question is: What benefit can I get from using Lua in game ...
5
votes
4answers
2k views

How can i run my .LÖVE game directly from the lua interpreter?

I've just started with LOVE and LUA , i'm interested in LOVE because i want to play around with something different from my dayjob(i'm a webdeveloper) and since it uses LUA and is interpreted , i ...
0
votes
1answer
233 views

how to close lua file call luaL_dofile?

i created tool that generate lua script on each level which contain lot function, and they named based on the object+id format. ex : trigger1(), etc; so every level may have same function name, what i ...
1
vote
0answers
110 views

Scripting language for high complex educational game [closed]

I'm at a stage of working at my C++ game that I need to implement a script language to allow the players to perform tasks inside the game's logic. I'm a sole programmer and thus it's entirely ...
1
vote
1answer
150 views

Handling creation of entities on level creation

I'm currently working on a 2d physics based plat former, kinda in the style of super meat boy. In super meat boy, you have multiple levels and I want a similar sort of thing but is there a general way ...
5
votes
2answers
551 views

Lua Implementation

I'm struggling to get Lua implemented into my game engine. I've read dozens of blogs and articles revolving around how to wrap C++ classes and I seem to have hit a wall. No matter how I structure the ...
3
votes
1answer
841 views

Is it possible to develop a game with Lua/Löve and have the source code compiled? [closed]

I've been looking at Lua and Löve for developing simple 2D games. But since Lua is interpreted and I know it can be compiled to some point, but how secure is that to decompiling. Or is there a better ...
1
vote
1answer
199 views

update image properties

Is there a way to update the location of an image? I'm currently calling my image dynamically using: itemImage = display.newImage(inventory[t.ID][1]) t. being my target ID. But in order for ...
1
vote
1answer
140 views

Custom 3D Noise function incorrectly generating in Lua

I have been working on a custom noise generator (not Perlin on Simplex or whatever), which works fine in two dimensional space, but upon converting it into three dimensional space, it turns into a ...