How to protect map (or secret room) against cheaters?

Avatar
czolko
7 Posts
Posted Jun 27, 2013
Hi!

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?

Advertisement
Registered users don’t see ads! Register now!
Avatar
josepezdj
2,386 Posts
Posted Jun 27, 2013
Replied 15 minutes later
There is a script function for that: IsNoclipping.

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 :wink:

Avatar
czolko
7 Posts
Posted Jun 27, 2013
Replied 11 minutes later
Thank you. I'm will try this one.
Avatar
Lpfreaky90
2,842 Posts
Posted Jun 27, 2013
Replied 2 hours later
I wouldn't do it. Quite often I noclip just so I don't die or similar minor things.
If you want to hide something; hide it in such a way that even when you noclip it wouldn't draw much attention.
Avatar
FelixGriffin
2,680 Posts
Posted Jun 27, 2013
Replied 2 hours later
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.

Avatar
ChickenMobile
2,460 Posts
Posted Jun 27, 2013
Replied 5 minutes later
My logic is: how would a player know there is a secret to noclip to?
I think you're being a little too paranoid about this.
Avatar
User
630 Posts
Posted Jun 27, 2013
Replied 5 hours later

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 :biggrin: I would do this, or My Idea was badly. xD

Avatar
FelixGriffin
2,680 Posts
Posted Jun 27, 2013
Replied 1 minutes later
I mean, make the trigger use the script to check if the player is noclipping or not when they touch it.
Avatar
User
630 Posts
Posted Jun 27, 2013
Replied 3 minutes later

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?

Avatar
ChickenMobile
2,460 Posts
Posted Jun 27, 2013
Replied 3 hours later
You can find all the script functions at this page: https://developer.valvesoftware.com/wik ... _Functions

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)

portal.jpg

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.

Images 1
Post image 1
Avatar
FelixGriffin
2,680 Posts
Posted Jun 27, 2013
Replied 2 hours later
I was thinking simpler. Add this to your trigger: OnStartTouch !self RunScriptCode if(GetPlayer().IsNoclipping()) ::secret.Destroy();

Then place a logic_auto, target your secret stuff, OnMapSpawn secret_stuff RunScriptCode ::secret <- self;

Avatar
josepezdj
2,386 Posts
Posted Jun 28, 2013
Replied 7 hours later
@Chicken: wouldn't it be needed to pass the script through the player so it is executed every [don't remember exactly the number of mimliseconds right now] secs? or would it work just by executing the function at the beginning of the map load via the logic_script / logic_auto?

@Felix: good point.

But guys, I think it's not necessary to kill the player or destroy the secret room, just hide it :biggrin: If it's builtt up by means of func_brushes and stuff, it can be easily hidden.

Avatar
User
630 Posts
Posted Jun 28, 2013
Replied 47 minutes later

ChickenMobile wrote:
Very useful information

Thanks thanks thanks for your help! :biggrin:

Avatar
ChickenMobile
2,460 Posts
Posted Jun 28, 2013
Replied 5 hours later

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!

Avatar
CamBen
973 Posts
Posted Jun 29, 2013
Replied 1 day later
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.
Avatar
Dafflewoctor
415 Posts
Posted Jun 29, 2013
Replied 6 hours later

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.

Avatar
Lpfreaky90
2,842 Posts
Posted Jun 29, 2013
Replied 35 minutes later

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 :wink:

Avatar
FelixGriffin
2,680 Posts
Posted Jun 30, 2013
Replied 14 hours later
Noclip will take you through playerclips like other brushes, but (bug or feature?) trigger_catapults will still fling you as normal.
Avatar
Gemarakup
1,183 Posts
Posted Jun 30, 2013
Replied 23 minutes later
That's why it's called noclip.
Advertisement
Registered users don’t see ads! Register now!
Avatar
User
630 Posts
Posted Jun 30, 2013
Replied 3 hours later

yishbarr wrote:
That's why it's called noclip.

Didnt thought about it. :lol: