FAI Drawbridge Script

Information and Discussion Relating to NWN2 Scripting and Coding

Moderators: Moderator, Developer, DM

User avatar
gedweyignasia
Custom Content
Posts: 1353
Joined: Sat Nov 23, 2013 11:27 pm
Location: EST/UTC-4

FAI Drawbridge Script

Unread post by gedweyignasia »

I need to prevent a player from crossing a certain area, and it's going to require a script similar to the FAI where you can't enter if you have a mask. Can someone give me a copy of the relevant portion (or a similar script) that will prevent this from happening?

I've tried using ActionJumpToLocation and ActionForceMoveToLocation, but they don't seem to stop someone who's running with the W key. (I also tried applying the knockdown effect, but that seems to just make things worse.)


Sidenote:
ActionJumpToLocation DOES work on its own, it just looks horrible. The FAI has this nice animation where the player falls on their rear and their input is interrupted. With the ActionJumpToLocation method, the player just keeps running into the invisible barrier and teleporting back a small distance. Adding an animation doesn't smooth things over because the keyboard key overrides that. Adding knockdown effect actually NEGATES the wall, allowing someone to bypass my invisible barrier using the W key.
User avatar
gedweyignasia
Custom Content
Posts: 1353
Joined: Sat Nov 23, 2013 11:27 pm
Location: EST/UTC-4

Re: FAI Drawbridge Script

Unread post by gedweyignasia »

Anyone else looking to solve this problem, the following will be of use:
http://www.nwnlexicon.com/index.php?tit ... Immobilize

Apply with temporary duration for however long you need the player to sit still, then play whatever animations you want. Player input may override the animations, but will not override the immobilization. This does not otherwise impede the player's input, which makes it a very friendly option.

I have not been able to find any glitches or exploits that would allow a player to bypass this immobilization, so you can use it without worry. Just remember to remove the effect when you're done!! (If you somehow lose the effect, it may work to apply a second EffectCutsceneImmobilize effect and remove that one.)

Return to “NWN2 Scripting”