Unlimited Intimidation and Conversion ONLY

Posts 112 of 12 · Page 1 of 1
[Help] Unlimited Intimidation and Conversion ONLY
Hi guys, do you remember how in the beginning the game worked about dominating guards?
There wasn't that useless 1 dominated cop limit per time.
I'm trying to remove the new crippling 1 limit, without making intimidation easier (no instant intimidation).
Also i'd like to remove the 1 converted cop limit too. (Without buffing their damage or health, and without making special cops affected by it too)
So basically i'm just trying to remove the limits without tweaking anything else. (This also means that dominator skill is required to intimidate cop along with the joker skill to convert an intimidated cop).

I'll copy-paste this code from another thread that tweaks this making it, imho, too easy and imbalanced:
(Unlimited and instant intimidation of normal cops and special cops, along with unlimited and instant conversion of normal and special cops)

if not _upgradeValueIntimidate then _upgradeValueIntimidate = PlayerManager.upgrade_value end
function PlayerManager:upgrade_value( category, upgrade, default )
if category == "player" and upgrade == "convert_enemies" then
return true
elseif category == "player" and upgrade == "convert_enemies_max_minions" then
return 500
elseif category == "player" and upgrade == "convert_enemies_health_multiplier" then
return 0.25
elseif category == "player" and upgrade == "convert_enemies_damage_multiplier" then
return 4.5
else
return _upgradeValueIntimidate(self, category, upgrade, default)
end
end
if not _onIntimidated then _onIntimidated = CopLogicIdle.on_intimidated end
function CopLogicIdle.on_intimidated( data, amount, aggressor_unit )
if aggressor_unit == managers.player:player_unit() then
CopLogicIdle._surrender( data, amount )
return true
else
return _onIntimidated(data, amount, aggressor_unit)
end
end
CopLogicAttack.on_intimidated = CopLogicIdle.on_intimidated
CopLogicArrest.on_intimidated = CopLogicIdle.on_intimidated
CopLogicSniper.on_intimidated = CopLogicIdle.on_intimidated


I was thinking to cut it to:

function PlayerManager:upgrade_value( category, upgrade, default )
if category == "player" and upgrade == "convert_enemies" then
return true
elseif category == "player" and upgrade == "convert_enemies_max_minions" then
return 500
else
return _upgradeValueIntimidate(self, category, upgrade, default)
end
end

There is something wrong tough...

Can someone please help me? Maybe without questioning its usefullness? (Not all like super-imbalanced cheats)
Thanks in advance to anyone who can help me!
Ok i got some news...

Code:
if not _upgradeValueIntimidate then _upgradeValueIntimidate = PlayerManager.upgrade_value end 
function PlayerManager:upgrade_value( category, upgrade, default ) 
	if category == "player" and upgrade == "convert_enemies" then
		return true
	elseif category == "player" and upgrade == "convert_enemies_max_minions" then
		return 500
	else 
		return _upgradeValueIntimidate(self, category, upgrade, default) 
	end 
end
This will take care of unlimited conversions...
About unlimitated intimidations tough (without them being instant), the solutions seams to lie into CopLogicIlde file.
Probably this is the code that set the 1 intimidation limit:

Code:
-- cops and security guards surrender when isolated
-- swat surrenders when isolated and wounded
function CopLogicIdle.on_intimidated( data, amount, aggressor_unit )
	--print( data.unit, "[CopLogicIdle.on_intimidated]", data.unit, amount, aggressor_unit )
	local surrender = false
	local my_data = data.internal_data
	
	data.t = TimerManager:game():time()
	
	if managers.groupai:state():police_hostage_count() < 1 then
		local i_am_special = managers.groupai:state():is_enemy_special( data.unit )
		local required_skill = i_am_special and "intimidate_specials" or "intimidate_enemies"
		
		local aggressor_can_intimidate
		local aggressor_intimidation_mul = 1
		if aggressor_unit:base().is_local_player then
			aggressor_can_intimidate = managers.player:has_category_upgrade( "player", required_skill )
			aggressor_intimidation_mul = aggressor_intimidation_mul * managers.player:upgrade_value( "player", "empowered_intimidation_mul", 1 ) * managers.player:upgrade_value( "player", "intimidation_multiplier", 1 )
		else
			aggressor_can_intimidate = aggressor_unit:base():upgrade_value( "player", required_skill )
			aggressor_intimidation_mul = aggressor_intimidation_mul * (aggressor_unit:base():upgrade_value( "player", "empowered_intimidation_mul" ) or 1) * (aggressor_unit:base():upgrade_value( "player", "intimidation_multiplier" ) or 1)
		end
		--print( "aggressor_can_intimidate", aggressor_can_intimidate, "required_skill", required_skill, "is_local_player", aggressor_unit:base().is_local_player )
		if aggressor_can_intimidate then
			local hold_chance = CopLogicBase._evaluate_reason_to_surrender( data, my_data, aggressor_unit )
			--print( "hold_chance", hold_chance )
			if hold_chance then
				hold_chance = hold_chance^aggressor_intimidation_mul
				if hold_chance >= 1 then
					--[[if not data.unit:sound():speaking( data.t ) then
						data.unit:sound():say( "Play_po1_r02", true, true ) -- say "LOL", sync, skip_prefix
					end]]
				else
					local rand_nr = math.random()
					--print( "and the winner is: hold_chance", hold_chance, "rand_nr", rand_nr, "rand_nr > hold_chance", rand_nr > hold_chance )
					if rand_nr > hold_chance then
						surrender = true
					--[[elseif hold_chance < 0.9 and not data.unit:sound():speaking( data.t + 1 ) then
						data.unit:sound():say( "Play_po1_r03", true, true ) -- say "HEEELP!!!", sync, skip_prefix
						]]
					end
				end
			end
		end
		
		if surrender then
			--print( "surrendering" )
			CopLogicIdle._surrender( data, amount )
			--debug_pause_unit( data.unit, "surrendering" )
		else
			data.unit:brain():on_surrender_chance() -- re-new the timeout
		end
	--else
		--print( "too many hostages" )
	end
	
	CopLogicBase.identify_attention_obj_instant( data, aggressor_unit:key() )
	
	managers.groupai:state():criminal_spotted( aggressor_unit )
	return surrender
end
Probably we need to change that 1 to higher number...
Copy-pasting the whole code and change just that number doesn't work. How can i do to change just that to something like 500?

(This is the solution IF the files i looked to didn't change with the new patch!
I used the file some users uploaded some time ago, during the first patches of the game)

Hope someone could give a hand!

P.S: How can i extract the current update files by myself? What program is needed?
Intercept the police_hostage_count function and return 0 always. I'll write the full solution in a couple hours if you can't figure it out.

Edit:
Code:
-- Infinite intimidations
function GroupAIStateBase:police_hostage_count() return 0 end

-- Infinite conversions
if not _uvConvert then _uvConvert = PlayerManager.upgrade_value end 
function PlayerManager:upgrade_value( category, upgrade, default ) 
	if category == "player" and upgrade == "convert_enemies_max_minions" then
		return 500
	else 
		return _uvConvert(self, category, upgrade, default) 
	end 
end
Both work flawlessy! Thanks for your help!

Just for curiosity: Why did you edit the unlimited conversion code? It's different from the one i took from your snippet thread, and both works out fine. I'd like to understand better about this... Thanks for any enlightment!
Quote Originally Posted by xiang94 View Post
Both work flawlessy! Thanks for your help!

Just for curiosity: Why did you edit the unlimited conversion code? It's different from the one i took from your snippet thread, and both works out fine. I'd like to understand better about this... Thanks for any enlightment!
Well originally you asked to keep the restriction that you have to have the convert enemy skill (Dominator or whatever its called)..
Quote Originally Posted by dougbenham View Post
Well originally you asked to keep the restriction that you have to have the convert enemy skill (Dominator or whatever its called)..
Oh that's why!
So the new conversion code here is to everyone, even those who do not have the joker(dominator is the one that let you intimidate cop, joker is for conversion) skill!
So i should switch back to the other one to keep the restrictions...
Well this one is good anyway to the others who don't have the skill! Thanks for the clarification!
The DLC changed the file so now the unlimited intimidations doesn't work anymore...
I extracted the file using a tool i found, but when i open the updated CopLogicIdle.lua file, i can't read it. (Don't know if they somehow encrypted it, or if the tool i used messed up the extraction)
OT: Did someone managed to read the new files? If yes could you send me a PM with the tool you used and worked?
Back to Thread: While i find a way to read the new files, could someone help me and see if he can find a new way to bypass the new limit? (It should be 3 right now instead of 1)
Thanks for any answer you can provide!
Any help? If you don't want to do it all, please just help me to understand which tool to use now to extract and read the lua files after the DLC. : )
Bump, as without having the source i can't act independently anymore.
Bumpidy Bump... Still waiting for any source files so i can do it on my own, or atleast a solution that can replace the not working anymore lua code:
Code:
-- Infinite intimidations
function GroupAIStateBase:police_hostage_count() return 0 end
Quote Originally Posted by xiang94 View Post
Bumpidy Bump... Still waiting for any source files so i can do it on my own, or atleast a solution that can replace the not working anymore lua code:
Code:
-- Infinite intimidations
function GroupAIStateBase:police_hostage_count() return 0 end
Here you go, google "Complete LUA Source for Update 14 (Post-Halloween Patch)": https://www.google.com/#q=%22Complet...ween+Patch)%22
Oh! Thanks for your answer man! I almost lost the hope! There is a problem tho'. It's the patch 18 with the dlc that changed that function.
Anyway i appreciate your help! Did you decrypted it by yourself? (If yes can you teach my how to do it?) Why we (as community) stopped decrypting the lua source on patch 14? Something happened?
Hope you can enlight me on the situation!
In the meantime i'll gladly upgrade my source from patch 1 to patch 14


EDIT: I saw it's another user who did it. Too bad he's inactive now. Do you have any idea on how he did that tho'?
Posts 112 of 12 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?