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.
257 questions
1
vote
3
answers
258
views
Handling status/effects on a turn based RPG game
I have managed to create a state machine for my game core, like on turn start, on turn end, and another one. Now lets talk about effect/status.
For generic effects such boosting stats for certain ...
0
votes
1
answer
203
views
How to express parabolic motion using delta time?
I'm trying to figure out how to express parabolic motion (for example: \$y = x^2\$) using delta time. I thought about deriving it using a differential like \$y' = \frac{1}{2}x\$ but that results in a ...
0
votes
1
answer
95
views
Predictive Rectangle Collision Resolution Corner Snagging
I've written two main functions who's purpose is to detect and resolve collisions between a moving rectangle and a non-moving rectangle. I have a decent understanding of how the algorithm works, and ...
0
votes
3
answers
350
views
Implementing framerate independent friction with linear deceleration
I'm implementing friction into my game, and I'd like it to be framerate-independent. Here's my first solution, in Lua style pseudo-code:
...
0
votes
1
answer
483
views
How to go about executing lua scripts in a ECS engine?
I'm trying to add scripting with lua to my C++ game engine, and I'm pretty stumped on how to tackle the executing/processing part. I started by creating a ...
1
vote
0
answers
246
views
Which part of UnLua for UE5 can be defined at runtime?
I'm looking into options to allow a released UE5 game to be modded, with just "text files". That is, without having to use the Unreal Editor, and give access to the game code, to create the ...
0
votes
1
answer
149
views
Why does my Roblox game delete all parts when testing?
I'm working on a Roblox game, but whenever I test it, none of the parts I added in the game display in the Explorer or in the game itself. It works perfectly fine when I view it in the studio, though. ...
0
votes
1
answer
181
views
Why check the ball and brick collision twice?
I watched https://www.youtube.com/watch?v=F86edI_EF3s.
I believe the following code is the complete code
https://github.com/games50/breakout/tree/master/breakout13
And
https://github.com/games50/...
1
vote
0
answers
123
views
VR Controllers in Roblox Studio not working as expected
I am trying to create a Roblox game with VR support. My understanding is that this code should move the hands of the character as the user moves the controllers:
...
0
votes
1
answer
1k
views
Attempt to call missing method - Lua (Roblox studio)
I am trying to develop a game in Roblox and I have am cannot call a method on a class that I created. I have added my steps below. I am certain the path to the model is correct and I think I have ...
0
votes
1
answer
121
views
Synchronizing in-game clock vs real world clocks across servers started at different times
Regardless if you know how Roblox works or if you know Lua syntax, I just need an algorithm/equation here.
Currently, at the start of each server, I reference the seconds of a centralized clock since ...
1
vote
1
answer
154
views
cyclic dependency error in roblox survival game
Description
In my game, I have have 3 module files: "PlayerList.lua", "PlayerData.lua" and "WorldData.lua".
PlayerList.lua = a list of PlayerData classes (requires ...
0
votes
2
answers
370
views
Numbering sprites in a sprite sheet left-to-right, top-to-bottom
I'm using this program called Quadtastic which is a sprite sheet management tool that lets you define quads on a sprite sheet, name them, etc, and export to metadata with those names (+ position, size,...
1
vote
1
answer
346
views
How do you clone a part to the Player in Roblox?
I have been making a game in Roblox, But I had one problem.
I wanted to make a debug GUI that one can use to spawn items at the Player Location, but I do not really know how to copy it to the player ...
2
votes
1
answer
217
views
How to deal with rapid acceleration/deceleration from physics forces?
I'm working on a game in LOVE2D using Lua, where you pilot a drilling vehicle. The idea is that as you drill into different surfaces, you speed up/slow down depending on how dense that surface is. I'...
2
votes
1
answer
120
views
How do I get the consistent time it would take for two points to reach each other in circular motion?
I'm making a 2D game. It involves the player swinging around a grapple hook in perfect circular motion, however, I want to make the cooldown for this ability based on predicted end position for the ...
0
votes
1
answer
99
views
for loop problem
So it works first time when the player dies. But when it dies twice the for loop doesn't work.
...
0
votes
1
answer
291
views
Using Lua to define NPC behaviour
I'm working on a RPG in C using Lua for event scripting like NPC behavior. I ran into a design problem.
I have created Lua threads in the C API for each game object which can be a NPC. So this:
...
0
votes
1
answer
110
views
How can I allow my players to create, save and use moves?
I want to create a system to allow the players to create, save then use moves in Roblox Studio.
My first thought was to do this by letting them create animation files in Roblox Studio, but I'm not ...
0
votes
1
answer
880
views
Play and Pause State
Problem
i want to implement a pause state and with a simple conditional inside the update of PlayState is very very simple.
However i think that the pause has to be another state in the StateMachine ...
0
votes
1
answer
945
views
Rotate relative to set point in a specified direction in a 3D space
I know there's a geometry formula to calculate the next point in rotation relative to another point in 2D but I'm working in 3D and I want to calculate the next position in specified direction as well....
1
vote
1
answer
683
views
How to connect a GUI button to function?
I am developing a new Roblox game where you can setup and control you're own virtual machine using SurfaceGUIs on a modeled screen. I am trying to make a confirmation GUI
where if you click YES, then ...
0
votes
1
answer
199
views
When PlayerRemoving event is fired, for loop does not work properly
while I was implementing the Backback save feature in my Roblox Game (using game.Players.PlayerRemoving:Connect(), I found that when I used a loop of any form (<...
0
votes
0
answers
287
views
Integrating Moonsharp with Unity for Nintendo Switch project
Has anyone tried to run Unity project with integrated Moonsharp on Nintendo Switch? Can it be done? Are there any significant performance issues due to running Lua scripts?
EDIT: Sorry, I wasn't ...
0
votes
1
answer
188
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 ...