HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Anti-Cheat Tutorial

03-10-2006, 12:07 AM#1
SomeGuy333
Anti-Cheat tutorial
1. - Beating Iseedeadpeople cheat
2. - Beating Whosyourdaddy cheat
3. - Beating Greedisgood cheat



If you know any other ways to anti-cheat in single player maps please share them and they will be added.


1. Beating the Iseedeadpeople cheat
This is the simplest one to get beat.
Simply make a trigger in game that has an event, Periodic timer, somewhere less than 2 seconds. The actions you want are in the visibility category, "Visibility - Enabled black mask" and "Visibility - Enable fog of war".
Trigger:
anti see all
Collapse Events
Time - Every 0.10 seconds of game time
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Fog of war is enabled) Equal to False
(Black mask is enabled) Equal to False
Collapse Actions
Visibility - Enable fog of war
Visibility - Enable black mask

2. Beating Whosyourdaddy
This one will require a few triggers and some unused space on your map. You need to pick a corner of your map that no one will be able to get to and 2 dummy units. The first unit will be, lets say a guard tower, set it's attack to 5 and give it a low cooldown, invulnerability and spell immunity. The second unit will have spell immunity and 100 hp and 100-hp regeneration always. You need to place both units near each other out of reach, the tower will belong to neutral passive and the second unit will belong to neutral hostile. this is where we implement the triggers. first trigger will need to give the tower to a user's slot that isn't being used at the moment. The trigger then will give the tower to the unused user slot. Create a trigger with Specific unit event "Neutral hostile's unit dies" and action "custom script: call EndGame( false )"

This works because units owned by a user player slot are affected by the Whosyourdaddy cheat, once someone enters the cheat their unit will do more damage and the neutral hostile's unit will die.

sample triggers are below.
Trigger:
end game
Collapse Events
Unit - Footman 0007 <gen> Dies
Conditions
Collapse Actions
Custom script: call EndGame( false ) // this ends the game for all players hiding the score screen
Trigger:
give tower to a user slot not filled by a person
Collapse Events
Map initialization
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Player((Integer A))) controller) Equal to User
((Player((Integer A))) slot status) Not equal to Is playing
Collapse Then - Actions
Unit - Change ownership of Guard Tower 0000 <gen> to (Player((Integer A))) and Change color
Skip remaining actions
Else - Actions

why give the tower to a unused player slot? so that they dont see it. that will leave them unknowning as to why they lost.

3. - Beating GreedisGood cheat, by AgentPaper
what this does is it checks every second how much a player's gold has increase, if they increase way to fast then it will change their gold back to what it was before. The value of X should be a number that is unattainable in 1 second of game play.
Trigger:
AntiGreed1
Collapse Events
Time - Every 0.10 seconds of game time
Conditions
Collapse Actions
Collapse Player Group - Pick every player in (All players) and do (Actions)
Collapse Loop - Actions
Set Value2[(Player number of (Picked player))] = ((Player((Player number of (Picked player)))) Current gold)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Value1[(Player number of (Picked player))] - Value2[(Player number of (Picked player))]) Greater than or equal to (5000 + 0)
Collapse Then - Actions
Player - Set (Player((Player number of (Picked player)))) Current gold to Value1[(Player number of (Picked player))]
Game - Display to (All players) for 30.00 seconds the text: ((Name of (Player((Player number of (Picked player))))) + has tried to cheat!)
Collapse Else - Actions
Set Value2[(Integer A)] = ((Player((Integer A))) Current gold)

3.1 - Second way to beat Greedisgood
Because greedisgood give gold to all players/computer all you need is a empty player slot that has no chance of ever getting gold. have a trigger event from that player/computer having greater then or equal to X amount of gold and have whatever actions you want.
Attached Files
File type: w3xanti-cheat tutorial.w3x (14.9 KB)
03-10-2006, 12:19 AM#2
Whitehorn
You might want to explain what the cheats do, and why you are revealing the map in your first trigger...
03-10-2006, 12:22 AM#3
SomeGuy333
that was an accidental typo, thanks for pointing it out.
03-10-2006, 08:06 AM#4
olofmoleman
Niice... very usefull
03-10-2006, 08:52 AM#5
Whitehorn
It's lame efficiency.

Why don't you use 'a user types -Iseedeadpeople' as the event?
03-10-2006, 10:57 AM#6
Vexorian
hmnn whitehorn that's a burn!

you can't detect cheat codes using the chat event
03-10-2006, 11:48 AM#7
SomeGuy333
i think whitehorn is confused, he is probably thinking this is a tutorial to get ingame single player cheats in multiplayer.
03-10-2006, 11:49 AM#8
Whitehorn
Quote:
Originally Posted by SomeGuy333
i think whitehorn is confused, he is probably thinking this is a tutorial to get ingame single player cheats in multiplayer.

Not at all. But your trigger was pretty lame considering it emulated the cheat rather than countered it :P
03-10-2006, 01:57 PM#9
Jacek
I thought cheats can be removed by importing empty cheats file or something into map.
03-10-2006, 07:33 PM#10
Vexorian
no, It used to work but not anymore.

And I don't understand any of the triggers posted her
03-10-2006, 07:58 PM#11
Metal_Sonic64
The last one makes some sense, but you can just slightly increase your gold and lumber each time. I don't seem to get the others either.
03-10-2006, 10:21 PM#12
SomeGuy333
Quote:
Originally Posted by Metal_Sonic64
The last one makes some sense, but you can just slightly increase your gold and lumber each time. I don't seem to get the others either.
the first trigger has event for when a unit dies, a unit with high regeneration rate. That unit stands next to a tower with dmg that isn't high enough to kill it. The second trigger gives the tower to a open player's slot, i do that so that players won't directly know what causes the cheat to be detected, that will make it subject to getting the benefits of the god cheat(whosyourdaddy). Once a player enters that cheat into the game the tower will have increased damage, enough to kill the unit standing next to it. Once that unit dies the game is ended by the first trigger.
03-11-2006, 10:46 AM#13
Vexorian
All right I understand the anti Iseedeadpeople now, but would that actually work with maphacks?

I think the best way (less charging) is to add a corrupted model that makes the game crash to an area that is invisible
03-11-2006, 11:38 PM#14
MrApples
It can't respond to a chat event cause a cheat isn't condiered a chat message.

It has to be faster then every 1 second also to work right.

Trigger:
Or - Any (Conditions) are true
Collapse Conditions
(Fog of war is enabled) Equal to False
(Black mask is enabled) Equal to False

Add that condition to the first one.

Trigger:
Anti GoldCheat
Collapse Events
Time - Every 0.05 seconds of game time
Conditions
Collapse Actions
-------- PlayersPlaying is a Variable that keeps track of players currently playing, by adding at start, and removing when they leave. --------
Collapse Player Group - Pick every player in PlayersPlaying and do (Actions)
Collapse Loop - Actions
Set GoldCurrent[Player Number of (Plicked Player)] = ((Picked player) Current gold)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
GoldCurrent[Player Number of (Plicked Player)] - GoldBefore[Player Number of (Plicked Player)] Greater than 500(Or the lowest impossible amount gained in 0.05secs)
Collapse Then - Actions
Player - Set (Picked player) Current gold to GoldBefore[Player Number of (Plicked Player)]
Collapse Else - Actions
Set GoldBefore[Player Number of (Plicked Player)] = ((Picked player) Current gold)
03-22-2006, 10:20 PM#15
PitzerMike
This is pretty useful i guess - approved.
Please consider updating your tutorial with MrApple's suggestion.