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?
Läs mer
poM 11 27 sep, 2013 @ 4:59
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?
< >
Visar 1-2 av 2 kommentarer
Rectus 28 27 sep, 2013 @ 8:17 
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 27 sep, 2013 @ 20:41 
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.
< >
Visar 1-2 av 2 kommentarer
Per sida: 1530 50

Datum skrivet: 27 sep, 2013 @ 4:59
Inlägg: 2