Guest User

stalker anomaly 1.5.1 populate all stashes for testing

a guest
May 10th, 2021
671
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.00 KB | None | 1 0
  1. local tbcounter = 1
  2.  
  3. local function onKeyPress(dik)
  4.     if dik == DIK_keys.DIK_M then
  5.    
  6.         printf("M pressed, populating stashes!")
  7.        
  8.         --local tbcounter = 1
  9.        
  10.         while (tbcounter < 65535) do
  11.             local t_obj = alife():object(tbcounter)
  12.             if t_obj then
  13.                 local t_name = t_obj:name()
  14.                
  15.                 local t_secname = t_obj:section_name()
  16.                 local lvl = alife():level_name(game_graph():vertex(t_obj.m_game_vertex_id):level_id())
  17.                
  18.                 --if t_secname == "inventory_box" and lvl == "l08_yantar" then
  19.                 if t_secname == "inventory_box" then
  20.                    
  21.                     treasure_manager.set_random_stash(nil, nil, nil, tbcounter, nil)
  22.                    
  23.                     --PRINT THE FOLLOWING INFO TO CONSOLE
  24.                     printf("set_random_stash number %s (%s) lvl:%s",tbcounter,t_name,lvl)
  25.                    
  26.                     --UNCOMMENT THIS TO DO ONE AT A TIME EACH PRESS OF M
  27.                     --tbcounter = tbcounter + 1
  28.                     --return
  29.                 end
  30.             end
  31.             tbcounter = tbcounter + 1
  32.         end
  33.     end
  34. end
  35.  
  36. function on_game_start()
  37.     RegisterScriptCallback("on_key_press", onKeyPress)
  38. end
  39.  
Advertisement
Add Comment
Please, Sign In to add comment