Display score variable in cinematics

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
zalewapl
Posts: 45
Joined: Sun Apr 22, 2012 12:39 am

Display score variable in cinematics

Post 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.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Display score variable in cinematics

Post by Neikun »

I saw someone use particle systems for words in game space.
Alternatively, what if you used hudPrint and counters?
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
zalewapl
Posts: 45
Joined: Sun Apr 22, 2012 12:39 am

Re: Display score variable in cinematics

Post 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.
Last edited by zalewapl on Mon Oct 29, 2012 1:31 am, edited 2 times in total.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Display score variable in cinematics

Post 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
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Komag
Posts: 3654
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Display score variable in cinematics

Post 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.
Finished Dungeons - complete mods to play
nichg
Posts: 48
Joined: Thu Oct 11, 2012 12:38 pm

Re: Display score variable in cinematics

Post 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.
User avatar
zalewapl
Posts: 45
Joined: Sun Apr 22, 2012 12:39 am

Re: Display score variable in cinematics

Post 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.
nichg
Posts: 48
Joined: Thu Oct 11, 2012 12:38 pm

Re: Display score variable in cinematics

Post 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.
User avatar
Wolfrug
Posts: 55
Joined: Wed Oct 03, 2012 6:56 pm

Re: Display score variable in cinematics

Post 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
Try my Mordor: Depths of Dejenol LoG-ification. Feedback much appreciated!
User avatar
zalewapl
Posts: 45
Joined: Sun Apr 22, 2012 12:39 am

Re: Display score variable in cinematics

Post 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.
Post Reply

Return to “Modding”