capturing the state of a map, and reverting
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
chickenmobile 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.
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
BenVlodgi 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 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
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
I would think they have probably removed/restricted anything that can write files, or it could be open up for abuse.
Rob.
Robdon 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.)
chickenmobile 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 
BenVlodgi wrote:
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
Game code (which we has no access to)
https://developer.valvesoftware.com/wik ... _functions
MarkMapComplete is the one you want to look at.
chickenmobile wrote:
BenVlodgi wrote: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
Game code (which we has no access to)
https://developer.valvesoftware.com/wik ... _functions
MarkMapComplete is the one you want to look at.
thanks for the list
.... Valve is on vacation right now, when they get back I'll ask some people how plausible it would be to either give us limited IO capabilities, or have them integrate a save/load for coop, I think they'll be back either tomorrow, or the day after. So I suppose we'll have to wait till then
unless you think it would be easy enough to just have the script call a c program... o_O
The problem with the savegame is mostly de-sync I think. Saving and loading need to happen at the same time or it might cause problems. That's why I suppose they didn;t use this but the airlocks in game too.
BenVlodgi wrote:
thanks for the list
.... Valve is on vacation right now, when they get back I'll ask some people how plausible it would be to either give us limited IO capabilities, or have them integrate a save/load for coop, I think they'll be back either tomorrow, or the day after. So I suppose we'll have to wait till thenunless you think it would be easy enough to just have the script call a c program... o_O
Do you have Valve's number? I would like to ahem contact them...

chickenmobile wrote:
BenVlodgi wrote:thanks for the list
.... Valve is on vacation right now, when they get back I'll ask some people how plausible it would be to either give us limited IO capabilities, or have them integrate a save/load for coop, I think they'll be back either tomorrow, or the day after. So I suppose we'll have to wait till thenunless you think it would be easy enough to just have the script call a c program... o_O
Do you have Valve's number? I would like to ahem contact them...
lol no, I'm pretty sure they don't have a phone number, I just email, or steam chat them
BenVlodgi wrote:
lol no, I'm pretty sure they don't have a phone number, I just email, or steam chat them
Steam chatting Valve would be pretty handy. Whenever I have an epic SDK problem and ask steam support or hlmappers / coders I never get an answer.
chickenmobile wrote:
Steam chatting Valve would be pretty handy. Whenever I have an epic SDK problem and ask steam support or hlmappers / coders I never get an answer.
It has been, just a few weeks ago I was talking to a couple of them about how to try to get coop to work in mods, and they didn't know that it was even broke. So we went through a few different ways to try to make it work manually, but it turns out its def a hard coded problem, so hopefully that bug will get fixed... lol now that they know about it... he said that if they are able to fix it, it will probably be after the DLC_02