Help with ending.lua

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
wolfee
Posts: 12
Joined: Thu Jan 24, 2013 1:20 pm

Help with ending.lua

Post by wolfee »

Argh. I was in "preview" and went to Modding, wiped out my post, so it's gonna be shorter :) Basically, I copied intro.lua to ending.lua and edited a few things like the text, moved the text section above the title section, then changed the title section to just "The End". I also took out the cinematic hoping the text would just appear onscreen overlaying the room you're in. Well intro.lua starts and then the screen goes black and eventually starts playing the credits. So I'm doing something very wrong. Sorry, once again :)
=====================
-- ending music
enableUserInput()
startMusic("assets/samples/music/intro.ogg")

-- show the story text
sleep(1)
setFont("Intro")
textWriter([[
You have returned to where your adventure first began. blah blah blah..... However, you and your friends are the ones in a pit looking up.
Congratulations! Hope you enjoyed your adventure!
]])
click()
fadeOutText(0.5)

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

fadeOut(4)
fadeOutMusic(3)
===========
The script_entity is triggered by the wall button that opens the secret door back into the starting room.
wolfee
Posts: 12
Joined: Thu Jan 24, 2013 1:20 pm

Re: Help with ending.lua

Post by wolfee »

I found another thread with a sample script_entity pointing to ending.lua that shows me how to get the script_entity right, so that part is fixed. Now I just need to do a dry run and see how the ending actually looks.
Spank666evil
Posts: 1
Joined: Wed Feb 06, 2013 6:15 pm

Re: Help with ending.lua

Post by Spank666evil »

I get errors no matter what I try.
enableUserInput() - the game does not seem to know this.
Am I missing something like in the scripting files?
Also I tried clone item and that did not work either.
I have a finished dungeon ready to go but at the end it does not end.
I have a into also that will not work.
I have no experience coding so if you could help me out by giving me a step by step help I would really appreciate it.
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Help with ending.lua

Post by msyblade »

This thread may help u guys out.

viewtopic.php?f=14&t=4365

A common problem is that the image you point to will need to be in the "mod_assets" folder, while it initially points to just "assets".
to troubleshoot whether it is your pic or not causing the issue, you can use the path in the example above, it works with any grimrock install. Also, the sound file can cause incompatibilities. Make sure it's .ogg. Hope this helps you guys!
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
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: Help with ending.lua

Post by Drakkan »

Spank666evil wrote:I get errors no matter what I try.
enableUserInput() - the game does not seem to know this.
Am I missing something like in the scripting files?
Also I tried clone item and that did not work either.
I have a finished dungeon ready to go but at the end it does not end.
I have a into also that will not work.
I have no experience coding so if you could help me out by giving me a step by step help I would really appreciate it.
to end a game insert script in editor and insert in it code below. then just make somehow activated it (button, plate etc..)

function endgame()
completeGame("mod_assets/cinematics/ending.lua")
end

now you need create / edit this ending.lua file. here are instruction how to edit this file
http://www.grimrock.net/modding/how-to- ... inematics/

for cloning items it is quite simple - just open your scripts folder, there is file items.lua. again edit it. Example - you wanna create Old bow - variation of normal bow


cloneObject{
name = "old_shortbow", -- this will be displayed in editor
baseObject = "short_bow", -- this is base object you want to clone (original name from editor)
uiName = "Old Short Bow", -- this will be displayed to player
description = "Wood is used and string old, but still able to shoot.", -- new description
attackPower = 8, -- new attacl power
accuracy = -3, -- new accuracy
}

this way you can clone any item you want.
Hope this helped a little
Breath from the unpromising waters.
Eye of the Atlantis
Post Reply