Author Topic: Chat Mod to limit talking through bricks  (Read 4325 times)

Why not so a second raycast a few units above the first?

It's entirely possible

...and around all possible other corners? It's not possible without a network of bricks to go around corners that players should be able to talk around.

...and around all possible other corners? It's not possible without a network of bricks to go around corners that players should be able to talk around.

I figured it would require something unreasonable to make it work. Doing pathfinding and making only accepting routes that are a certain distance would work too right? I know it wouldn't be an efficient way but was just curious.

They're not
You quite literally drew a yellow line between their respective eye points that is unobstructed by bricks.

Anyway, you can use ::getWorldBox() to get the coordinates of the world box, then you can send a ray to each corner to see if you can see any corners of their world box, then send a check to eye point and/or their Player::getHackPosition() to make it even more accurate.

Code: [Select]
function Player::canSeeObject(%this, %obj) {
  if(!isObject(%obj) || !isFunction(%obj.getClassName(), getWorldBox))
    return false;
  %worldBox = %obj.getWorldBox();
  %minBox = getWords(%worldBox,0,2);
  %maxBox = getWords(%worldBox,3);
  %box[0] = "return %minBox;";
  %box[1] = "return getWords(%minBox,0,1) SPC getWord(%maxBox,2);";
  %box[2] = "return getWord(%minBox,0) SPC getWord(%maxBox,1) SPC getWord(%minBox,2);";
  %box[3] = "return getWord(%maxBox,0) SPC getWords(%minBox,1);";
  %box[4] = "return %maxBox;";
  %box[5] = "return getWords(%maxBox,0,1) SPC getWord(%minBox,2);";
  %box[6] = "return getWord(%maxBox,0) SPC getWord(%minBox,1) SPC getWord(%maxBox,2);";
  %box[7] = "return getWord(%minBox,0) SPC getWords(%maxBox,1);";
  %box[8] = "return %obj.getType() & $TypeMasks::PlayerObjectType ? %obj.getHackPosition() : %obj.getWorldBoxCenter();";
  for(%i = 0; %i < 9; %i++)
    if(!isObject(containerRayCast(%this.getEyePoint(), eval(%box[%i]), %player)))
      return true;
  return false;
}
« Last Edit: July 09, 2014, 10:36:57 PM by $trinick »

You quite literally drew a yellow line between their respective eye points that is unobstructed by bricks.




That corner is obstructing the view, I know this because I tested it.


As for the worldbox part, that sounds like it might do what I want. Thanks for that

I'm still not seeing it, but it's a moot point anyway. No point in arguing about it.

Are you handicapped or something it is very clearly going through the bricks. Look at the positions of the player models.

I cant tell if youre trolling or not.

Are you handicapped or something it is very clearly going through the bricks. Look at the positions of the player models.

I cant tell if youre trolling or not.

It very clearly passes in front of the plate and over the wall.

It very clearly passes in front of the plate and over the wall.
The line isn't a 3d model, he just drew a line from face to face in photoshop or something.

Are you handicapped or something it is very clearly going through the bricks. Look at the positions of the player models.

I cant tell if youre trolling or not.

$trinick is not handicapped nor is he trolling. He is right and you are wrong, you wanna know why? Because he has narcissistic personality disorder, he strives to be right because he is right because he's inherently more intelligent and cool than you.

$trinick is not handicapped nor is he trolling. He is right and you are wrong, you wanna know why? Because he has narcissistic personality disorder, he strives to be right because he is right because he's inherently more intelligent and cool than you.
You really like that quote don't you.

$trinick is not handicapped nor is he trolling. He is right and you are wrong, you wanna know why? Because he has narcissistic personality disorder, he strives to be right because he is right because he's inherently more intelligent and cool than you.
Alt meters are off the chart!


Good work, detective!
Tried to get the 60's spiderman holding the cigarette detector, but I couldn't find it anywhere.

Tried to get the 60's spiderman holding the cigarette detector, but I couldn't find it anywhere.

What the hell? Lol? Like what is your problem?

$trinick is not handicapped nor is he trolling. He is right and you are wrong, you wanna know why? Because he has narcissistic personality disorder, he strives to be right because he is right because he's inherently more intelligent and cool than you.
First off, he's right. Second, trinick can probably do anything better than you when it comes to coding (hell, I can even do better than you) because I'm pretty sure you have no idea what you are talking about. Stop being a condescending starfish and help the OP because that's what this board is for. It's called Coding Help for a reason.
« Last Edit: July 11, 2014, 10:30:18 PM by Cruxeis »