How do you end the mod?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Jaymann
Posts: 14
Joined: Mon Oct 22, 2012 4:37 pm

How do you end the mod?

Post by Jaymann »

Is there a simple way to roll the credits when you reach the end of the mod?

Thanks!
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: How do you end the mod?

Post by Grimwold »

just call the completeGame() function

e.g.

Code: Select all

completeGame("mod_assets/cinematics/ending.lua")
Then create a script file called ending.lua in the same manner as intro.lua


This actually means you can have multiple endings.
Jaymann
Posts: 14
Joined: Mon Oct 22, 2012 4:37 pm

Re: How do you end the mod?

Post by Jaymann »

Grimwold wrote:just call the completeGame() function

e.g.

Code: Select all

completeGame("mod_assets/cinematics/ending.lua")
Then create a script file called ending.lua in the same manner as intro.lua


This actually means you can have multiple endings.
That makes sense, but how do you create such a script file? I don't see intro.lua anywhere in the mod_assets.
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: How do you end the mod?

Post by Grimwold »

Have a look at this thread, it has some good discussion on cinematics.
viewtopic.php?f=14&t=3377

There's also a page in the modding documentation about cinematics:
http://www.grimrock.net/modding/how-to- ... inematics/


As far as creating the file goes... you can create it in your favourite text editor, as long as you make sure you change the extension to .lua and not .txt
Jaymann
Posts: 14
Joined: Mon Oct 22, 2012 4:37 pm

Re: How do you end the mod?

Post by Jaymann »

Grimwold wrote:Have a look at this thread, it has some good discussion on cinematics.
viewtopic.php?f=14&t=3377

There's also a page in the modding documentation about cinematics:
http://www.grimrock.net/modding/how-to- ... inematics/


As far as creating the file goes... you can create it in your favourite text editor, as long as you make sure you change the extension to .lua and not .txt
OK, none of these scripts are working (error messages crash game), and I do not see the original files on my PC (is this because I downloaded from steam??).

Here is the file structure i have:

Documents\Almost Human\Legend of Grimrock\Dungeons\Test 03\mod_assets\

animations\(empty)
cinematics\(empty)
models\(empty)
scripts\dungeon.lua
scripts\init.lua
scripts\items.lua
scripts\materials.lua
scripts\monsters.lua
scripts\objects.lua
sdripts\recipies.lua
scripts\sounds.lua
scripts\spells.lua
scripts\wall_sets.lua
sounds\(empty)
textures\(empty)

Can someone please tell me exactly what goes where? Thanks!
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: How do you end the mod?

Post by Phitt »

By default the cinematics folder is empty, that's completely normal. Like Grimwold already said, you can use any text editor (even the default windows notepad) to create an ending.lua or intro.lua. Just change the extension from txt to lua. Put the lua(s) you created in the cinematics folder and you're good to go. Best is if you start small if you've never scripted before, otherwise you'll have tons of errors and never find out why it doesn't work.
Jaymann
Posts: 14
Joined: Mon Oct 22, 2012 4:37 pm

Re: How do you end the mod?

Post by Jaymann »

Phitt wrote:By default the cinematics folder is empty, that's completely normal. Like Grimwold already said, you can use any text editor (even the default windows notepad) to create an ending.lua or intro.lua. Just change the extension from txt to lua. Put the lua(s) you created in the cinematics folder and you're good to go. Best is if you start small if you've never scripted before, otherwise you'll have tons of errors and never find out why it doesn't work.
I am with you so far, and I agree start simple. But what text goes in the ending.lua (or intro) I am creating?
Jaymann
Posts: 14
Joined: Mon Oct 22, 2012 4:37 pm

Re: How do you end the mod?

Post by Jaymann »

This is hilarious, I got the credits to roll, but as soon as I enter the mod LOL! How do I get the script_entity to not kick in until I hit the pressure plate connector?
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: How do you end the mod?

Post by Grimwold »

I should have been more detailed when I explained about using completeGame()

Try adding something like this in a script entity:

Code: Select all

function endGame()
  completeGame("mod_assets/cinematics/myending.lua")
end
without the function part, the completeGame() will just fire as soon as the dungeon is loaded, which I guess is what you are seeing happen.

Now it won't complete the game until the function is called. To do this, add a connector from your pressure plate to the script entity, with the action endGame... now when you step on the plate it will run all code in the function endGame() and activate the completeGame command.
Jaymann
Posts: 14
Joined: Mon Oct 22, 2012 4:37 pm

Re: How do you end the mod?

Post by Jaymann »

That did the trick. Nothing custom yet, but at least you know the game is over.

You are a gentleman and a scholar!
Post Reply