I have a door that teleports the PC to a opposing door when the area transition is used, effectively preventing them from entering the room between the doors. I need to destroy the area transition between the doors once certain conditions have been met. Can this done be done via a script?
Destroy an Area Transition with a script - Can it be done?
#1
Posté 09 juillet 2014 - 07:10
#2
Posté 09 juillet 2014 - 07:15
DestroyObject should normally work...
EDIT:
or you need this only temporarily?
if thats the case then this should work - set both doors on waypoint instead of doors (some additional scripting such as my door system (or carcerian recently updated something less complicated) is then required though) and destroy/create waypoint as needed. If the door's target is not valid the transition won't show at all.
Of course cheap solution is to make an OnAreaTransition script that won't teleport PC on transition target, but if better option is available why to think low.
Modifié par Shadooow, 09 juillet 2014 - 07:24 .
#3
Posté 09 juillet 2014 - 07:20
I'll try that.
#4
Posté 09 juillet 2014 - 07:29
Another option is to set the area transition target for both door to "xxx" or something not used by anything (rather than the door or waypoint). In game, you'll still get the transition field in the doorway.
Then, OnTransitionClick for each door, set a custom script that jumps between doors unless some condition is met.
- Pstemarie aime ceci
#5
Posté 09 juillet 2014 - 08:53
Thanks guys - I got it working. I ended up using BTB's transition target trick ("...'xxx' or something not used...") with a custom transition script and a string variable on the door to store the destination waypoint's tag. Once the special condition is met, the value on the variable is changed to the new destination.
#6
Posté 09 juillet 2014 - 09:05
NW_G0_Transition.nss is the default transition script. It gets ran if you have nothing in the events.
oops make that X3_G0_Transition.nss
#7
Posté 09 juillet 2014 - 09:06
Thanks guys - I got it working. I ended up using BTB's transition target trick ("...'xxx' or something not used...") with a custom transition script and a string variable on the door to store the destination waypoint's tag. Once the special condition is met, the value on the variable is changed to the new destination.
Just to clarify - there is no difference between what BTB suggested and what I suggested as cheap solution. Since as long as you give a custom OnAreaTransition script it doesn't matter what target are doors set anymore. Thus there is no need to set area transition target to "xxx".
- Pstemarie aime ceci
#8
Posté 09 juillet 2014 - 09:37
Yeah I blundered upon that fact when I forgot to set "XXX" for the other door's transition.
@Lightfoot - thanks for that, but editing the default script won't really work. Its a set of doors in one area and I don't want the modification to be global. Basically the doors transport between each other until the PC solves a puzzle, then they both transport to the area unlocked by solving the puzzle.
#9
Posté 09 juillet 2014 - 09:45
#10
Posté 10 juillet 2014 - 10:10
I made a version of nw_g0_transition with a user exit. It's published in Travel Builder but can be used stand-alone.
That's an excellent series of scripts. I won't use it for this module, as all the adventure takes place within one locale, but maybe if I expand upon it in the future...





Retour en haut






