Hi! Portal 2 VScript - Variables
Quote from Alby87 on July 11, 2012, 11:16 amHi! I've put this question on Steam Forum, but I didn't get any reply.
'm relatively new to modding the source engine, and I was wondering if I can "save and load" variables within .nut files: I want to store an integer, and retrieve it after I not only change the map, but also when I close and open the game.
If I can't save it to a files, can I at least create and use a ConVar?
Thank you in advance
(I'm asking because in the documentation wiki, the variables section of L4D2 (where I read about vscript) vscript is in "TODO ")
Hi! I've put this question on Steam Forum, but I didn't get any reply.
'm relatively new to modding the source engine, and I was wondering if I can "save and load" variables within .nut files: I want to store an integer, and retrieve it after I not only change the map, but also when I close and open the game.
If I can't save it to a files, can I at least create and use a ConVar?
Thank you in advance
(I'm asking because in the documentation wiki, the variables section of L4D2 (where I read about vscript) vscript is in "TODO ")
Quote from FelixGriffin on July 11, 2012, 12:56 pmUnfortunately, you can't create a ConVar without the original source of the game (which only Valve has), and I don't think you can save and load a variable like that. Try looking at the "counter" feature in an env_global entity.
Unfortunately, you can't create a ConVar without the original source of the game (which only Valve has), and I don't think you can save and load a variable like that. Try looking at the "counter" feature in an env_global entity.

Quote from ChickenMobile on July 11, 2012, 1:43 pmYou cannot store variables without writing to a file. There is no way Valve would let us write to a file through actions in hammer; this is probably unsafe. The only thing I know of that can write to a file within source (no game code) is config.cfg and it will only store client cvars.
Even if you could store your data to a client console parameter, you won't be able to read it.Also: mapping-help/capturing-the-state-of-a-map-and-reverting-t5918.html
You cannot store variables without writing to a file. There is no way Valve would let us write to a file through actions in hammer; this is probably unsafe. The only thing I know of that can write to a file within source (no game code) is config.cfg and it will only store client cvars.
Even if you could store your data to a client console parameter, you won't be able to read it.
Also: mapping-help/capturing-the-state-of-a-map-and-reverting-t5918.html