Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Pretty Pistols Pack Preparation Purge Program for Ishmael the Artsie by Ishmaeel the Nerd.
- --
- -- Usage:
- -- * Install this script.
- -- * Load the save game that you want to purge.
- -- * Press CTRL-F8. Some items will be deleted and a new save game will be created.
- -- * Close game, install PPP, relaunch, enjoy.
- --
- -- Add the item sections to be removed to the following list and set them as "true".
- local purge_list = { wpn_usp_match = true, wpn_usp = false, wpn_usp_custom = true, wpn_usp_nimble = true }
- function on_game_start()
- RegisterScriptCallback("on_key_release", ishy_on_key_release)
- RegisterScriptCallback("actor_on_first_update", ishy_actor_on_first_update)
- end
- function ishy_actor_on_first_update()
- if db.actor then
- give_news("Press Ctrl-F8 to delete certain items and create a new save.")
- end
- end
- function ishy_on_key_release(key)
- if (key ~= DIK_keys.DIK_F8) then
- return
- end
- if key_state(DIK_keys.DIK_LCONTROL) ~= 0 then
- release_vanilla_ugly_pistols()
- exec_console_cmd("save ugly pistols removed")
- give_news("A clean save is created. Close the game and install Pretty Pistols Pack now.")
- end
- end
- function release_vanilla_ugly_pistols()
- for i = 1, 65534 do
- local obj = alife_object(i)
- if obj and purge_list[obj:section_name()] then
- printf("! Releasing %s #%s", obj:section_name(), i)
- alife():release(obj)
- end
- end
- end
- function give_news(message)
- if db.actor then
- db.actor:give_game_news("PPPPPP", message, "ui_inGame2_Polucheni_koordinaty_taynika", 0, 5000, 0)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement