Score:-2

How to correctly open and edit .lua scripts on ubuntu

bv flag

I'm making a mod for a game, and all the major program files are written in Lua, however when I go to edit them all I see is a bunch of mumbo jumbo. Any ideas on what I'm doing wrong?

https://i.stack.imgur.com/mnW4E.png

David avatar
cn flag
You need to use an app that can edit lua. This is a place you can start https://devforum.roblox.com/t/what-is-the-best-application-to-learn-lua/701945 I have no idea if there is an app that works with Ubuntu, you will need to do some research.
Score:0
US flag
user495343

The answer to this question on SO explains what you're looking at. The picture you shared shows that your file begins with an escape character (the "E", "S" and "C" on the diagonal) followed by "Lup" in ASCII. This is the 4 byte signature placed at the top of a Lua bytecode file to make it easier to identify.

Bytecode is not source code, but code translated (programmers say "compiled") into a more efficient form for interpretation. The computer must do work to execute Lua code you write: compiling does a bunch of that work - the work that's going to be the same every time your code is run - and saves the result in a compact form. That form is designed for the computer, not people, so it's not easy to read or edit. There are almost as many different bytecodes as there are interpreted programming languages, but instructions are often a single byte (compact and efficient), which is where the name comes from.

You need to find the Lua source code so you can make changes, then recompile to create new bytecode. Really, any text editor should be fine for editing the source once you've got it - there are tons of text editors, IDE's etc that should do the job (even the one in your picture).

I recommend spending some time on the question linked to above - I think it will be worth the investment!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.