Jump to content
Harfatus

Payday 1 & 2 Lua Hook v3.2.2

Recommended Posts

Baddog-11

Awesome Work. xD

Share this post


Link to post
Share on other sites
SquadZLeader

I have an issue with this new hook...

If i have too many lines in the PD2Hook.yml then it won't load

Example like i have about 90 lines in the PD2Hook.yml (blank line or commented line doesn't count), then when i open the game it just showing me a debug console with nothing in it and the game won't open.

 

Like this

 

debugconsole.png

 

Once i have about 20 lines in it... it load...

So it there anyway to fix this?

Share this post


Link to post
Share on other sites
KarateF22

Does anyone else have problems setting a keybind with RegisterScript? It seems to just do nothing for me. Code below:

 

RegisterScript("lib/Lua/BetterWeaponStatsMod/toggle.lua", 0, "VK_F9")
 
The above simply does nothing, even using GetBinding reports no bind on F9. I'm resorting to the line below to get it done for now.
 
if not GetBinding("VK_F9") then BindKey("VK_F9", "lib/Lua/BetterWeaponStatsMod/toggle.lua") end

Share this post


Link to post
Share on other sites
*Overkill_Ashley*

Hey, Welcome back Baldwin. been sometime since I last encountered you mate.

Share this post


Link to post
Share on other sites
GameMechanic

EDIT: Wow, just my luck - I figure it out LITERALLY as soon as I posted. Seems set_volume must be called after play() (I assume seek is the same way). Going to leave this post up for reference for other people needing help though, because there is what I think is good info in this thread :)

 

 

 

:set_volume() is BROKEN  :thumbsdown:

 

Example:
 

soundobj = PlayMediaV2("testfile.wav")
soundobj:set_volume(0)
soundobj:play()

The sound plays volume unchanged in the above example. Through many tests, I have confirmed set_volume() doesn't do jack squat. There is also a thread on UC confirming this.

 

lul, the solution was above and quite simple. I'm very surprised the people on UC couldn't sort this one out. Shouldn't have given their debugging skills so much credit. Working example below

soundobj = PlayMediaV2("testfile.wav")
soundobj:play()
soundobj:set_volume(0)

In addition, I have learned that once the object plays through once, it is useless and must be destroyed and recreated to play again (via obj = nil). I had even considered it was trying to play into "blank space" after the audio file completed and tried seeking back to 0 with no success. Destroying and creating the object works fine though (and oddly it doesn't cause the past song to stop - i assume this just means the garbage collector hasn't managed to get it yet).

 

In somewhat related news, if the variable is intended to persist and avoid garbage collection, I recommend changing the example to not specify a local variable.

Edited by GameMechanic

Share this post


Link to post
Share on other sites
GameMechanic

annnd i'm back at square 1. yes, the above code works, but only when typed in the console (presumably due to the delay?) it does not work programmatically.

 

even adding an atificial wait time with a bogus for loop didn't resolve the issue sadly

 

example test code (ran as keybind for convenience)

 

soundobj = PlayMediaV2("lib/Lua/HeadShotSounds/headshot.wav")
soundobj:play()
 
local delay = 0
 
for i=1,10000000 do
delay = delay + 1
end
soundobj:set_volume(0)
io.stdout:write("Finished")
Edited by GameMechanic

Share this post


Link to post
Share on other sites
PirateCaptain

why i can't download?

You forgot to validate you email is my first guess

Share this post


Link to post
Share on other sites
Davy Jones

 You forgot to validate you email is my first guess

All downloads disappeared after the site went down, including the ones inside of posts.  Just tried to edit the first post and cancelled the editing, there is no attachment, the download just goes to a page that doesn't exist.  I tried it too just to make sure it was still floating around.

  • Upvote 2

Share this post


Link to post
Share on other sites
mersey10

 You forgot to validate you email is my first guess

All downloads disappeared after the site went down, including the ones inside of posts.  Just tried to edit the first post and cancelled the editing, there is no attachment, the download just goes to a page that doesn't exist.  I tried it too just to make sure it was still floating around.

So, I can not download this file more?

Share this post


Link to post
Share on other sites
Davy Jones

 So, I can not download this file more?

You can, just not here.  I just checked the file versions, and the v3.2.2 file you see here is available at the link below.  When you click the download button, you'll be greeted with two versions, you'll want the uppercase one (IPHLPAPI.dll / 228 kB), that file is the v3.2.2 version.

  • Upvote 1

Share this post


Link to post
Share on other sites
enticious

hey every time I try clicking the link it leads to a blank screen and no download starts, please can someone help.

Share this post


Link to post
Share on other sites
BlackReaper

i think it got deleted because the hook isn't working anymore. OVK changed to much in their source code and the hook does not work anymore with it :) just wait until it is fixed from harfatus

  • Upvote 1

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×