ROM Hack [Question] How do i edit .lua files?

Monozombi

New Member
OP
Newbie
Joined
Nov 16, 2015
Messages
4
Trophies
0
Age
39
XP
54
Country
Argentina
Hi, i'm trying to translate a game. I already decrypted the .3ds and have all the extracted files, but i don't know how to edit the text, as it's in .lua format (The .lua is the text, right?)
 

Monozombi

New Member
OP
Newbie
Joined
Nov 16, 2015
Messages
4
Trophies
0
Age
39
XP
54
Country
Argentina
You are in luck. LUA is a script used in the game.
You may edit them with a text editor.


Also, what is the game? So we know where you get started?

Thanks, then i'll try using something like notepad++ . The game is Zero Escape: Virtue's Last Reward, i want to translate it to spanish.
 

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,600
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,217
Country
Canada
Thanks, then i'll try using something like notepad++ . The game is Zero Escape: Virtue's Last Reward, i want to translate it to spanish.
Oh I see.

Well, uh, try to open the LUA files with notepad++, the might be something for sure.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,348
Country
United Kingdom
lua is a programming language, I have seen it in a few DS games over the years and it makes sense that the 3ds would also support it.
http://www.lua.org/docs.html has more. It is used in emulators aimed at speedrunning as well as being available in desmume and fceux and is not a bad programming language either, probably a bit less lucrative than python or ruby if you want a scripting language but as a general use thing is by no means bad.

It tended to come in three main forms

1) Some kind of binary shorthand, think java bytecode for a similar concept and possibly javascript minimisation. Puzzle Quest on the DS for this one.
2) Some kind of standard compression and embedded archive formats. Handle like you would handle compression or archive formats normally. ( El Tigre- make my mule on the DS being an example of this if memory serves)
3) Just plain text. Edit like you would other text files on a PC really. Do make sure you have the same new line, encodings and whatever else. (Some rhythm game or possibly Theta)

I dare say there might have been a 4th where the lua was used in the game but left in as a kind of developer extra but I will have to confirm that. In that case you would likely have some kind of thing like 1) on your hands anyway -- lua tends not to compile from what I have seen and will have to come with some kind of interpreter.
 
  • Like
Reactions: Monozombi

Cuber456

Active Member
Newcomer
Joined
May 19, 2012
Messages
35
Trophies
1
XP
135
Country
United States
I thought it was funny that the devs used LUA scripts for VLR.
I wonder if the devs did this purposefully or if this was a coincidence.
If you played the game then you know what I mean.

Anyway, there was a similar project that was (or had done) a similar translation project from English to Italian for VLR. Source below:

https://gbatemp.net/threads/wip-3ds...ist-and-discussion.380171/page-4#post-6034758

Even though I have looked through VLR's files (models, textures and what not), I am not sure how easy it would be to edit text inside of a LUA file. It would be easy if the file size stays the same and you only overwrite text with the equivalent Spanish. It may start to get more dicey if you change the file size. I say pursue the source I gave you.

Good Luck!
 
  • Like
Reactions: Monozombi

Monozombi

New Member
OP
Newbie
Joined
Nov 16, 2015
Messages
4
Trophies
0
Age
39
XP
54
Country
Argentina
I thought it was funny that the devs used LUA scripts for VLR.
I wonder if the devs did this purposefully or if this was a coincidence.
If you played the game then you know what I mean.

Anyway, there was a similar project that was (or had done) a similar translation project from English to Italian for VLR. Source below:

https://gbatemp.net/threads/wip-3ds...ist-and-discussion.380171/page-4#post-6034758

Even though I have looked through VLR's files (models, textures and what not), I am not sure how easy it would be to edit text inside of a LUA file. It would be easy if the file size stays the same and you only overwrite text with the equivalent Spanish. It may start to get more dicey if you change the file size. I say pursue the source I gave you.

Good Luck!
I found the lua file with the text of the beginning of the game. I used Hxd to edit it and keep the same file size, but when I put it on my 3ds and launch it, after I click "start from beginning" , the upper screen stays black and the below one shows the VN menu (with the "auto" button and stuff).
Any idea of what caused it and how to fix it?
 

Cuber456

Active Member
Newcomer
Joined
May 19, 2012
Messages
35
Trophies
1
XP
135
Country
United States
It depends on what you actually edited.

There isn't exactly a fool proof way to edit a file format. Look at what you edited and compare it to the original. Look at the file structure the text is in. Some of this is just going to come down to good old fashioned trial and error and experimentation.

That's why I recommended the source above. Somebody has already figured out the text file format. Ask them. Don't reinvent the wheel if you don't have to unless you enjoy reverse engineering. In that case, go all out.
 

Monozombi

New Member
OP
Newbie
Joined
Nov 16, 2015
Messages
4
Trophies
0
Age
39
XP
54
Country
Argentina
It depends on what you actually edited.

There isn't exactly a fool proof way to edit a file format. Look at what you edited and compare it to the original. Look at the file structure the text is in. Some of this is just going to come down to good old fashioned trial and error and experimentation.

That's why I recommended the source above. Somebody has already figured out the text file format. Ask them. Don't reinvent the wheel if you don't have to unless you enjoy reverse engineering. In that case, go all out.
Okay, i'll try asking them then. Thanks for the help
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BigOnYa
  • BakerMan
    I rather enjoy a life of taking it easy. I haven't reached that life yet though.
  • Xdqwerty
    what are you looking at?
    BigOnYa @ BigOnYa: damn @SylverReZ , when the last time you seen and felt grass? +1