Jump to content
Sign in to follow this  
#Weedswag

Skip Endscreen and Force Ready

Recommended Posts

#Weedswag

Skip Endscreen and Force Ready by hejoro

Courtesy of HoxHud, I just cleaned up the decompiled code.

Skip Endscreen

Host can press enter to skip money and EXP and go straight to payday.

oldMethods = oldMethods or {}

oldMethods.MissionEndState = oldMethods.MissionEndState or {}



oldMethods.MissionEndState.setup_controller = oldMethods.MissionEndState.setup_controller or MissionEndState.setup_controller

function MissionEndState.setup_controller(self, ...)

    oldMethods.MissionEndState.setup_controller(self, ...)

    self._completion_bonus_done = true

    self._continue_block_timer = nil

end



function MissionEndState._continue_blocked(...)

    return false

end



oldMethods.MissionEndState.completion_bonus_done = oldMethods.MissionEndState.completion_bonus_done or MissionEndState.completion_bonus_done

function MissionEndState.completion_bonus_done(self, ...)

    oldMethods.MissionEndState.completion_bonus_done(self, ...)

    self._completion_bonus_done = true

end
PostRequire:
  - ['libstatesmissionendstate', scriptnamehere.lua]
Force Ready

If the host hits ready, the map will start. Can be configured so it requires one or two other people to hit ready as well.


oldMethods = oldMethods or {}

oldMethods.MissionBriefingGui = oldMethods.MissionBriefingGui or {}

oldMethods.MissionBriefingGui.init = oldMethods.MissionBriefingGui.init or MissionBriefingGui.init

function MissionBriefingGui.init(self, ...)

    oldMethods.MissionBriefingGui.init(self, ...)

    self._ready_up_counter = 0

     --1 is host readies up, 2 is host and one other, 3 is host and two others

    self._force_ready_threshold = 1

end



oldMethods.MissionBriefingGui.on_ready_pressed = oldMethods.MissionBriefingGui.on_ready_pressed or MissionBriefingGui.on_ready_pressed

function MissionBriefingGui.on_ready_pressed(self, ...)

    oldMethods.MissionBriefingGui.on_ready_pressed(self, ...)

    if Network:is_server() then

        for k, peer in pairs(managers.network:session():peers()) do

            if not peer:synched() then

                return

            end



        end



        self._ready_up_counter = self._ready_up_counter + 1

        if self._ready_up_counter > self._force_ready_threshold then

            managers.network:game():spawn_players()

        end



    end



end

PostRequire:
  - ['libmanagersmenumissionbriefinggui', scriptnamehere.lua]
Also, for those of you using HoxHud, add the following to your HoxHudTweakData:


self.debug_allow_restart_any_job = true --Allows restart of pro jobs if true

It's pretty self explanatory. I can't believe they left that in, haha.

Share this post


Link to post
Share on other sites
BlackReaper

where to put them ? i don't find - ['libstatesmissionendstate', scriptnamehere.lua]

Share this post


Link to post
Share on other sites
Guest

where to put them ? i don't find - ['libstatesmissionendstate', scriptnamehere.lua]

thats the line you should add to post require script in your PD2Hook.yml :)

and "scriptnamehere.lua" is the new lua file you created and copied the code you want

Share this post


Link to post
Share on other sites
BlackReaper

so i copy that in the payday2hook and after that i make the lua and save all but when i am ingame it doesn't work... did i do something wrong?

Share this post


Link to post
Share on other sites
Davy Jones

so i copy that in the payday2hook and after that i make the lua and save all but when i am ingame it doesn't work... did i do something wrong?
You wouldn't just copy that, you'd have to do this:

- Copy the script and create the .lua file like you said

- Name them two DIFFERENT things if you want both

- Under the "PD2Hook.yml", in the "PostRequire" section at the bottom, add the mentioned code on their own lines

- Replace the "scriptnamehere" in each "scriptnamehere.lua" with the name of the location you put the file, so do this:

Take those two (if you did both, otherwise the one) and move them into "trainer/assets", then for each of those "scriptnamehere.lua" in the "PD2Hook.yml", change them so they read "trainerassetsscriptnamehere.lua" without the quotes, like the other lines look, and remember to change "scriptnamehere" to each of their respective script names.

  • Upvote 1

Share this post


Link to post
Share on other sites
Guest

a thanks trainer and assets :D there it is i put it only in trainer so thanks :DD found my failure ^^ thanks

works too but than you have to delete the "assets" of the line: "trainerassetsscriptnamehere.lua" -> "trainerscriptnamehere.lua"

Share this post


Link to post
Share on other sites
BlackReaper

so i make it finnaly how you write it here but i must say i doesn't work by me.... i make force host and it doesn't start and skipend doesn't work, too... Maybe it is cause i play with a xbox controller but idk... hope you guys can help me with that

Share this post


Link to post
Share on other sites
Guest 420SwagMaster

Where did you get this code from HoxHud? In their public release, the only one I have access to, it doesn't have anything of the sort in there.

Share this post


Link to post
Share on other sites
Davy Jones

so i make it finnaly how you write it here but i must say i doesn't work by me.... i make force host and it doesn't start and skipend doesn't work, too... Maybe it is cause i play with a xbox controller but idk... hope you guys can help me with that
If you make just the Luas needed, you also have to add the lines he mentions in the "PD2Hook.yml" file and change the "scriptnamehere.lua" to the directory and file name that you've named it. Read my other post in this topic, I explain it somewhat there.

If people are having too much trouble with this, I can attach vanilla PP v16 files with the necessary parts added, and a tutorial if people have made other modifications.

Share this post


Link to post
Share on other sites
BlackReaper

i do what you say with the payday2hock.yml... so idk but i if you want to help, help me i will thank you :) i want both

Share this post


Link to post
Share on other sites
Davy Jones

For those who have vanilla v16 (you didn't edit the "PD2Hook.yml" file), here you go, it has both scripts ready to go, simply open the .zip and drag and drop everything into your "PAYDAY 2" folder.

Please login or register to see this link.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Stop being a peeping tom and join the community.... we got cookies

Join the crew now

Sign in

Already part of the crew? Board right here

Sign In Now
Sign in to follow this  

×