Thread: Save/load keyvalues between levels

Results 1 to 14 of 14

Threaded View

  1. #1
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    U.S. West

    Save/load keyvalues between levels

    Attached are two example maps that transfer a value (999) from one map to another. The save sequence uses 66 ents to save a number (the "renderamt" keyvalue in the "wallet" entity) with a range of 0-1024. An additional 4 ents can be added to support a value up to 2048, and then another 4 for 4096, and so on. The save sequence is not instantaneous - it took about 5 seconds to convert my value of 999. The load sequence is much simpler, made up of 20 ents in my case. Loading is instantaneous.

    The first map converts the keyvalue to a binary number (displayed using buttons) which is saved using env_globals. The second map converts the binary sequence back into a decimal number as soon as the map loads.

    To plug this into your own maps, copy and paste the clusters of entities in the binary_save map and add a copy_value that copies your keyvalue to the "renderamt" key in the "wallet" entity. For the binary_load map, copy and paste the trigger_autos and trigger_changevalues. Then, either copy and paste the "wallet" entity, or change the targets and keyvalues of the trigger_changevalues to the entity and keyvalue you want.
    Attached Files Attached Files
    Last edited by w00tguy123; 08-01-2012 at 10:31 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts