Left 4 Dead 2

Left 4 Dead 2

Your own custom apocalypse
Discover and download new maps, Add-ons, Mutations and more! Want to try your hand at modding or want to upload your mod to Steam? Click here to learn more.
poM 11 Sep 27, 2013 @ 4:59am
How to pass variables between stages in a mutation?
Hi, I'm making a mutation that requires some variables to store game status along the play.
I tried StringToFile() and FileToString() but they give me alot of problems.
I found SaveTable() and RestoreTable() but don't know how to use them.
Any suggestion or sample codes of functions above?
< >
Showing 1-2 of 2 comments
Rectus 17 Sep 27, 2013 @ 8:17am 
SaveTable() is documented here. It's pretty straightforward to use, but the data you input has to be set up as tables.

For co-op mutations at least, data written to SessionState should survive level transisions. I'm not sure if it gets reset after wipes or vs team switches though.
poM 11 Sep 27, 2013 @ 8:41pm 
Thank you. SaveTable() and RestoreTable() do pass variables between stages. Only problem I just found is data in table will be deleted after the round reset or all survivors died.
I think the only way to keep variables alive after players being killed is to store data somewhere else then load them after.
< >
Showing 1-2 of 2 comments
Per page: 15 30 50

Date Posted: Sep 27, 2013 @ 4:59am
Posts: 2