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

0
votes
0answers
4 views

My perlin noise height map doesn't have smooth transitions and goes directly from black to white

I am using lua with the love2d engine to make infinite 2d tiled terrain with perlin noise. This is just the first step and I want to fix the bugs early. The problem is that there is no gradient ...
2
votes
2answers
49 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 ...
0
votes
0answers
13 views

RoBlox: Leaderboards Incramenting with a kill by gun

I'm New to Lua but I could not figure out how to detect that the bullet did the final blow and trace that back to the player and within script access the leaderboard script and add 1 to KO section of ...
3
votes
1answer
140 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
2answers
94 views

Performance Issues Using Lua in C++

I'm making an engine in C++ with Lua for its scripting language (using LuaBridge as the binding). I have a lot of entities and those entities have components. One of the components on those entities ...
1
vote
1answer
23 views

Can i put the main Love2D functions inside a table?

Instead of having a file with load, update,and draw can i say have a table called player, then put love.update and love.draw in that table to handle the drawing and updating of that particular player?
0
votes
1answer
32 views

Z buffer for large vs small objects

Are there common, tried and tested techniques for making sure that when displaying very large and very small objects, in a 3D environment, those objects don't display in front or behind each other? ...
0
votes
0answers
25 views

How to automate baking pizza in Corona SDK?

I'm writing a game about making pizza in Corona SDK. When you buy chefs, the new chef is supposed to make some pizzas on its own like automation. I tried everything I knew about, I couldn't think of ...
0
votes
0answers
7 views

how to determine the speed of the object using the accelerometer, if only known heavy ball

I'm making a ball maze using the accelerometer. There are four balls and each ball has a different weight. how to make a ball weight affect the speed of the ball.
5
votes
3answers
170 views

Scripting: to block or not to block [closed]

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 ...
0
votes
1answer
54 views

Open CryEngine console from lua script

Is there a function in the CryEngine Lua API to open the ~ Console? I cannot find it in the Lua (ScriptBind) API reference.
0
votes
1answer
18 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 ...
5
votes
5answers
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 ...
1
vote
0answers
16 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,...
52
votes
6answers
22k views

How does Lua work as a scripting language in games?

I'm a little hazy on what exactly Lua is and how a game that is programmed in C++ would use it. I'm asking primarily about how it is compiled and run. For instance when you use a program written in C+...
1
vote
0answers
54 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 ...
0
votes
2answers
30 views

What does this shader error in Löve2D mean?

What could I've done wrong to get the following error message when trying to create a GLSL shader in Löve2D? I'm sincerely clueless of what the mistake could be, though I suspect the error being a ...
0
votes
1answer
18 views

How can I fix this code to spawn multiple types of enemies on the same point with the Corona SdDK?

I have this code to spawn a simple enemy outside the window: local function spawnGrupo1() local color01 = display.newImage("assets/img/enemigos/blue.png") color01.x = 40 color01.y = -50 ...
0
votes
0answers
30 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
1answer
21 views

How do I select a portion of the window using Love2d

I want to be able to divide the window of the game in, lets say, 3 places, and when the mouse (or touch) click one of those places, execute some code. Do I have to make each portion a button-like ...
6
votes
2answers
654 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
0answers
35 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 ...
1
vote
1answer
56 views

Dynamic force behind logical jumping on 3 axis'

I've been working on physical jumping in a 3D environment, I've got it working with a static force. The problem with this is that the force on each axis should be different due to the rotation from ...
1
vote
1answer
73 views

Logical math behind jumping in a 3D world

I'm unsure if I should ask the mathematic part of StackOverflow or the gamedev part. I'm trying to figure out how the gravity changes the position of an element in a 3D world. I've been trying to ...
0
votes
0answers
53 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 ...
1
vote
1answer
208 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 ...
3
votes
0answers
64 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
99 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
151 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
21 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
22 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
54 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
1k 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
182 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
75 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 me....
0
votes
1answer
60 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
118 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
118 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
2k 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
90 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
99 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
166 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
42 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
30 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
64 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
132 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
338 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 ipairs(...
0
votes
1answer
154 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 ...