Please or Register to create posts and topics.

Easy level restart and auto-restart on completion

This is a followup from my last thread with a brand-new question.

I'm developing a level for a gaming museum. We're basically trying to compress a miniature Portal 2 tutorial, along with a tutorial for a unique controller (the Novint Falcon), into a short level. However, we expect people will get stuck (or "stuck") often, simply leave the computer alone quite frequently, and we also want the level to restart automatically on completion.

How can I get it to restart the level on completion, and is there any easy way to add a "restart level" option to the escape menu?

(Alternate solution for the latter problem is to bind a key to "map dgm_novint_demo", which is hacky but functional.)

Note that this began life as a PTI level, so it's got a instances/p2editor/elevator_exit.vmf instance as the exit. This could theoretically be changed, although doing so scares me :)

(For those who are curious what I'm working on, http://cams.pavlovian.net/dgm/portal/dg ... mo_vmf.zip or http://cams.pavlovian.net/dgm/portal/dg ... mo_bsp.zip depending on whether you want the raw or built version. Yes, the text breaks immersion - we can't really avoid that with such a compressed experience. And yes, there are many ways to break the level or use unintended solutions, but we're considering unintended solutions to be bonus points.)

ZorbaTHut wrote:
This is a followup from my last thread with a brand-new question.

I'm developing a level for a gaming museum. We're basically trying to compress a miniature Portal 2 tutorial, along with a tutorial for a unique controller (the Novint Falcon), into a short level. However, we expect people will get stuck (or "stuck") often, simply leave the computer alone quite frequently, and we also want the level to restart automatically on completion.

The preview version of a PTI map does have this by default; decompile the map and see how they did it. But personally; once I've finished a map I don't want to play it again over and over again ;)

Quote:
How can I get it to restart the level on completion, and is there any easy way to add a "restart level" option to the escape menu?

Upload it to the workshop and it is a default option on escape. ;) Else... well it's almost impossible to do.

Quote:
(Alternate solution for the latter problem is to bind a key to "map dgm_novint_demo", which is hacky but functional.)

never do that; you might fuck someone's custom keybinds up.

Quote:
Note that this began life as a PTI level, so it's got a instances/p2editor/elevator_exit.vmf instance as the exit. This could theoretically be changed, although doing so scares me :)

PTI is a great tool to concept puzzles; but using it as a base for a hammer map is a bad idea; it's highly inflexible and the entities are generally also quite inefficient; because of all the situations it has to handle in the pti.

Quote:
Yes, the text breaks immersion - we can't really avoid that with such a compressed experience. And yes, there are many ways to break the level or use unintended solutions, but we're considering unintended solutions to be bonus points.)

The other option for text is voicelines; nicer; cleaner and less breaking experience.
As for unintended solutions; not fixing them is lazy. Only don't fix stuff that requires extreme ninja moves and a sane person would never come up with.

Well, to restart your level is easy by simply adding a point_clientcommand in your level and then adding a trigger where you want like so:

- OnTrigger > [point_clientcommand_name_here] > command > restart

You can add a trigger brush ("_multiple" or "_once") when you want your map to be restarted, for example somewhere along the ride of your departure elevator. But if you want that line to be triggered naturally and according to the timing you want, I'd suggest you to edit this instace inside your map:

- instances/p2editor/arrival_departure_transition_ents.vmf (don't forget to save it as a different name!)

Go to the thinest of the 3 roomies and edit the logic_relay called "@transition_from_map" adding there your output to restart the map. Notice that there are 2 outputs already, one that fades the map out and other that teleports the player to the final destination before disconnect... well, your output could be inbetween both outputs and don't forget to give each of them the desired delay so each happens in the right time.

EDIT

You can bind a key to the console command "restart" using that same point_clientcommand entity too and add any hint into the map so the player knows what key restarts the game...

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]

There's a parameter in one of the elevator instances that will make it restart just like if you're previewing it in the PTI.

Falsi sumus crusto!
Lpfreaky90 wrote:
Quote:
(Alternate solution for the latter problem is to bind a key to "map dgm_novint_demo", which is hacky but functional.)

never do that; you might fuck someone's custom keybinds up.

We'll be doing it on the demo computer only. Realistically, the map's never going to be played outside of our exhibit anyway.

Lpfreaky90 wrote:
Quote:
Yes, the text breaks immersion - we can't really avoid that with such a compressed experience. And yes, there are many ways to break the level or use unintended solutions, but we're considering unintended solutions to be bonus points.)

The other option for text is voicelines; nicer; cleaner and less breaking experience.
As for unintended solutions; not fixing them is lazy. Only don't fix stuff that requires extreme ninja moves and a sane person would never come up with.

Unfortunately it will be played in a crowded expo hall, which means we can't rely on it being audible. Also, we need for the first line of demonstration text to be displayed on the screen constantly until the player moves, since the computer's going to be spending a good deal of its time idle waiting for a user.

If this makes sense, the unintended solutions are intended - since the real focus of the level is the Novint controller, not the puzzles, we want people to have as much fun as possible wandering around and zapping things with portals.

josepezdj wrote:
You can bind a key to the console command "restart" using that same point_clientcommand entity too and add any hint into the map so the player knows what key restarts the game...

Aha! This'll be perfect, and we won't have to do extra setup on the demo computer.

Realistically we're going to have a little label attached to the side of the monitor with a few notes, and we'll include the "restart" button there. Although part of me also wants it to auto-restart when it hasn't been touched for a minute, but I suspect that'll be much, much harder to set up.

FelixGriffin wrote:
There's a parameter in one of the elevator instances that will make it restart just like if you're previewing it in the PTI.

I don't suppose you know the name of the parameter, or how to find it? I am not skilled enough to unearth it on my own.

It's called $no_player_start. Set it to 0 to have it act like a PTI-exported map where you start in front of the door and loop back at the end. I think it's in both the entrance elevator and airlock, you'd need to change it in both.

Falsi sumus crusto!

ah; okay makes a lot more sense ;)