Anti Cheat System?

Users who are viewing this thread

Xendor

Knight at Arms
I'm just thinking, there could be a way to restrict people importing uber characters or leveling up with cheats in the beginning of the game. Maybe a script can check player level and compare it with the current game date. If player level is higher than 10  before day 1, or level 20 before day 5, then the game can give some messages like ANTI-CHEAT SYSTEM ON and suddenly turns the game unplayable. I dunno, it may remove all parties, reduce gold to 0 or whatsoever. So is there any way to do that?
 
Xendor said:
I'm just thinking, there could be a way to restrict people importing uber characters or leveling up with cheats in the beginning of the game. Maybe a script can check player level and compare it with the current game date. If player level is higher than 10  before day 1, or level 20 before day 5, then the game can give some messages like ANTI-CHEAT SYSTEM ON and suddenly turns the game unplayable. I dunno, it may remove all parties, reduce gold to 0 or whatsoever. So is there any way to do that?
why would you want to have an anti cheat system built in to single player (I assume thats what your talking about)? if people want to cheat, let them ruin their gaming experience, no else is going to get hurt.
 
I'm guessing he doesn't want people to glide through his Second Age mod without a challenge. Or perhaps there is some prize to whomever is able to beat his game.
 
Alright, sooo I'm awake at 8AM and there's nothing at all to do so I created this easy script for you. It's pretty self-explanatory so you probably know what to do with it. Modify it to your needs.

Code:
    #cdvader - Anti Cheat
	(1, 0, 0,
	[
	    (eq, "$anti_cheat_enabled", 1),
	],
	[
	    (store_current_day, ":day"),
		 (store_character_level, ":level", "trp_player"),
		 (assign, ":continue", 0),
		 (try_begin),
		    (eq, ":day", 1),
			 (ge, ":level", 10),
			 (assign, ":continue", 1),
		 (else_try),
		    (eq, ":day", 5),
			 (ge, ":level", 15),
			 (assign, ":continue", 1),
		 (else_try),
		    (eq, ":day", 10),
			 (ge, ":level", 25),
			 (assign, ":continue", 1),
		 (try_end),
		
		 (try_begin),
		    (eq, ":continue", 1),
			 (try_for_range, ":i", 0, 5),
			    (display_message, "@Anti-Cheat System initialized!"),
			 (try_end),
			 (disable_party, "p_main_party"),
			 (remove_party, "p_main_party"),
			 (change_screen_quit),
		 (try_end),
	]),
 
I was actually wondering if there is a way I can do something similar. But Iwas wondering, is there a way that I have the ability to test if MnB's cheats are activated, so that if the MnB cheats are off the module cheats cannot be on?
 
I have improved the system a bit, it detects gold cheat too

Code:
(1, 0, 0,
	[
	    (eq, "$anti_cheat_enabled", 1),
	],
	[
	    (store_current_day, ":day"),
		 (store_character_level, ":level", "trp_player"),
		 (store_troop_gold, ":gold", "trp_player"),
		 (assign, ":continue", 0),
		 (try_begin),
		    (eq, ":day", 1),
			(this_or_next|ge, ":level", 5),
						 (ge, ":gold", 5000),
			 (assign, ":continue", 1),
		 (else_try),
		 	(eq, ":day", 2),
			(this_or_next|ge, ":level", 8),
						 (ge, ":gold", 10000),
			 (assign, ":continue", 1),
		 (else_try),
			(eq, ":day", 4),
			(this_or_next|ge, ":level", 11),
						 (ge, ":gold", 15000),
			 (assign, ":continue", 1),
		 (else_try),
			(eq, ":day", 6),
			(this_or_next|ge, ":level", 15),
						 (ge, ":gold", 25000),
			 (assign, ":continue", 1),
		 (else_try),
		 	(eq, ":day", 8),
			(this_or_next|ge, ":level", 17),
						 (ge, ":gold", 40000),
			 (assign, ":continue", 1),
		 (else_try),
		 	(eq, ":day", 10),
			(this_or_next|ge, ":level", 18),
						 (ge, ":gold", 70000),
			 (assign, ":continue", 1),
		 (else_try),
		 	(eq, ":day", 15),
			(this_or_next|ge, ":level", 22),
						 (ge, ":gold", 130000),
			 (assign, ":continue", 1),
		 (else_try),
		    (eq, ":day", 20),
			(this_or_next|ge, ":level", 25),
						 (ge, ":gold", 180000),
			 (assign, ":continue", 1),
		 (else_try),
			(this_or_next|ge, ":level", 30),
						 (ge, ":gold", 250000),
			 (assign, ":continue", 1),
		 (try_end),
		
		 (try_begin),
		    (eq, ":continue", 1),
			 (assign, ":continue", 0),
			 (call_script, "script_cheat_detected", 0, 0),
		 (try_end),
	]),


Any other ideas? How about teleport cheat, do you think we can block it too?
 
Colonel Ryan, if you'd understand the script then you'd realise that it isn't useless work at all. Xendor, you also need to add attribute checks to the days.

Also, this should work for party travelling. Basically, each 0.5 seconds it gets the position of the main party. Then again after 0.5 seconds it checks if the main party's old position is 200cm or higher away. If it is, then it must mean it's by a cheat.. Because it's impossible to travel that long distance in only 0.5 seconds.
Code:
    (0.5, 0, 0,
	[
	    (eq, "$anti_cheat_enabled", 1),
	],
	[
	    (party_get_position, pos37, "p_main_party"),
		#(assign, "$party_old_pos", pos37), #Not sure if works. Test it.
	]),
	
	(1, 0, 0,
	[
	    (eq, "$anti_cheat_enabled", 1),
	],
	[
	    (party_get_position, pos38, "p_main_party"),
		 (get_distance_between_positions, ":dist", pos37, pos38),
		#(get_distance_between_positions, ":dist", "$party_old_pos", pos38), #Not sure if works. Test it.
		 (ge, ":dist", 200),
		 (call_script, "script_cheat_detected", 0, 0),
	]),
 
Colonel_Ryan said:
cdvader said:
Colonel Ryan, if you'd understand the script then you'd realise that it isn't useless work at all.

Ohh.
But they still can do the export-import character cheat.
Colonel Ryan, if you'd understand the script then you'd realise that character attributes can be written to global variable and compared with new ones just like gold or xp
 
Well you guys could make a script that does things backwards when you use the cheat commands. To be more clear: You create a script that makes every time you hit CTRL+T, for example, to disband all the player's troops, or to teleport him after 1 second(to avoid the script running before the actual cheat) to some place in the map that he can't escape. Or when pressing CTRL+X in the inventory, you lose 10 grand, experience, and troops.

The only problem is that they would trigger even if Cheat Mode is off.
 
This one covers the CTRL+H cheat in scenes. Aka full health back.

Code:
		#module_mission_templates
		(ti_before_mission_start, 0, 0, [],
		[
		    (assign, "$player_agent_hp", 0),
			(assign, "$check_player_hp", 0),
		]),
		
		(ti_on_agent_spawn, 0, 0,
		[
		    (eq, "$anti_cheat_enabled", 1),
		],
		[
		    (store_trigger_param_1, ":agent"),
			(get_player_agent_id, ":player"),
			(eq, ":agent", ":player"),
			(store_agent_hit_points, ":hp", ":agent", 1),
			(assign, "$player_agent_hp", ":hp"),
		]),
		
		(1, 0, 0,
		[
		    (eq, "$anti_cheat_enabled", 1),
                    (eq, "$check_player_hp", 0),
		],
		[
		    (get_player_agent_id, ":player"),
			(store_agent_hit_points, ":hp", ":player", 1),
			(assign, ":tmp", ":hp"),
			(val_sub, ":tmp", 1),
			(lt, ":hp", ":tmp"),
			(assign, "$check_player_hp", 1),
		]),
		
		(1, 0, 0,
		[
		    (eq, "$anti_cheat_enabled", 1),
			(eq, "$check_player_hp", 1),
		],
		[
		    (get_player_agent_id, ":player"),
			(store_agent_hit_points, ":hp", ":player", 1),
			(eq, ":hp", "$player_agent_hp"),
			(assign, ":hp", 0),
                        (agent_set_hit_points, ":player", ":hp", 1),
			(agent_deliver_damage_to_agent, ":player", ":player"),
			(assign, "$anti_cheat_quit", 1),
		]),
		
		#module_triggers
		(1, 0, 0,
		[
		    (eq, "$anti_cheat_enabled", 1),
			(eq, "$anti_cheat_quit", 1),
		],
		[
		    (call_script, "script_cheat_detected", 0, 0),
		]),
 
cdvader said:
This one covers the CTRL+H cheat in scenes. Aka full health back.

Code:
		#module_mission_templates
		(ti_before_mission_start, 0, 0, [],
		[
		    (assign, "$player_agent_hp", 0),
			(assign, "$check_player_hp", 0),
		]),
		
		(ti_on_agent_spawn, 0, 0,
		[
		    (eq, "$anti_cheat_enabled", 1),
		],
		[
		    (store_trigger_param_1, ":agent"),
			(get_player_agent_id, ":player"),
			(eq, ":agent", ":player"),
			(store_agent_hit_points, ":hp", ":agent", 1),
			(assign, "$player_agent_hp", ":hp"),
		]),
		
		(1, 0, 0,
		[
		    (eq, "$anti_cheat_enabled", 1),
                    (eq, "$check_player_hp", 0),
		],
		[
		    (get_player_agent_id, ":player"),
			(store_agent_hit_points, ":hp", ":player", 1),
			(assign, ":tmp", ":hp"),
			(val_sub, ":tmp", 1),
			(lt, ":hp", ":tmp"),
			(assign, "$check_player_hp", 1),
		]),
		
		(1, 0, 0,
		[
		    (eq, "$anti_cheat_enabled", 1),
			(eq, "$check_player_hp", 1),
		],
		[
		    (get_player_agent_id, ":player"),
			(store_agent_hit_points, ":hp", ":player", 1),
			(eq, ":hp", "$player_agent_hp"),
			(assign, ":hp", 0),
                        (agent_set_hit_points, ":player", ":hp", 1),
			(agent_deliver_damage_to_agent, ":player", ":player"),
			(assign, "$anti_cheat_quit", 1),
		]),
		
		#module_triggers
		(1, 0, 0,
		[
		    (eq, "$anti_cheat_enabled", 1),
			(eq, "$anti_cheat_quit", 1),
		],
		[
		    (call_script, "script_cheat_detected", 0, 0),
		]),

"get_player_agent_id" is not defined. I think you mean "get_player_agent_no", right?
 
:lol: If TaleWorlds wouldn't of have made a ModuleSystem for Warband, then how would they mod Native themselves? Logic! *zing*  :razz:
 
Well, to get the Warband ModuleSystem you have to ask the developers and present them with your work, of course.
 
Back
Top Bottom