Author Topic: Best way to block a PC from entering a trigger region  (Read 674 times)

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Best way to block a PC from entering a trigger region
« Reply #15 on: November 27, 2015, 12:16:56 pm »


               


As the henchman is already fired, then I suppose making him custom faction will deal with the blocking problem.


 


 

Thanks! I'm bookmarking this.


 


Yeah, that's how I was thinking to go with the scene but I wanted the player to wait for a nearby guard and go through the window while he is not seen. I suppose I will just remove this idea (thinking of it, it's not the interesting thing to wait for a guard to pass by).




 


Script in the guard as part of the cutscene - add some drama to the affair. For example, the guard comes near the corner of the house, pauses, plays the listening anim (or maybe look far), then moves away running.


               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Best way to block a PC from entering a trigger region
« Reply #16 on: November 27, 2015, 01:13:57 pm »


               


I guess the best way would be to surround the area with a couple of such objects and the JumpTo the nearest one?


 


So while the character is sliding, it's impossible to click rapidly and stop it?


 


 


 


(I love this forum, a lot of helpful people here. Thank you!)




If the JumpToObject action is in progress, the user cannot logically interrupt it until the action is completed. (because of the way the action queue works server side)


(technically)


However - they can do lots of things on their client side to interrupt it - by spamming keys and clicks etc.


What you need to make sure of - is that the destination that the player is 'sliding' to, is far enough away that they cannot somehow spazz the system into interrupting and getting back into the trigger area.


As long as the location they are sliding to is far enough away, they should be placed back outside of the trigger each time.


Its just a matter of finding the sweet spot.


And yes - putting a few of the same object around the trigger area is ideal.


They just need to have the same tag as the script


And logically speaking, the script should make them slide to the nearest object.


               
               

               
            

Legacy_Frush O'Suggill

  • Jr. Member
  • **
  • Posts: 71
  • Karma: +0/-0
Best way to block a PC from entering a trigger region
« Reply #17 on: November 27, 2015, 11:23:46 pm »


               

These are all great ideas. I just want to add the obvious point that if a player wants to break your module, they will always find a way, It's virtually impossible to stop it completely. Fortunately, most people don't actually want to do that - they'd rather actually enjoy playing it the way it is intended. With that said, I would probably put a script in the OnEnter of a trigger a good distance from the door that puts the PC in cutscene mode, calls a ClearAllActions on them, and starts a small conversation explaining that if they continue, they will fail their mission. That would be enough for anyone who's actually interested in playing along. For everyone else - well, they could just hit the tilde key, put themselves in god mode, and kill all your NPCs. There's no way to stop people who intentionally want to screw up your module.



               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Best way to block a PC from entering a trigger region
« Reply #18 on: November 28, 2015, 01:13:58 am »


               


These are all great ideas. I just want to add the obvious point that if a player wants to break your module, they will always find a way, It's virtually impossible to stop it completely. Fortunately, most people don't actually want to do that - they'd rather actually enjoy playing it the way it is intended. With that said, I would probably put a script in the OnEnter of a trigger a good distance from the door that puts the PC in cutscene mode, calls a ClearAllActions on them, and starts a small conversation explaining that if they continue, they will fail their mission. That would be enough for anyone who's actually interested in playing along. For everyone else - well, they could just hit the tilde key, put themselves in god mode, and kill all your NPCs. There's no way to stop people who intentionally want to screw up your module.




 


All good points. The trigger is a good idea, but will break immersion - something the OP doesn't want to have happen (and I can't blame him). Cutscene mode is the way to go for sure - indeed, for almost any situation that forces the PC into a course of action - but striking a conversation warning off the PC isn't needed when you can just control the PC =. After all, if the player can't use their mouse for a few seconds, they can't break anything. 



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Best way to block a PC from entering a trigger region
« Reply #19 on: November 28, 2015, 09:12:11 am »


               

Cutscenes are a good way (especially if you use the Gestalt package) but somewhat tedious to debug, I find.


 


A simpler way to prevent the player from interfering with the PC actions uses SetCommandable, e.g.



ActionMoveToObject(oWindow);
ActionJumpToObject(oWaypointInsideHouse);
ActionDoCommand(SetCommandable(TRUE));
SetCommandable(FALSE);

The first three actions are queued, but the final SetCommandable executes at once, rendering the PC free from player interference until the final action occurs.


 


One advantage is that the player retains control of the camera, and is able to follow the action, regardless of visual obstacles or zooming issues arising from conversation (this, I find, is one of tricky aspects of cutscenes).



               
               

               
            

Legacy_Zeke

  • Jr. Member
  • **
  • Posts: 86
  • Karma: +0/-0
Best way to block a PC from entering a trigger region
« Reply #20 on: November 30, 2015, 10:15:14 am »


               


The first three actions are queued, but the final SetCommandable executes at once, rendering the PC free from player interference until the final action occurs.


 


One advantage is that the player retains control of the camera, and is able to follow the action, regardless of visual obstacles or zooming issues arising from conversation (this, I find, is one of tricky aspects of cutscenes).




Oh, I didn't know about  the SetCommandable() function. Nice.


 


It seems it doesn't support SetFacing() while SetCommandable() is FALSE?



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Best way to block a PC from entering a trigger region
« Reply #21 on: November 30, 2015, 03:43:59 pm »


               


...It seems it doesn't support SetFacing() while SetCommandable() is FALSE?




 


Correct. SetFacing is an unusual command. It has to be assigned to an object, which isn't possible unless the object is commandable.


 


However, it isn't an action, in the usual sense. If you want SetFacing to occur only when previous actions are complete, ActionDoCommand(SetFacing()) will do it.