Page 1 of 1

Problems with Intro

Posted: Tue Oct 02, 2012 1:22 pm
by Hermundure
Hi all,

I would be glad for an advice because my intro crashes every time I start a game,

I followed the official instructions on how to create an intro very closely, I created the intro.lua file in the cinematic folder and copied everything from the official script into the file but something seems wrong with the enableUserInput line there, here is the error report:

#script_entity_1:2: attempt to call global 'enableUserInput' (a nil value)
stack traceback:
#script_entity_1:2: in main chunk
[string "ScriptEntity.lua"]: in main chunk
[string "Map.lua"]: in function 'sendMessage'
[string "GameMode.lua"]: in function 'newGame'
[string "GameMode.lua"]: in function 'startGame'
[string "NewGameMenu.lua"]: in function 'startGame'
[string "NewGameMenu.lua"]: in function 'update'
[string "GameMode.lua"]: in function 'update'
[string "Grimrock.lua"]: in function 'display'
[string "Grimrock.lua"]: in main chunk

OS Version 6.1

OEM ID: 0
Number of processors: 8
Page size: 4096
Processor type: 586

Total memory: 8125 MB
Free memory: 5580 MB

Display device 0:
Device name: \\.\DISPLAY1
Device string: NVIDIA GeForce GTS 360M
State flags: 00000005

Display device 1:
Device name: \\.\DISPLAY2
Device string: NVIDIA GeForce GTS 360M
State flags: 00000000

Display device 2:
Device name: \\.\DISPLAYV1
Device string: RDPDD Chained DD
State flags: 00000008

Display device 3:
Device name: \\.\DISPLAYV2
Device string: RDP Encoder Mirror Driver
State flags: 00200008

Display device 4:
Device name: \\.\DISPLAYV3
Device string: RDP Reflector Display Driver
State flags: 00200008

Re: Problems with Intro

Posted: Tue Oct 02, 2012 1:30 pm
by Grimwold
any chance you can post the contents of your intro.lua script?


Here's my stupidly simple one that works ok:
SpoilerShow

Code: Select all

-- simple one image cinematic
enableUserInput()
startMusic("assets/samples/music/intro.ogg")
fadeIn(1)

-- show the story text
sleep(1)
setFont("Intro")
textWriter("First there was the Sample Dungeon")
click()
fadeOutText(0.5)
sleep(1)
textWriter("You Sampled it...")
click()
fadeOutText(0.5)
sleep(1)
setFont("Intro")
textWriter("Then there was the Test Dungeon")
click()
fadeOutText(0.5)
sleep(1)
textWriter("And You were tested...")
click()
fadeOutText(0.5)
sleep(1)
textWriter("Now we bring you...")
click()
fadeOutText(0.5)


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

fadeOutMusic(3)

Re: Problems with Intro

Posted: Tue Oct 02, 2012 1:54 pm
by Hermundure
Of course, as I said its exactly the script used in the official guide http://www.grimrock.net/modding/how-to- ... inematics/ but here it is:



-- cinematic with a title and story text
enableUserInput()
startMusic("assets/samples/music/intro.ogg")

showImage("assets/textures/cinematic/intro/page01.tga")
fadeIn(2)

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

-- show the story text
sleep(1)
setFont("Intro")
textWriter([[
Some folks call it the Evil Railing. Or the Vile Balustrade.
However, no matter what you decide to call it, it is certain that
the Sinister Bannister is an ancient source of distraught and ill fortune.

You must venture forth and disassemble the nefarious inanimate object!
]])
click()
fadeOutText(0.5)

fadeOut(4)
fadeOutMusic(3)

Re: Problems with Intro

Posted: Tue Oct 02, 2012 2:04 pm
by Grimwold
I pasted everything into a new intro.lua script in the cinematics folder of my test dungeon and it worked perfectly.. so not sure what's causing your crash... the only thing I can think is that maybe you've not put the script in the right place.. which should be mod_assets\cinematics\intro.lua


This doesn't help you, but here's some screenshots to show you it working...
SpoilerShow
Image
SpoilerShow
Image

Re: Problems with Intro

Posted: Tue Oct 02, 2012 3:06 pm
by Hermundure
Very strange,

its in the correct place but I will start a new project, restart pc etc and look if its working.

Thank you for your info ;-)