Page 1 of 1
Display score variable in cinematics
Posted: Sun Oct 28, 2012 9:08 pm
by zalewapl
I would like to display score at the end of my dungeon. Is there a way to do so in the cinematics? I tried keeping the score in a script in the dungeon itself and then refering to it through "scoreLua.score" statement but it crashed the game.
Re: Display score variable in cinematics
Posted: Sun Oct 28, 2012 11:04 pm
by Neikun
I saw someone use particle systems for words in game space.
Alternatively, what if you used hudPrint and counters?
Re: Display score variable in cinematics
Posted: Sun Oct 28, 2012 11:10 pm
by zalewapl
Neikun wrote:I saw someone use particle systems for words in game space.
I'm under impression that you didn't understand my post correctly. I don't need to display score balloons during the game. I guess that's what the particle system would be good for. I want to display the score at the end of the game. That is after a call to completeGame() but before the credits roll.
Neikun wrote:Alternatively, what if you used hudPrint and counters?
It's true that I could display the score in the game itself before the call to completeGame(), but this is a workaround. The preferable way for me would be to display it in the cinematics.
I'm beginning to think that it won't be possible because the thing that crashed the game is somehow related to this:
viewtopic.php?p=40590#p40590
EDIT:
Then again, I was wrong, and that thread is unrelated.
Re: Display score variable in cinematics
Posted: Sun Oct 28, 2012 11:13 pm
by Neikun
ohhhh. I understand now. Kinda like
"The End!
You killed (n) Slimes!"
I dunno how you would go about having a function inside a cinematic.
Very good question, though
Re: Display score variable in cinematics
Posted: Sun Oct 28, 2012 11:27 pm
by Komag
You could have a "ranking", with maybe 5 different custom pics with embedded text, so if they killed over 100 they get the "best" ending with a message on the graphic saying they kill over 100 slimes, or 80-100 for the next best, etc.
Re: Display score variable in cinematics
Posted: Mon Oct 29, 2012 12:57 am
by nichg
Oh... so one thing that I should mention. Part of the reason things were crashing when I was testing things in that thread is because hudPrint didn't like an integer argument. print can handle it, but not hudPrint. You might need to explicitly cast the score to a string to use it in the cinematics text function.
Re: Display score variable in cinematics
Posted: Mon Oct 29, 2012 1:32 am
by zalewapl
nichg wrote:Oh... so one thing that I should mention. Part of the reason things were crashing when I was testing things in that thread is because hudPrint didn't like an integer argument. print can handle it, but not hudPrint. You might need to explicitly cast the score to a string to use it in the cinematics text function.
I did a quick test. I placed this in the cinematics script:
Code: Select all
if scoreLua ~= nil then
showText("scoreLua not nil")
else
showText("scoreLua is nil")
end
It printed the string in the 'else' block so there's no doubt that cinematics have no access to scripts that are located in levels.
Re: Display score variable in cinematics
Posted: Mon Oct 29, 2012 4:05 am
by nichg
Weird thought: can you access party, and its champions? You could do something with inventory tokens or something. A bit of a hack, but what you'd do is spawn them only when the game is just about to end. Or even something more disruptive like setting one of the champions' health or mana to the score, and then read that out.
Re: Display score variable in cinematics
Posted: Mon Oct 29, 2012 10:46 am
by Wolfrug
Or simply set a counter to whatever value, IF you can access game material during end credits. I wouldn't count on it though.
-Wolfrug
Re: Display score variable in cinematics
Posted: Mon Oct 29, 2012 6:49 pm
by zalewapl
I decided to go for the workaround. I added a closed off section at the end of the dungeon right before the actual exit. A scroll spawns there when party enters the area and score is written on it. It kind of kills the immersion but it's a solution.