Hi I am trying to figure out how to make a custom intro this is my intro.lua which I placed in mod_assets/cinematics
-- cinematic with a title and story text
enableUserInput()
startMusic("mod_assets/sounds/music/48Stonekeep.ogg")
showImage("mod_assets/textures/cinematic/intro/wizard.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([[
You will eat meat!!!!
You must venture forth and disassemble the nefarious inanimate object!
]])
click(1)
fadeOutText(0.5)
fadeOut(4)
fadeOutMusic(3)
the file paths are correct for the image and music,my image is in dds format,I save my dungeon and export it.
When I start a new game with my custom dungeon absolutely nothing happens,the game just starts with no intro.
I've read everything Google can find on the subject but nothing I try works.I tried to make a script entity with the same code as my intro.lua but the game crashes and I get this message---
#intro:2: attempt to call global 'enableUserInput' (a nil value)
stack traceback:
#intro: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.2
OEM ID: 0
Number of processors: 2
Page size: 4096
Processor type: 586
Total memory: 3678 MB
Free memory: 1400 MB
Display device 0:
Device name: \\.\DISPLAY1
Device string: AMD Radeon HD 6300 series Graphics
State flags: 00000005
Display device 1:
Device name: \\.\DISPLAY2
Device string: AMD Radeon HD 6300 series Graphics
State flags: 08000000
If anyone can give me a hand I would really be gratefull
Please help
why will my intro cinematic not work
- JohnWordsworth
- Posts: 1397
- Joined: Fri Sep 14, 2012 4:19 pm
- Location: Devon, United Kingdom
- Contact:
Re: why will my intro cinematic not work
Just a quick FYI, this post appears to be in the wrong section - it should really be in the 'Modding' section of the Legend of Grimrock 1 board, not the discussion of Grimrock 2 board.
At first glance, your intro.lua script appears to be correct. I'm pretty sure that the introduction is ONLY played if you Export your dungeon and run the dungeon using the 'Custom Dungeon' menu item from the main menu of Grimrock. If you are just hitting 'play' in the dungeon editor, I wouldn't expect intro.lua to play (and it would be quite annoying after a while if it did I think!). If you are definitely exporting the dungeon and running it from the main menu, then I will take another look at your intro.lua script to make sure it's all good.
The functions that you can call from intro.lua and any ending.lua files that you create are only available within those scripts. You cannot use the same functions in a script entity, so things like enableUserInput() and sleep(N) should only exist in intro.lua and ending.lua files. They will cause issues if used anywhere else.
At first glance, your intro.lua script appears to be correct. I'm pretty sure that the introduction is ONLY played if you Export your dungeon and run the dungeon using the 'Custom Dungeon' menu item from the main menu of Grimrock. If you are just hitting 'play' in the dungeon editor, I wouldn't expect intro.lua to play (and it would be quite annoying after a while if it did I think!). If you are definitely exporting the dungeon and running it from the main menu, then I will take another look at your intro.lua script to make sure it's all good.
The functions that you can call from intro.lua and any ending.lua files that you create are only available within those scripts. You cannot use the same functions in a script entity, so things like enableUserInput() and sleep(N) should only exist in intro.lua and ending.lua files. They will cause issues if used anywhere else.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
-
solomonsgrave
- Posts: 12
- Joined: Sun Aug 18, 2013 10:43 pm
Re: why will my intro cinematic not work
Thanks yea I noticed I put it in the wrong category.I put it up in modding too just forgot to delete this one.I am exporting it and playing it from the main menu custom dungeons option,but it just starts the dungeon.I just tried the script entity thing because I was out of ideas.I have no experience in this stuff,but it seems to make sense,I just cant make it start.
Re: why will my intro cinematic not work
some troubleshooting suggestions for you:
1: The fact that it does not crash, and just skips the intro makes me think to check the intro.lua file and make sure it is actually a .lua file. You cannot simply make a text file and name it ".lua". You will need to copy a .lua from somewhere else and rename it.
2: Near the end of your intro.lua, change the "click(1)" to just "click()".
3: On the first showImage, change it to this to check for a compatibility issue:
showImage("assets/textures/cinematic/intro/page03.tga")
4: If it's still not working, you may try converting the .ogg through the website "media.io". It solves compatibility issues with both .ogg and .wavs for me.
The final 3 are kind of nitpicking for the sake of troubleshooting. The symptoms point to the intro file being a txt instead of .lua at first glance.
Hope this helps, keep us updated!
1: The fact that it does not crash, and just skips the intro makes me think to check the intro.lua file and make sure it is actually a .lua file. You cannot simply make a text file and name it ".lua". You will need to copy a .lua from somewhere else and rename it.
2: Near the end of your intro.lua, change the "click(1)" to just "click()".
3: On the first showImage, change it to this to check for a compatibility issue:
showImage("assets/textures/cinematic/intro/page03.tga")
4: If it's still not working, you may try converting the .ogg through the website "media.io". It solves compatibility issues with both .ogg and .wavs for me.
The final 3 are kind of nitpicking for the sake of troubleshooting. The symptoms point to the intro file being a txt instead of .lua at first glance.
Hope this helps, keep us updated!
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
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
-
solomonsgrave
- Posts: 12
- Joined: Sun Aug 18, 2013 10:43 pm
Re: why will my intro cinematic not work
Hello again just wanted to let you know I got it!!Thanks again for checking my thread for me.I changed my image.dds file path to mod_assets/cinematics/image.tga instead of mod_assets/textures/cinematic/intro/image.tga and followed suit on my music.It worked instantly.Apparently I followed the example on the modding page too closely.
I was giving the correct file path in my .lua but they weren't supposed to be there I guess.I now have The power of the
sweet bits I wanted HAHAHAHAHAHA!!!! lol
I was giving the correct file path in my .lua but they weren't supposed to be there I guess.I now have The power of the
sweet bits I wanted HAHAHAHAHAHA!!!! lol