Need Help With Mod Ending

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Need Help With Mod Ending

Post by wagtunes »

Okay, finally finished my dungeon and played through it and when I got to the ending a screen came up that looked like it was attempting to play the ending.lua file but then I got a white box pop up that said file not found.

Here are my suspicions.

When I scripted the end game section, I actually took the game ending line from another source file of a dungeon I downloaded just to see how they handled it. The file was in modassets, which is where the default file is.

However, the path in the source code is only a partial path. While it starts at modassets, before that, there is much more path on my actual system.

So my suspicion is that the system doesn't know where modassets is on my particular system.

Now, if I change the path to the complete path, which starts in MyDocuments, it might play on my system but what if the person playing this dungeon has their modassets someplace else?

Is there a way to get around this problem or is the problem I'm having something entirely different? The rest of the dungeon works fine except for this error on game end.

Any assistance or insight into what it might be will be greatly appreciated.

Thanks.

** EDIT ** PLEASE READ BELOW

Okay, I figured out the problem. I now got the ending script to load and play. Now I have another problem.

I can't use it.

I assumed this was just the default ending that comes with the game for people who want to create their own dungeons but don't want to design a custom lua script. It is not. The ending I'm using was specifically designed for the custom dungeon I downloaded.

So...here is my problem.

Inside the dungeon that I created, when fulfilling the win condition, the only thing I do is call ending.lua. Now, obviously this script is calling other scripts or files. I discovered this because upon first recompile I got an error that a DDS file was missing. So tracked that down. Then after recompiling again, I got an error that texture in the cinematics folder was missing. It was the logo for this particular dungeon. So I tracked that down.

Obviously, ending.lua is calling other things.

So...here is my question.

Is there a way for me to load ending.lua into some kind of editor so see just what it's calling. I can then design my end game (cinematic score, graphics, etc.) based on the same code. I'm assuming inside ending.lua there are calls to various files.

Ultimately, I can't use this ending as its somebody else's work. So any assistance in this area will be appreciated. Right now, all I want to be able to do is view the contents of ending.lua.

Thanks.

** EDIT 2 ** PLEASE READ BELOW

Okay, I downloaded both Notepad ++ and Luaedit and pulled the ending.lua script into both but all I get it gibberish except for the path and file names of the various files loaded. But I can't make any sense of any of the source code. Is there anything at all that I can use that will load the ending.lua script that will make it readable? I'm out of ideas.
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Need Help With Mod Ending

Post by Isaac »

wagtunes wrote:Okay, I downloaded both Notepad ++ and Luaedit and pulled the ending.lua script into both but all I get it gibberish except for the path and file names of the various files loaded. But I can't make any sense of any of the source code. Is there anything at all that I can use that will load the ending.lua script that will make it readable? I'm out of ideas.
It sounds like the mod author chose to use compiled lua; possibly for obfuscation, rather than performance.

There is an official tutorial for making Grimrock ending cinematics. It is hosted here on this site. You can easily build your own 'ending.lua' file. 8-)
http://www.grimrock.net/modding_log1/ho ... inematics/
wagtunes wrote:However, the path in the source code is only a partial path. While it starts at modassets, before that, there is much more path on my actual system.
So my suspicion is that the system doesn't know where modassets is on my particular system.
The game only expects the path to start with "mod_assets/". When exporting the mod, the editor collects all of the support files contained within the "mod_assets" folder, and compresses them into the dat file.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Need Help With Mod Ending

Post by wagtunes »

Isaac wrote:
wagtunes wrote:Okay, I downloaded both Notepad ++ and Luaedit and pulled the ending.lua script into both but all I get it gibberish except for the path and file names of the various files loaded. But I can't make any sense of any of the source code. Is there anything at all that I can use that will load the ending.lua script that will make it readable? I'm out of ideas.
It sounds like the mod author chose to use compiled lua; possibly for obfuscation, rather than performance.

There is an official tutorial for making Grimrock ending cinematics. It is hosted here on this site. You can easily build your own 'ending.lua' file. 8-)
http://www.grimrock.net/modding_log1/ho ... inematics/
wagtunes wrote:However, the path in the source code is only a partial path. While it starts at modassets, before that, there is much more path on my actual system.
So my suspicion is that the system doesn't know where modassets is on my particular system.
The game only expects the path to start with "mod_assets/". When exporting the mod, the editor collects all of the support files contained within the "mod_assets" folder, and compresses them into the dat file.
Thank you for your help. I am almost there.

From my research, it appears I need to create two types of files in order to display the ending of the game.

Ogg file - This is the music from what I understand. I have downloaded ffmpeg and think I've gotten the syntax down from looking at examples. However, looking at Cubase, which is where I do my scoring, it appears that it has an OGGVorbis file option on export. Is this the option I want to use for creating the music. That would save me from having to use ffmpeg.

TGA file - This appears to be the graphics file. I have Photoshop CS3 and there appears to be a Save As format of Vargas (TGA, etc.) Will this option work for creating the graphics files?

Finally, assuming the above will work (in which case I know what to do next) is there a shortcut?

I have Camtasia Studio and can actually create an entire movie in Camtasia, score, images and text and save it in MP4 format. Now I don't know if I can load an MP4 file into Cubase and then export as Ogg but I know I can do that with ffmpeg.

If I do this, will the resulting file play the music and graphics or will it only render the audio portion? The reason I'm asking is, so far, the scripts I have seen all break the audio and video into separate components (Ogg and TGA). If I can combine this into one file, Ogg, that would be great.

In either case, I know I can get this done now because between Cubase, Photoshop and Camtasia I have all the tools I need.

Thanks again for your help.
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Need Help With Mod Ending

Post by Isaac »

For historical reasons, the game scripts refer to image files as .TGA format, but what it actually needs is images in the .DDS format. You can make .DDS images in Photoshop—with the Nvidia plugin, or in the Paint.Net free image editor.

As far as I can recall, there is no support for playing videos in LoG1; but there is in LoG2. Cutscenes in LoG1, are timed image slideshows.

**BTW, if you plan to upload your mod to Steam (as opposed to Nexus), then the exported dat file will have to be 98mb at most. (It's an engine issue)
Last edited by Isaac on Fri Feb 23, 2018 11:43 pm, edited 1 time in total.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Need Help With Mod Ending

Post by wagtunes »

Isaac wrote:For historical reasons, the game scripts refer to image files as .TGA format, but what it actually needs is images in the .DDS format. You can make .DDS images in Photoshop—with the Nvidia plugin, or in the Paint.Net free image editor.
Okay, this doesn't make any sense. The script I studied specifically called a TGA file. If I create a DDS file, won't it come back with a message file not found? How does the editor know that when I call a TGA file that I'm really looking for a DDS file and then pulls the right one? Is it an internal conversion within the program itself? That's the only way I can it working.
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Need Help With Mod Ending

Post by Isaac »

wagtunes wrote:If I create a DDS file, won't it come back with a message file not found?
No... But almost anyone would assume so... It is that the engine expects .dds images, even though the script lists .tga images. The files themselves, should be in .dds format; the script has to list them as .tga images.

(Just edit the file extension in the script to read .TGA)

http://www.grimrock.net/modding_log1/cr ... om-assets/
Scroll down to the heading, "Using Custom Graphics".
Last edited by Isaac on Fri Feb 23, 2018 11:52 pm, edited 2 times in total.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Need Help With Mod Ending

Post by wagtunes »

Isaac wrote:
wagtunes wrote:If I create a DDS file, won't it come back with a message file not found?
No... But almost anyone would assume so... It is that the engine expects .dds images, even though the script lists .tga images. The files themselves, should be in .dds format; the script has to list the as .tga images.

(Just edit the file extension in the script to read .TGA)
Okay, so then the procedure is basically like this.

Step 1 Create Ogg audio file in Cubase

Step 2 Create DDS file(s) in Photoshop

Step 3 Create lua script calling the files I've created

And that's it, right?
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: Need Help With Mod Ending

Post by Isaac »

That's it. (As far as I remember; it has been about three years since I've tried it myself.)

The cinematics page outlines the process.
http://www.grimrock.net/modding_log1/ho ... inematics/

Check the link in my post above, for the image format details.

**Another thing to keep in mind is that Window OS is not case sensitive, but the Lua interpreter definitely is. All of your path links must match the proper letter case of the file name.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Need Help With Mod Ending

Post by wagtunes »

Isaac wrote:That's it. (As far as I remember; it has been about three years since I've tried it myself.)

The cinematics page outlines the process.
http://www.grimrock.net/modding_log1/ho ... inematics/

Check the link in my post above, for the image format details.

**Another thing to keep in mind is that Window OS is not case sensitive, but the Lua interpreter definitely is. All of your path links must match the proper letter case of the file name.
Yeah, I know how picky scripts can be from my days as a programmer.

Anyway, thanks for the assistance. Been having a lot of fun creating this dungeon. Hope others enjoy it as much as I did.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Need Help With Mod Ending

Post by wagtunes »

Isaac wrote:That's it. (As far as I remember; it has been about three years since I've tried it myself.)

The cinematics page outlines the process.
http://www.grimrock.net/modding_log1/ho ... inematics/

Check the link in my post above, for the image format details.

**Another thing to keep in mind is that Window OS is not case sensitive, but the Lua interpreter definitely is. All of your path links must match the proper letter case of the file name.
Oh, one last thing. I couldn't help but notice your avatar. EoB was my first game of this type. I can't tell you how many hours I played the three of them.
Post Reply