Opening/Ending Cinematics/credits

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
LexxieJ
Posts: 4
Joined: Tue Feb 03, 2015 11:28 am
Location: Nottingham, UK

Opening/Ending Cinematics/credits

Post by LexxieJ » Tue Feb 03, 2015 11:43 am

Hi guys- erstwhile lurker, first-time poster & lua noob/script kiddie here.

I'm hoping one of you can help me. I've had great fun creating a simple mod dungeon but I can't for the life of me get either opening or closing cinematics to work.

I've searched the forums and found the official cinematic advice, as well as the scrolling text credits thread, but neither of them work, even if copied and pasted directly and any custom assets (i.e. images and sounds) commented out. They were obviously originally written for LoG1. Does completeGame() even work now?

I have the following code triggered as an ending

Code: Select all

-- do ending stuff
function ending()

completeGame("mod_assets/cinematics/ending.lua")

end
with the relevant ending.lua code in the correct place in the correct folder, but whenever I try to run it I get

'attempt to call global 'completeGame' (a nil value) appear next to it

Help me Obi-Forum, you're my only hope!

User avatar
Frenchie
Posts: 219
Joined: Wed Oct 16, 2013 2:50 am

Re: Opening/Ending Cinematics/credits

Post by Frenchie » Tue Feb 03, 2015 1:50 pm

try using GameMode.completeGame(filename) as LoG2 works with components now...

For more info see the Scripting Reference

ruled by His Shadow... (since you winked at Star Wars, I winked at Lexx, the tv series)
Last edited by Frenchie on Tue Feb 03, 2015 2:08 pm, edited 2 times in total.

User avatar
LexxieJ
Posts: 4
Joined: Tue Feb 03, 2015 11:28 am
Location: Nottingham, UK

Re: Opening/Ending Cinematics/credits

Post by LexxieJ » Tue Feb 03, 2015 2:01 pm

You are an absolute star, thank you! :D

I'd had a look through the scripting reference but hadn't thought of looking at GameMode as it was never on LoG1.

Very much appreciated Frenchie.

User avatar
Drakkan
Posts: 1317
Joined: Mon Dec 31, 2012 12:25 am

Re: Opening/Ending Cinematics/credits

Post by Drakkan » Tue Feb 03, 2015 2:08 pm

LexxieJ wrote:You are an absolute star, thank you! :D

I'd had a look through the scripting reference but hadn't thought of looking at GameMode as it was never on LoG1.

Very much appreciated Frenchie.
please could you give me more hints how it is working for you ? are you using DDS pictures or some scrolling text ? which resolution ans size of pictures ?
Breath from the unpromising waters.
Eye of the Atlantis

User avatar
LexxieJ
Posts: 4
Joined: Tue Feb 03, 2015 11:28 am
Location: Nottingham, UK

Re: Opening/Ending Cinematics/credits

Post by LexxieJ » Tue Feb 03, 2015 2:33 pm

Drakkan wrote:
LexxieJ wrote:You are an absolute star, thank you! :D

I'd had a look through the scripting reference but hadn't thought of looking at GameMode as it was never on LoG1.

Very much appreciated Frenchie.
please could you give me more hints how it is working for you ? are you using DDS pictures or some scrolling text ? which resolution ans size of pictures ?
Actually it isn't. I don't get the error message I had before and the completeGame function actually runs now, in as much as I get a 'Game Completed' hud message within the editor, but when exported & attempting to play the game I get a whole new error. Yay! :oops:

The error I get now is

[string "VideoMode.lua"]:0: Not a valid IVF file: mod_assets/cinematics/ending.lua
stack traceback:
[C]: in function 'open'
[string "VideoMode.lua"]: in function 'update'
[string "Grimrock.lua"]: in function 'display'
[string "Grimrock.lua"]: in main chunk

Which is rather odd as I have NO video or audio files in the script so not sure where the VideoMode.lua thing comes from. The script itself was one that's been copied directly from another thread except for music and images commented out; I was using this purely to try and get a game ending to actually work. The code from the other thread is below

Code: Select all

-- cinematic with a title and story text
    enableUserInput()
--startMusic("mod_assets/sounds/intro.ogg")

 --showImage("mod_assets/textures/intro/intro.tga")
    fadeIn(2)

    -- show the title text
    sleep(1)
    setFont("IntroTitle")
    showText("The End", 3)
    sleep(2)
    fadeOutText(1)

    -- show the story text
    sleep(1)
    setFont("Intro")
    textWriter([[
     Enter your game end storyline text here,

    use enter to get proper spacing, but limit to one page

    ]])
    click()
    fadeOutText(0.5)

    -- show the story text
    sleep(1)
    setFont("Intro")
    textWriter([[
    "Your Mod" Credits:

         Designed, written, and created by "you"

                Custom assets:
    Custom Wallsets by Daniv

    ]])
    click()
    fadeOutText(0.5)

    fadeOut(4)
    fadeOutMusic(3)
Any ideas?

User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Opening/Ending Cinematics/credits

Post by msyblade » Tue Feb 03, 2015 5:53 pm

Unfortunately, we are unable to diagnose issues with the new Intro and completeGame functions until the asset pack is released. Seems everyone playing with it is having problems so far, so I would surmise that many of the commands and syntaxes have changed. The asset pack will detail how to use it properly, and people around here much smarter than myself will have many simple solutions and answers for you (us).
There is no current timetable for the asset pack, my guess is somewhere between 3 weeks and 5 months.

Hope this helps! (to understand why we can't help, yet.)
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades

User avatar
LexxieJ
Posts: 4
Joined: Tue Feb 03, 2015 11:28 am
Location: Nottingham, UK

Re: Opening/Ending Cinematics/credits

Post by LexxieJ » Tue Feb 03, 2015 6:10 pm

msyblade wrote:Unfortunately, we are unable to diagnose issues with the new Intro and completeGame functions until the asset pack is released. Seems everyone playing with it is having problems so far, so I would surmise that many of the commands and syntaxes have changed. The asset pack will detail how to use it properly, and people around here much smarter than myself will have many simple solutions and answers for you (us).
There is no current timetable for the asset pack, my guess is somewhere between 3 weeks and 5 months.

Hope this helps! (to understand why we can't help, yet.)
No, that's fine- thank you. I'm just kinda relieved that it's not just me being daft if the mega-brains on here haven't quite figured it out yet either. ;)

Crying shame really, as these things are rather important for a mod feeling complete.

Thanks again for all the help- it really is much appreciated.

minmay
Posts: 2690
Joined: Mon Sep 23, 2013 2:24 am

Re: Opening/Ending Cinematics/credits

Post by minmay » Tue Feb 03, 2015 7:30 pm

Guys, completeGame() in Grimrock 2 doesn't take a lua file as an argument. It takes a video in IVF format. If you pass it something that is not a path to a video file, you'll get that error. If you had looked at the asset pack that has already been released, you would have known this already: look at the asset definitions for the portals.

Code: Select all

class = "Portal",
onArrival = function()
  GameMode.completeGame("assets/videos/outro1.ivf")
end,

Code: Select all

class = "Portal",
onArrival = function()
  GameMode.completeGame("assets/videos/outro2.ivf")
end,
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.

User avatar
Drakkan
Posts: 1317
Joined: Mon Dec 31, 2012 12:25 am

Re: Opening/Ending Cinematics/credits

Post by Drakkan » Tue Feb 03, 2015 7:54 pm

minmay wrote:Guys, completeGame() in Grimrock 2 doesn't take a lua file as an argument. It takes a video in IVF format. If you pass it something that is not a path to a video file, you'll get that error. If you had looked at the asset pack that has already been released, you would have known this already: look at the asset definitions for the portals.

Code: Select all

class = "Portal",
onArrival = function()
  GameMode.completeGame("assets/videos/outro1.ivf")
end,

Code: Select all

class = "Portal",
onArrival = function()
  GameMode.completeGame("assets/videos/outro2.ivf")
end,
unfortunately it is not working for any custom video, seems kinda broken. Working only for original IVF videos :/
Breath from the unpromising waters.
Eye of the Atlantis

minmay
Posts: 2690
Joined: Mon Sep 23, 2013 2:24 am

Re: Opening/Ending Cinematics/credits

Post by minmay » Wed Feb 04, 2015 12:30 am

Ah, custom videos. Those are slightly trickier: what you need to do is change the file extension. Dungeon export apparently ignores anything without certain extensions (such as .model and .dds) and .ivf isn't on that list. So rename "video.ivf" to "video.model" or something (and update your reference to it, obviously), and then export will put it in the dat file.
The video might also be required to be 1280x720; haven't tested that.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.

Post Reply