How To End A Game and Game Over when falling into traps ?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Fantastic
Posts: 11
Joined: Wed Nov 05, 2014 6:45 pm

How To End A Game and Game Over when falling into traps ?

Post by Fantastic »

Im completely new to this - so here are my first two question i have in mind at the moment:

1) How can i define a point in my own dungeon to end a game, to say "congratulation, levels done" ? which item or tile is necessary ?
2) How can i define a Game Over screen when falling into traps ? Right now , when falling into, the screen gets dark but the game is not over and there is no game over screen.

thanks for help in advance.
User avatar
Baddock
Posts: 12
Joined: Tue Nov 04, 2014 8:28 pm

Re: How To End A Game and Game Over when falling into traps

Post by Baddock »

Well I can tell you that you are seeing the black screen when you fall into the pit because it causes a level transition similar to stairs, but if you don't have a level defined below your current one, or there are walls and not a level then you end up in the "black screen."

Not sure how you would right a script to cause a "game over" screen.
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: How To End A Game and Game Over when falling into traps

Post by Doridion »

For the "game over" screen, you can just "kill" your party, but perhaps violent technique :D

For the "Win" screen, I think you can place a trigger that stop the party, spawning a visual effect ( like particles + flash ) and showing a message "You finished the level".
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: How To End A Game and Game Over when falling into traps

Post by Montis »

To get a proper ending, you can use the function

Code: Select all

GameMode.completeGame(filename)
Also check for the GameMode section in the Scripting Reference, there might be some other helpful things that you could fiddle with.

I haven't tried it out yet but I could imagine it works somewhat similar to the LoG1 cinematics, see here: http://www.grimrock.net/modding_log1/ho ... inematics/
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
Fantastic
Posts: 11
Joined: Wed Nov 05, 2014 6:45 pm

Re: How To End A Game and Game Over when falling into traps

Post by Fantastic »

Ok, but how can i connect the fall into the trap with a new level ?
User avatar
Jouki
Posts: 127
Joined: Fri Oct 24, 2014 12:57 pm

Re: How To End A Game and Game Over when falling into traps

Post by Jouki »

Fantastic wrote:Ok, but how can i connect the fall into the trap with a new level ?
Just create a new level under actual level [x,y,z] so new level will be [x,y,z+1] (from 0,0,0 to 0,0,1)
Fantastic
Posts: 11
Joined: Wed Nov 05, 2014 6:45 pm

Re: How To End A Game and Game Over when falling into traps

Post by Fantastic »

Thanks ! Added An invisible teleporter under a trap to beam me back to start position. 2nd solution: built a new level with a spin trap combined with a timer to get the game over screen.
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: How To End A Game and Game Over when falling into traps

Post by NutJob »

Sorry to ask this question here but it's kind of related and I would have a solution if someone can answer this:

There's an isFalling() method on the party but shouldn't there be an onFalling event hook? How can isFalling ever be used?

Edit: duh, it's probably utilized with onMove...maybe? Once I stop drinking this beer I'll check it out.

Edit: duhx2, the onMove may not even work because the transition may get fired once it looks like you're falling. Still drinking beer.
Last edited by NutJob on Fri Nov 07, 2014 2:52 am, edited 1 time in total.
User avatar
Isaac
Posts: 3179
Joined: Fri Mar 02, 2012 10:02 pm

Re: How To End A Game and Game Over when falling into traps

Post by Isaac »

NutJob wrote:Sorry to ask this question here but it's kind of related and I would have a solution if someone can answer this:

There's an isFalling() method on the party but shouldn't there be an onFalling event hook? How can isFalling ever be used?

Edit: duh, it's probably utilized with onMove...maybe? Once I stop drinking this beer I'll check it out.
Just place a floor trigger over the hole.

** It doesn't need to be a pit asset; it can be a -7 floor, with a trigger placed a few elevation levels down the drop.
Montis wrote:I haven't tried it out yet but I could imagine it works somewhat similar to the LoG1 cinematics, see here: http://www.grimrock.net/modding_log1/ho ... inematics/
LoG2 supports compressed videos. 8-)
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: How To End A Game and Game Over when falling into traps

Post by NutJob »

Isaac wrote: ** It doesn't need to be a pit asset; it can be a -7 floor, with a trigger placed a few elevation levels down the drop.
But then you can't have the nifty open trap "doors". Just got another beer.
Post Reply