安装 Steam
登录
|
语言
繁體中文(繁体中文)
日本語(日语)
한국어(韩语)
ไทย(泰语)
български(保加利亚语)
Čeština(捷克语)
Dansk(丹麦语)
Deutsch(德语)
English(英语)
Español-España(西班牙语 - 西班牙)
Español - Latinoamérica(西班牙语 - 拉丁美洲)
Ελληνικά(希腊语)
Français(法语)
Italiano(意大利语)
Bahasa Indonesia(印度尼西亚语)
Magyar(匈牙利语)
Nederlands(荷兰语)
Norsk(挪威语)
Polski(波兰语)
Português(葡萄牙语 - 葡萄牙)
Português-Brasil(葡萄牙语 - 巴西)
Română(罗马尼亚语)
Русский(俄语)
Suomi(芬兰语)
Svenska(瑞典语)
Türkçe(土耳其语)
Tiếng Việt(越南语)
Українська(乌克兰语)
报告翻译问题
Sorry, I meant to quote Mr. Man!™. Finger slipped.
Anyway I misread this, so I guess the option to enable lasers all the time doesn't exist. Tough turkeys.
function NewRaycastWeaponBase:on_equip()
_NewRaycastWeaponBase_on_equip(self)
self:set_gadget_on(self._stored_gadget_on or 0, false)
end
if not _NewRaycastWeaponBase_toggle_gadget then _NewRaycastWeaponBase_toggle_gadget = NewRaycastWeaponBase.toggle_gadget end
function NewRaycastWeaponBase:toggle_gadget()
if _NewRaycastWeaponBase_toggle_gadget(self) then
self._stored_gadget_on = self._gadget_on
return true
end
Put this in any Notepad file and save it as whatever.lua. Make a folder in your payday 2 folder and drop it in there. Then after that get the IPH from Hoxhud or wherever and get a Hook file as well. Put the name of it and where it's located under persist scripts and bang. You got yourself a lazer that stays on when you switch weapons, and without the clutter and extra crap from Hoxhud.
local toggle_gadget_original = NewRaycastWeaponBase.toggle_gadget
function NewRaycastWeaponBase:on_equip(...)
self:set_gadget_on(self._stored_gadget_on or 0, false)
return on_equip_original(self, ...)
end
function NewRaycastWeaponBase:toggle_gadget(...)
if toggle_gadget_original(self, ...) then
self._stored_gadget_on = self._gadget_on
return true
end
end
By the way, changing that 0 to a 1 should make it automatically enable the 1st gadget available when you first equip the weapon, which would be either the extra sight (sniper rifles), the laser (laser and laser/flashlight combo gadgets) or the flashlight (flashlight gadget). Would be possible to only do it for lasers, but I'm certainly not going to put in the effort to do that to satisfy someone who can't put in the effort to toggle the gadget on once per day of the heist.
1) Download Hoxhud
a) The option to remeber your gadget state in ON by defult so you don't even have to touch ANY options, just play the game and it will work
2) Download GoonMod
a) Go into GoonMod's options
b) Tick the box to enable the feature to remeber gadet state (near the bottom)
3) Put in all of that coding stuff that @Seven and @Brovah did. However i am pretty sure that is in the Hud's LUA file anyway so downloading Hoxhud is the easiest way of getting what you want.
Hox and Goon offers the same, take on the laser when i swap weapons under a mission.
What i want is that the laser will be basically turned on, immediatelly the mission is started. I know, pushin 1 button is not so exhausting but i think this is need to be a very basic option in the game... "Why i allways need to turn on the laser, if could be basically turned on?"
Pretty sure that's a design decision, not a bug. Not saying I agree with it, but it is intentional.
Now I have the habit to press Q every time I switch weapons, but it is kinda of annoying.
local toggle_gadget_original = NewRaycastWeaponBase.toggle_gadget
local _update_stats_values_original = NewRaycastWeaponBase._update_stats_values
function NewRaycastWeaponBase:on_equip(...)
self:set_gadget_on(self._stored_gadget_on or 0, false)
return on_equip_original(self, ...)
end
function NewRaycastWeaponBase:toggle_gadget(...)
if toggle_gadget_original(self, ...) then
self._stored_gadget_on = self._gadget_on
return true
end
end
function NewRaycastWeaponBase:_update_stats_values(...)
_update_stats_values_original(self, ...)
self:_auto_activate_laser()
end
function NewRaycastWeaponBase:_auto_activate_laser()
local gadgets = managers.weapon_factory:get_parts_from_weapon_by_type_or_perk("gadget", self._factory_id, self._blueprint)
if gadgets then
table.sort(gadgets, function(a, b)
if not self._parts[a] then return false end
if not self._parts[b] then return true end
return self._parts[a].unit:base().GADGET_TYPE > self._parts[b].unit:base().GADGET_TYPE
end)
for i, id in pairs(gadgets) do
if self._parts[id] and tweak_data.weapon.factory.parts[id].sub_type == "laser" then
self._stored_gadget_on = i
break
end
end
end
end
rant?
and it does exist.