How to protect map (or secret room) against cheaters?
I'm making my second map to Portal 2. This time I want to put in there some secret rooms, but I'm affraid the cheaters will destroy whole surprise, so how can I protect the map against them? I thought about some kind of cheat detection. For instance when player will activite the cheat (noclip) the secrets will be removed from the map. I have no idea how to make such a thing, maby someone have a better or simpler idea?
I remember Omnicoder used "something" (I don't really know if this was the above script function or other method) for killing the player if he was noclipping for a while in his map Retrospective 
If you want to hide something; hide it in such a way that even when you noclip it wouldn't draw much attention.
If you really want it to be secure you can spam noclip 0 and sv_cheats 0 through a point_servercommand, but that would get frustrating if a player got stuck and couldn't escape.
I think you're being a little too paranoid about this.
FelixGriffin wrote:
Trigger_multiple in the secret room that disables everything if the player enters when noclipping and enables it again if they enter without it?If you really want it to be secure you can spam noclip 0 and sv_cheats 0 through a point_servercommand, but that would get frustrating if a player got stuck and couldn't escape.
Had the same Idea
I would do this, or My Idea was badly. xD
FelixGriffin wrote:
I mean, make the trigger use the script to check if the player is noclipping or not when they touch it.
Hmm i have a question, i dont often use scripts, but how do i use a script with a trigger to check noclip? I mean, how would i get a returnvalue from the script?
The one you are looking for is IsNoclipping.
To use it in a VScript you will need to use a think function from a logic_script (a function that constantly executes and is defined inside the think function variable in the logic_script)
To use a script you need to create a text file within scripts/vscripts/customsubdirectory and rename the extension to .nut then reference it within the logic_script you made. By clicking the manage button in the logic_script properties you can browse to the exact file you want to add, or even add multiple scripts for the one logic_script.
You can use the code below as a reference to make it work.
//think function used to check if the player is noclipping
function think(){
//The IsNoclipping function will either return true or false.
//If it is true it will execute the function dothis()
if(IsNoclipping()){
dothis();
}
}
function dothis(){
//execute commands here. e.g. EntFire("relayname", "Trigger", "", 0);
}
I suggest that you also have some sort of logic to disable the command you want to execute once the player has noclipped, otherwise it will constantly execute when they are.
Then place a logic_auto, target your secret stuff, OnMapSpawn secret_stuff RunScriptCode ::secret <- self;
@Felix: good point.
But guys, I think it's not necessary to kill the player or destroy the secret room, just hide it
If it's builtt up by means of func_brushes and stuff, it can be easily hidden.
ChickenMobile wrote:
Very useful information
Thanks thanks thanks for your help! 
josepezdj wrote:
@Chicken: wouldn't it be needed to pass the script through the player so it is executed every...
Grabbing the player first would be essential to the script function (sorry for not including it), however it needs to be a think function otherwise it will not execute the necessary commands once the player has noclipped. Unfortunately there is no event stated within GameEvents.res to listen to for noclipping.
By setting a function inside the script think function it will automatically execute (and continue executing) this command without the need to RunScriptCode from a logic_auto at mapspawn.
player.IsNoclipping()
or
GetPlayer().IsNoclipping()
@Felix: Yes you probably could have the script inside the level, but an external file is eternally less confusing and you can include quotation marks "" that would otherwise destroy the .vmf.
For a beginner mapper I would avoid scripts altogether as it would only make things more difficult in the long run - external files will need to be added to the .bsp using pakrat afterwards and understanding scripting comes with understanding the outputs of entities.
Also I still don't see why the need for the over-protectiveness and complexity of the 'secret exploration prevention'. Personally I would just have a trigger_teleport enabled that would teleport the player to the start until the player walks through a certain place first.
P.S. Sorry if this seems confusing, it is 2am!
CamBen wrote:
Not knowing much about scripts myself, i would place a trigger catapult in the room which expels them back into the void if they have not tripped the various triggers and activated the puzzle elements required before you can enter the room.
Frankly, I think this is the best idea. I suppose the IsNoClipping script would be an okay solution, but like LP said, I use noclip frequently when I make a mistake and don't want to reload the map again.
Dr.Toaster Waffles wrote:
CamBen wrote:Not knowing much about scripts myself, i would place a trigger catapult in the room which expels them back into the void if they have not tripped the various triggers and activated the puzzle elements required before you can enter the room.
Frankly, I think this is the best idea. I suppose the IsNoClipping script would be an okay solution, but like LP said, I use noclip frequently when I make a mistake and don't want to reload the map again.
or just make a playerclip func_brush that gets disabled, fire an env_text in their face if they missed a vital step to get in there; be a bit creative 
yishbarr wrote:
That's why it's called noclip.
Didnt thought about it. 