Advertisement
Strogglet

ish_remove_UVP.script

Mar 8th, 2022 (edited)
1,259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. -- Pretty Pistols Pack Preparation Purge Program for Ishmael the Artsie by Ishmaeel the Nerd.
  2. --
  3. -- Usage:
  4. -- * Install this script.
  5. -- * Load the save game that you want to purge.
  6. -- * Press CTRL-F8. Some items will be deleted and a new save game will be created.
  7. -- * Close game, install PPP, relaunch, enjoy.
  8. --
  9. -- Add the item sections to be removed to the following list and set them as "true".
  10. local purge_list = { wpn_usp_match = true, wpn_usp = false, wpn_usp_custom = true, wpn_usp_nimble = true }
  11.  
  12. function on_game_start()
  13. RegisterScriptCallback("on_key_release", ishy_on_key_release)
  14. RegisterScriptCallback("actor_on_first_update", ishy_actor_on_first_update)
  15. end
  16.  
  17. function ishy_actor_on_first_update()
  18. if db.actor then
  19. give_news("Press Ctrl-F8 to delete certain items and create a new save.")
  20. end
  21. end
  22.  
  23. function ishy_on_key_release(key)
  24. if (key ~= DIK_keys.DIK_F8) then
  25. return
  26. end
  27.  
  28. if key_state(DIK_keys.DIK_LCONTROL) ~= 0 then
  29. release_vanilla_ugly_pistols()
  30.  
  31. exec_console_cmd("save ugly pistols removed")
  32.  
  33. give_news("A clean save is created. Close the game and install Pretty Pistols Pack now.")
  34. end
  35. end
  36.  
  37. function release_vanilla_ugly_pistols()
  38. for i = 1, 65534 do
  39. local obj = alife_object(i)
  40. if obj and purge_list[obj:section_name()] then
  41. printf("! Releasing %s #%s", obj:section_name(), i)
  42. alife():release(obj)
  43. end
  44. end
  45. end
  46.  
  47. function give_news(message)
  48. if db.actor then
  49. db.actor:give_game_news("PPPPPP", message, "ui_inGame2_Polucheni_koordinaty_taynika", 0, 5000, 0)
  50. end
  51. end
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement