capturing the state of a map, and reverting
Quote from BenVlodgi on April 4, 2012, 7:54 amDoes anyone know if there is a relativly easy way to capture the state of a map...like an autosave, but I would like to revert back to this state at will, specifically during coop
Does anyone know if there is a relativly easy way to capture the state of a map...like an autosave, but I would like to revert back to this state at will, specifically during coop
Quote from ChickenMobile on April 5, 2012, 2:07 amReverting back to a save in multi-player is literally impossible (seeing as you cant save a multiplayer game).
I think the best thing you can do is have branches which activate once an important element in your puzzle has been completed. Then you can make objects spawn where you need them to be / turn on and off things based on the state of your branches.
e.g. If you want a checkpoint to happen when someone turns on a laser: have whatever output that turns on the laser change a branch state to 1 (make this only fire once). Once you want to revert back to this checkpoint 'Test' all branches which affect your puzzle elements and even if the laser has been turned off again the 'OnTrue' output will enable the laser again.
If you want to save the position of the players', you probably need to use some sort of script which grabs the player's position at that current moment and then resets it back to there when you want to revert.
EDIT: This is also overly complex so I suggest you use airlock-like devices like Valve did
EDIT2: I spelt Multiplayer wrong
Reverting back to a save in multi-player is literally impossible (seeing as you cant save a multiplayer game).
I think the best thing you can do is have branches which activate once an important element in your puzzle has been completed. Then you can make objects spawn where you need them to be / turn on and off things based on the state of your branches.
e.g. If you want a checkpoint to happen when someone turns on a laser: have whatever output that turns on the laser change a branch state to 1 (make this only fire once). Once you want to revert back to this checkpoint 'Test' all branches which affect your puzzle elements and even if the laser has been turned off again the 'OnTrue' output will enable the laser again.
If you want to save the position of the players', you probably need to use some sort of script which grabs the player's position at that current moment and then resets it back to there when you want to revert.
EDIT: This is also overly complex so I suggest you use airlock-like devices like Valve did
EDIT2: I spelt Multiplayer wrong
Quote from Lpfreaky90 on April 5, 2012, 2:15 amchickenmobile wrote:Reverting back to a save in multi-player is literally impossible (seeing as you cant save a multilayer game).I think the best thing you can do is have branches which activate once an important element in your puzzle has been completed. Then you can make objects spawn where you need them to be / turn on and off things.
Saving EVERY variable you can possibly have and let a combination of logics be the solution to your map! not the output of some buttons but an insanely complicated logic
Just kidding of course.
What valve did in their maps is working with the checkpoints/coop locks. If this is for the "humans die together" you can change the airlocks to have things like the vita-chambers from bioshock or something similar. The important thing is that if the players die in coop they shouldn't spent more then 2-3 minutes to get back to the position they were before, otherwise it could get frustrating.
I have no idea on how those checkpoints work since I've never made a coop level yet. But possibly you can have a button that does the same thing? If that would work you could consider adding a save button or binding one of the keyboard keys to do the same thing.
I think the best thing you can do is have branches which activate once an important element in your puzzle has been completed. Then you can make objects spawn where you need them to be / turn on and off things.
Saving EVERY variable you can possibly have and let a combination of logics be the solution to your map! not the output of some buttons but an insanely complicated logic
Just kidding of course.
What valve did in their maps is working with the checkpoints/coop locks. If this is for the "humans die together" you can change the airlocks to have things like the vita-chambers from bioshock or something similar. The important thing is that if the players die in coop they shouldn't spent more then 2-3 minutes to get back to the position they were before, otherwise it could get frustrating.
I have no idea on how those checkpoints work since I've never made a coop level yet. But possibly you can have a button that does the same thing? If that would work you could consider adding a save button or binding one of the keyboard keys to do the same thing.
Quote from BenVlodgi on April 6, 2012, 2:02 pmNew plan, No deadly elements!... all puzzles!
thanks for the info
The problem with scripts is the only thing they do, is just more complicated logic, they can not store data from your map (at least as far as I'm concerned), If I wanted to, I'd somehow have to dump that data to a file and later read from it
New plan, No deadly elements!... all puzzles!
thanks for the info
The problem with scripts is the only thing they do, is just more complicated logic, they can not store data from your map (at least as far as I'm concerned), If I wanted to, I'd somehow have to dump that data to a file and later read from it
Quote from ChickenMobile on April 6, 2012, 10:17 pmBenVlodgi wrote:New plan, No deadly elements!... all puzzles!
thanks for the info
The problem with scripts is the only thing they do, is just more complicated logic, they can not store data from your map (at least as far as I'm concerned), If I wanted to, I'd somehow have to dump that data to a file and later read from itI've been trying to figure this out for days. Try not to get yourself researching this too much because I am doing the same thing.
- There is a code group called iFileSystem which can read and write to files, however you need access to gamecode to do this
- There is a plugin you can install called EventScript. I was thinking you could save a parameter that noone uses (like xbox_throttlebias) and set it as a server_var through es. Only problem with this is the plugin doesn't work in Portal 2! (and also Valve has some kind of safe-mode activated and you have to disable it before plugins work anyway).
- I was thinking you could bind a key to some kind of script (e.g. bind SCROLLLOCK "Ent_fire Script RunScriptCode function(input)" ) and then press the key through the console. Only problem: you cannot virtually press keys -> this was told to me by Garry Newman.
- If es doesn't work, then probably .lua doesn't either (as it is also a plugin)
- Give up
thanks for the info
The problem with scripts is the only thing they do, is just more complicated logic, they can not store data from your map (at least as far as I'm concerned), If I wanted to, I'd somehow have to dump that data to a file and later read from it
I've been trying to figure this out for days. Try not to get yourself researching this too much because I am doing the same thing.
- There is a code group called iFileSystem which can read and write to files, however you need access to gamecode to do this
- There is a plugin you can install called EventScript. I was thinking you could save a parameter that noone uses (like xbox_throttlebias) and set it as a server_var through es. Only problem with this is the plugin doesn't work in Portal 2! (and also Valve has some kind of safe-mode activated and you have to disable it before plugins work anyway).
- I was thinking you could bind a key to some kind of script (e.g. bind SCROLLLOCK "Ent_fire Script RunScriptCode function(input)" ) and then press the key through the console. Only problem: you cannot virtually press keys -> this was told to me by Garry Newman.
- If es doesn't work, then probably .lua doesn't either (as it is also a plugin)
- Give up
Quote from BenVlodgi on April 7, 2012, 3:00 amdo you think using squirrel's File class would work?
http://www.squirrel-lang.org/doc/sqstdlib2.html#d0e159using that I might be able to save&load from files that I make, probably name them the name of the map, and perhaps the session number, I could save player locations, and perhaps other things, like cubes, or the states of certain relays
then load them back in.I'll see if that class works alright in portal 2 this weekend... otherwise I could write a c program to do the saving and loading, and try to embed it in one of the squirrel scripts
do you think using squirrel's File class would work?
http://www.squirrel-lang.org/doc/sqstdlib2.html#d0e159
using that I might be able to save&load from files that I make, probably name them the name of the map, and perhaps the session number, I could save player locations, and perhaps other things, like cubes, or the states of certain relays
then load them back in.
I'll see if that class works alright in portal 2 this weekend... otherwise I could write a c program to do the saving and loading, and try to embed it in one of the squirrel scripts
Quote from Robdon on April 7, 2012, 3:54 amThe file class doesnt seem to work, I had tried that before.
I would think they have probably removed/restricted anything that can write files, or it could be open up for abuse.
Rob.
The file class doesnt seem to work, I had tried that before.
I would think they have probably removed/restricted anything that can write files, or it could be open up for abuse.
Rob.
Quote from ChickenMobile on April 7, 2012, 8:53 amRobdon wrote:The file class doesnt seem to work, I had tried that before.I would think they have probably removed/restricted anything that can write files, or it could be open up for abuse.
Rob.
This is true. My brothers friend (who was a scripter and did things for hl2dm) could literally change any file on your computer. Even windows files etc (and make your computer not start up etc.)
I would think they have probably removed/restricted anything that can write files, or it could be open up for abuse.
Rob.
This is true. My brothers friend (who was a scripter and did things for hl2dm) could literally change any file on your computer. Even windows files etc (and make your computer not start up etc.)
Quote from Lpfreaky90 on April 7, 2012, 9:04 amchickenmobile wrote:This is true. My brothers friend (who was a scripter and did things for hl2dm) could literally change any file on your computer. Even windows files etc (and make your computer not start up etc.)awesome
awesome 
Quote from BenVlodgi on April 8, 2012, 12:05 amdo any of you know how you coop progress is saved...like how the game knows you've completed certain mains, because if we could access that... bam we're good
do any of you know how you coop progress is saved...like how the game knows you've completed certain mains, because if we could access that... bam we're good


