Author Topic: Destroy an Area Transition with a script - Can it be done?  (Read 433 times)

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Destroy an Area Transition with a script - Can it be done?
« on: July 09, 2014, 08:10:44 pm »


               

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?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Destroy an Area Transition with a script - Can it be done?
« Reply #1 on: July 09, 2014, 08:15:22 pm »


               

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 .
                     
                  


            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Destroy an Area Transition with a script - Can it be done?
« Reply #2 on: July 09, 2014, 08:20:20 pm »


               

I'll try that.



               
               

               
            

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
Destroy an Area Transition with a script - Can it be done?
« Reply #3 on: July 09, 2014, 08:29:19 pm »


               

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.  



               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Destroy an Area Transition with a script - Can it be done?
« Reply #4 on: July 09, 2014, 09:53:42 pm »


               

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.



               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Destroy an Area Transition with a script - Can it be done?
« Reply #5 on: July 09, 2014, 10:05:54 pm »


               

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



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Destroy an Area Transition with a script - Can it be done?
« Reply #6 on: July 09, 2014, 10:06:37 pm »


               


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".


               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Destroy an Area Transition with a script - Can it be done?
« Reply #7 on: July 09, 2014, 10:37:52 pm »


               

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.



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Destroy an Area Transition with a script - Can it be done?
« Reply #8 on: July 09, 2014, 10:45:18 pm »


               I made a version of nw_g0_transition with a user exit. It's published in Travel Builder but can be used stand-alone.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Destroy an Area Transition with a script - Can it be done?
« Reply #9 on: July 10, 2014, 11:10:30 am »


               


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...