Raised This Month: $ Target: $400
 0% 

[REQ][L4D2] Vote to Surrender


Post New Thread Reply   
 
Thread Tools Display Modes
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 01-01-2018 , 22:27   Re: [REQ][L4D2] Vote to Surrender
Reply With Quote #21

Like cravenge said, this isn't easy to code. I'm sure he or someone else is currently working on this.
__________________
Psyk0tik is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 01-02-2018 , 01:45   Re: [REQ][L4D2] Vote to Surrender
Reply With Quote #22

I can't work on it but I want to try. Will creating an entity of a rescue vehicle in a non-finale chapter work? And then teleport all players inside for two rounds, maybe it'll finish out the campaign.
eyal282 is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 01-03-2018 , 06:32   Re: [REQ][L4D2] Vote to Surrender
Reply With Quote #23

Quote:
Originally Posted by Crasher_3637 View Post
[...]
Absolutely. I'm still working on this all the while updating my other plugins.
Quote:
Originally Posted by eyal282 View Post
[...]
That won't be necessary. It'll just make the game even more buggy.

This plugin can only be done by:
  1. Forcibly ending the round with the surrendering team having 0 score and the winning team with the map's max versus score. This can be done with Left 4 Downtown 2.
  2. Tricking the game that the current map is the last map of the campaign but due to how impossible it sounds, there is yet a way to reproduce it properly.
  3. Forcing the map transmission overlay, which would need a signature or two being called, and either restarting back to the first map with every player shuffled or changing the map to another one.
cravenge is offline
larrybrains
Senior Member
Join Date: May 2017
Old 02-01-2018 , 03:06   Re: [REQ][L4D2] Vote to Surrender
Reply With Quote #24

Quote:
Originally Posted by cravenge View Post

This plugin can only be done by:
  1. Forcibly ending the round with the surrendering team having 0 score and the winning team with the map's max versus score. This can be done with Left 4 Downtown 2.
  2. Tricking the game that the current map is the last map of the campaign but due to how impossible it sounds, there is yet a way to reproduce it properly.
  3. Forcing the map transmission overlay, which would need a signature or two being called, and either restarting back to the first map with every player shuffled or changing the map to another one.
I think the first or 2nd option sounds like the better routes with this, but why does the first option require that the scores be changed, and would it be possible to instead trick the game that the scores are max/min, but save the actual score and show it on the scoreboard when the game ends?
larrybrains is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 02-01-2018 , 21:18   Re: [REQ][L4D2] Vote to Surrender
Reply With Quote #25

Quote:
Originally Posted by larrybrains View Post
[...]
Yes, it is doable but there's a downside:

If the surrendering team executes the command while exploring the map, there is a chance that the vote will succeed and that team's score exceeds the winning team's score, making the game force end with the surrendering team winning.

I'm really thinking out-of-the-box for many times.

Last edited by cravenge; 02-01-2018 at 21:20.
cravenge is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 02-02-2018 , 17:10   Re: [REQ][L4D2] Vote to Surrender
Reply With Quote #26

Quote:
Originally Posted by cravenge View Post
Yes, it is doable but there's a downside:

If the surrendering team executes the command while exploring the map, there is a chance that the vote will succeed and that team's score exceeds the winning team's score, making the game force end with the surrendering team winning.

I'm really thinking out-of-the-box for many times.
You can manipulate the scores, so why is this a problem? I'm interested in this plugin as well. Mind showing your progress and maybe I can help you with a signature or two?
__________________
Spirit_12 is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 02-03-2018 , 08:19   Re: [REQ][L4D2] Vote to Surrender
Reply With Quote #27

Quote:
Originally Posted by Spirit_12 View Post
[...]
You can find it here, Spirit.

Last edited by cravenge; 02-03-2018 at 08:22.
cravenge is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 02-03-2018 , 11:41   Re: [REQ][L4D2] Vote to Surrender
Reply With Quote #28

Quote:
Originally Posted by cravenge View Post
You can find it here, Spirit.
Haven’t had the chance to go through it line by line, but it would be much better to detect first map with SDK call, as opposed to hardcoding map names. That will make this plugin compatible all across the board with all custom maps.

Also, I tried to play with EndVersusModeRound SDK call. Don't think it actually ends the round. Maybe my implementation was wrong, but it didn't work for me.
__________________

Last edited by Spirit_12; 02-03-2018 at 13:48.
Spirit_12 is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 03-12-2018 , 02:18   Re: [REQ][L4D2] Vote to Surrender
Reply With Quote #29

Had it working on/off. Don't know why it wasn't 100%. Then it stopped working when I cleaned up the code and I don't know where I went wrong.

Tried more than this, SDKcalls etc. I don't have time to keep trying.

Maybe of use to someone:
PHP Code:
"CDirector::EndScenario"
{
    
"library"    "server"
    "linux"        "@_ZN9CDirector11EndScenarioE21ScenarioRestartReason"
    "windows"    "\x55\x8B\x2A\xF3\x0F\x2A\x2A\x2A\x2A\x2A\x2A\x0F\x2A\x2A\x83\xEC\x2A\x0F\x2A\x2A\x0F\x87\x2A\x2A\x2A\x2A\x56\x57\x8B\x2A\x2A\x8D\x2A\x2A\x50"
    
/* 55 8B ? F3 0F ? ? ? ? ? ? 0F ? ? 83 EC ? 0F ? ? 0F 87 ? ? ? ? 56 57 8B ? ? 8D ? ? 50 */
}
"CDirector::OnEndScenario"
{
    
"library"    "server"
    "linux"        "@_ZN9CDirector13OnEndScenarioEP26EndScenarioGameEventInfo_t"
    "windows"    "\x55\x8B\xEC\x83\xEC\x38\x53\x56\x57\x8B\x7D\x08\x8B\xF1"
    
/* 55 8B EC 83 EC 38 53 56 57 8B 7D 08 8B F1 */



PHP Code:
#define MOD_FINALE                "models/props_mall/mall_display_03.mdl"
public OnMapStart()
{
    
PrecacheModel(MOD_FINALE);
}



// Debug
PrintToServer(
"m_bInSecondHalfOfRound %i. m_iWinningTeamNumber %i. m_iWinningTeamNumber %i. m_iWinningTeamNumber %i. m_iWinningTeamNumber %i. m_iCampaignScore %i. m_iCampaignScore %i. m_iChapterScore %i. m_iChapterScore %i. m_bAreTeamsFlipped %i.\n\n",
    
GameRules_GetProp("m_bInSecondHalfOfRound"),
    
GameRules_GetProp("m_iWinningTeamNumber"40),
    
GameRules_GetProp("m_iWinningTeamNumber"41),
    
GameRules_GetProp("m_iWinningTeamNumber"42),
    
GameRules_GetProp("m_iWinningTeamNumber"43),
    
GameRules_GetProp("m_iCampaignScore"20), // 0 == Too early in game
    
GameRules_GetProp("m_iCampaignScore"21),
    
GameRules_GetProp("m_iChapterScore"20),
    
GameRules_GetProp("m_iChapterScore"21),
    
GameRules_GetProp("m_bAreTeamsFlipped")
);



// Was testing with this
new trigger CreateEntityByName("trigger_finale");
DispatchKeyValue(trigger"targetname""trigger_finale");
DispatchKeyValue(trigger"type""1");
DispatchKeyValue(trigger"model"MOD_FINALE);
DispatchSpawn(trigger);
ActivateEntity(trigger);
AcceptEntityInput(trigger"FinaleEscapeVehicleReadyForSurvivors");
AcceptEntityInput(trigger"FinaleEscapeFinished");
AcceptEntityInput(trigger"FinaleLost");



// WORKS: Client ends game, no equivalent server command.
// Shows "Versus Mode Scores" overlay
new bits GetUserFlagBits(target);
new 
flags GetCommandFlags("scenario_end");
SetUserFlagBits(targetADMFLAG_ROOT);
SetCommandFlags("scenario_end"flags & ~FCVAR_CHEAT);
FakeClientCommand(target"scenario_end");
SetUserFlagBits(targetbits);
SetCommandFlags("scenario_end"flags);



// ~6 seconds later call (to match games stock behaviour):
new Handle:bf;

// WORKS: Send rematch panel
// Probably needs back-end vote handling supported.
bf StartMessageAll("PZEndGamePanelMsg"USERMSG_RELIABLE);
BfWriteByte(bf1); // 1 = Display. 0 = Hide.
EndMessage();



// Worked at one stage when testing various techniques. Some combination of other values set or something.
// Send end scores panel. Requires m_isFinale = 1 to say who won/lost and not who's winning/losing + map transition information
terror_player_manager FindEntityByClassname(MaxClients+1"terror_player_manager");
SetEntProp(terror_player_managerProp_Send"m_isFinale"11);
bf StartMessageAll("ShowStats"USERMSG_RELIABLE);
EndMessage(); 
__________________
Silvers is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode