We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [lua]

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.

28 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
406 views

How to store Lua script's inner state?

Situation: I am working on an Entity-Component system, and I am using LuaBridge as a Lua binder. There is only one Lua State. Currently when I update the game objects, I just check whether it has a ...
3
votes
0answers
386 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
1answer
35 views

how to display current time as a static value in lua/pico8

Pico8 has a function time() that when called displays the current time from start of program. i.e. print(time(),0,0,14) --prints time at (0,0) with colour 14 However the function doesn't stop and ...
1
vote
0answers
35 views

How to aim bullets at a player in Vavio

In Vavio, how do you make an enemy aim at the player then shoot a bullet? Here's the code I tried: LevelSpawnData/spawnData-L0.json ...
1
vote
0answers
76 views

binding glm operators with luabridge

I am attempting to expose glm vector functions/data to luabridge like so: ...
1
vote
0answers
193 views

Sprite batching and dealing with isometric depth sorting

So I'm using Love2D which uses SDL2* as far as I'm aware and I have a question about texture atlases & spritebatching. I have an isometric chunk, with 2 layers, terrain and objects (trees, ...
1
vote
0answers
235 views

Reimplemented steering seek behavior from PyGame to LÖVE is much slower than original

I'm learning about steering behaviors and watched this nice explanation tutorial - https://www.youtube.com/watch?v=g1jo_qsO5c4&feature=youtu.be with the source code available at https://github.com/...
1
vote
0answers
40 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
883 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
227 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
0answers
775 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
373 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 ...
1
vote
2answers
1k views

Perlin Noise Variations

Currently I'm making a voxel survival game. About a month ago I embarked on procedurally generating terrain using Perlin noise. I understand how to use and apply it for the most part. However I do not ...
1
vote
1answer
48 views

Is it possible to have a fixed camera without a CameraSubject?

I have created a very simple script to set up a fixed camera with no subject. In other words, I want a camera in a static position looking down at the world (a top-down style camera that doesn't ...
0
votes
0answers
23 views

Facing issues trying to Parse JSON in Lua

Problem statement: Need help trying to load a JSON file into a table array in Lua for Corona SDK development. My Objective: Call specific data from JSON file to my application by using key value ...
0
votes
0answers
48 views

Need some help for reading JSON/XML structured files in Lua language for Corona SDK

I have been trying to read a JSON/XML or simple text file in Lua language for Corona SDK with little to no success. All the tutorials I followed, people were basically writing a file and then reading ...
0
votes
1answer
56 views

How is tile offsetting accomplished in 2d side scrollers?

The idea is to work with tiles that together make up a larger image, or world so to speak. but im confused as to what the methods used are to offset the tiles, and whether is a good idea to draw ...
0
votes
1answer
44 views

How to make the character dash forward in Roblox?

In my game I want to make a skill in a tool to dash forward for a specific range and if the character came in contact with a humanoid during the dash, it stops right on contact and stops the other ...
0
votes
1answer
22 views

Command Shell text adventure - input methods for scrolling through text (lua)

I'm writing a simple text-based adventure in lua. The intent is the user clicks on the game.exe and it loads up the command prompt or whatever command shell they have and they play the game there. ...
0
votes
0answers
37 views

How can I store “charges” on a player persistently between game sessions

I've got an idea for a gamemode for a Garrysmod RP server but I don't know if it's realistic within Lua. I specifically want to make my script apply variables to a person when they shoot another ...
0
votes
0answers
50 views

How do I get the player's position in Roblox Studio?

In Roblox Studio, I have this code in a script file: ...
0
votes
0answers
42 views

Variable use in a Roblox Object statement?

I'm somewhat alright at Lua but I've only learned bits and pieces of what I need to code some transportation vehicles inside of Roblox. I'm trying to get a GUI interface of a subway model spawn to ...
0
votes
0answers
29 views

how to register update function in Lua from C game engine?

This is my first attempt to make a SDL2 based 2d game engine in C, i am planning using Lua as scripting language for gameplay purposes. First i learned how to call a C function from Lua: ...
0
votes
1answer
138 views

Walking around a sphere in Lumberyard

I am trying to create a simple game using Amazon Lumberyard and my goal is to have levels/stages where the player will be able to walk around a mini planet. I have seen a lot of tutorials about this ...
0
votes
0answers
84 views

How can I load a script once in LuaJit/Lua and use it across multiple VMs in different threads?

So, I came across an interesting problem. I'm implementing some threaded game logic, and one of the things I decided to do was to use Multiple Lua VMs, with each worker thread containing its own VM. ...
0
votes
1answer
274 views

Love2D STI library not drawing map at all (black screen)

I'm trying to use a pretty standard map with the Simple Tiled Implementation module for Love2D, but no matter what I try, I can't get it to display anything but a black screen. Here's my current code (...
0
votes
0answers
206 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
83 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 ...