Page 1 of 2
How to make "beginning text" and "ending" text for dungeon?
Posted: Wed Sep 26, 2012 3:54 pm
by whackangel
I am having trouble finding a neat and clear explaination about how to create simple lua-scripted texts. I just want a "beginning text" on a black screen before the dungeon starts, and a "ending" text at the end, also with black screen, that sets the dungeon's ending.
Can someone explain to me what I have to do ?
Cheers.
Re: How to make "beginning text" and "ending" text for dunge
Posted: Wed Sep 26, 2012 5:58 pm
by Montis
Re: How to make "beginning text" and "ending" text for dunge
Posted: Wed Sep 26, 2012 7:11 pm
by whackangel
It actually does not. Or I might do something wrong but I feel helpless. Too many details or circunvolutions which are not giving me clues to go the simple way.
Re: How to make "beginning text" and "ending" text for dunge
Posted: Wed Sep 26, 2012 9:38 pm
by SpacialKatana
What don't you understand? The link Montis gave you has all the info you need...do you have a specific problem?
Re: How to make "beginning text" and "ending" text for dunge
Posted: Wed Sep 26, 2012 10:40 pm
by Neikun
I'm fairly certain cinematics with no image selected are done on a black screen.
If not, I'm sure you could just make your own black image.
Re: How to make "beginning text" and "ending" text for dunge
Posted: Thu Sep 27, 2012 6:01 pm
by whackangel
I don't know why, but every time I try to luascript something, there's a "global" error thingy, or and "nil value" error and I don't know how to get around this.
I also would like a little example of script to end the game, such as going to credit or something.
Lua seems very hard to me... thank you guys for your help.
Re: How to make "beginning text" and "ending" text for dunge
Posted: Thu Sep 27, 2012 6:41 pm
by SpacialKatana
First make a file in the cinematic folder called "myending.lua" with this code:-
Code: Select all
-- simple one image cinematic
enableUserInput()
startMusic("assets/samples/music/myending.ogg")
-- show the image
showImage("mod_assets/textures/cinematic/outro/my_outro.tga")
fadeIn(2)
sleep(4)
setFont("Intro")
textWriter([[
You completed my dungeon! Well done blah blah blah!
]])
click()
fadeOutText(0.5)
fadeOut(4)
fadeOutMusic(3)
Obviously you need to put a picture in /mod_assets/textures/cinematic/outro/ for the pic to show.
Next you could use a hidden pressure plate on the floor in the corridor where the party escapes (for example), to trigger a script_entity with this code:-
Code: Select all
function endgame()
completeGame("mod_assets/textures/cinematic/myending.lua")
end
When you step on the plate, the game ends showing your pic with the "You completed...." text on it !
Hope this helps.
Be advised, intro and outro cinematics only work in-game, not in the editor preview.
Re: How to make "beginning text" and "ending" text for dunge
Posted: Thu Sep 27, 2012 8:31 pm
by whackangel
oh ok... I see the pattern. I have to learn how to create a cinematix .lua file then...
thanks for the headsup !
Re: How to make "beginning text" and "ending" text for dunge
Posted: Thu Sep 27, 2012 8:57 pm
by Komag
it's just a .txt file that you rename .lua
Re: How to make "beginning text" and "ending" text for dunge
Posted: Fri Sep 28, 2012 9:59 am
by whackangel
ok cheers.
You've been of great help guys.
The 'beta' version of my little dungeon can be found in the workshop under the name "The Next Level". Unfinished business of course, but it is an about one hour course so far.
If you want to give it a try...