Page 1 of 1
Opening/Ending Cinematics/credits
Posted: Tue Feb 03, 2015 11:43 am
by LexxieJ
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!
Re: Opening/Ending Cinematics/credits
Posted: Tue Feb 03, 2015 1:50 pm
by Frenchie
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)
Re: Opening/Ending Cinematics/credits
Posted: Tue Feb 03, 2015 2:01 pm
by LexxieJ
You are an absolute star, thank you!
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.
Re: Opening/Ending Cinematics/credits
Posted: Tue Feb 03, 2015 2:08 pm
by Drakkan
LexxieJ wrote:You are an absolute star, thank you!
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 ?
Re: Opening/Ending Cinematics/credits
Posted: Tue Feb 03, 2015 2:33 pm
by LexxieJ
Drakkan wrote:LexxieJ wrote:You are an absolute star, thank you!
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!
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?
Re: Opening/Ending Cinematics/credits
Posted: Tue Feb 03, 2015 5:53 pm
by msyblade
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.)
Re: Opening/Ending Cinematics/credits
Posted: Tue Feb 03, 2015 6:10 pm
by LexxieJ
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.
Re: Opening/Ending Cinematics/credits
Posted: Tue Feb 03, 2015 7:30 pm
by minmay
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,
Re: Opening/Ending Cinematics/credits
Posted: Tue Feb 03, 2015 7:54 pm
by Drakkan
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 :/
Re: Opening/Ending Cinematics/credits
Posted: Wed Feb 04, 2015 12:30 am
by minmay
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.