ZRP controller kill function for AMK/ZoA
a guest Aug 6th, 2012 2,443 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- -- ZRP's debug mode allows killing online controllers to avoid the animation crash listed here:
- -- http://www.metacognix.com/stlkrsoc/CrashesStillInTheGame.html
- -- This "patch" ports the ZRP kill function to AMK or any other mod that is not compatible with ZRP.
- -- Hit ESC + K in game to kill all online controllers.
- -- Add this to main_menu:OnKeyboard(dik, keyboard_action) in scripts\ui_main_menu.script (e.g., on line 291 in AMK):
- if dik == DIK_keys.DIK_K then
- if level.present() and (db.actor ~= nil) and db.actor:alive() then
- console:execute("main_menu off")
- local kill_count = 0
- for id_ = 0, 65534, 1 do
- local lobj = level.object_by_id(id_)
- if lobj ~= nil then
- if lobj:clsid() == clsid.controller_s then
- if lobj:alive() then
- kill_count = kill_count + 1
- local msg_text
- if kill_count > 0 then
- msg_text = "Controllers killed: " .. tostring(kill_count)
- msg_text = "No online controllers found"
- local hud = get_hud()
- hud:AddCustomStatic("main_task", true)
- hud:GetCustomStatic("main_task").m_endTime = time_global()/1000 + 7
RAW Paste Data