Author Topic: Creating a Trap Friendly to a PC  (Read 359 times)

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Creating a Trap Friendly to a PC
« on: October 08, 2014, 05:17:10 pm »


               

I am working on a modification to our housing system where traps placed in a player's dynamically created house (Hunter's Housing system) get recreated when the building is re-entered. I've got it working, for the most part, as intended. However, I'm hoping someone can provide some guidance on how I can set a trap to 'friendly' or green to its creator if they re-enter the building. Basically, I'm looking to mimic the same behavior as if the PC had just placed the trap for the first time - where it shows up green for them and red for everyone else who detects it.


 


It appears that the CreateTrapXXX functions, while allowing for the thing to be spawned to one of the standard factions, won't allow a trap to be created as friendly to one person, and hostile to others. Does anyone know of a way that, via script (or maybe NWNX?) a trap can be created as friendly to one person?



               
               

               
            

Legacy_HipMaestro

  • Hero Member
  • *****
  • Posts: 2849
  • Karma: +0/-0
Creating a Trap Friendly to a PC
« Reply #1 on: October 08, 2014, 05:53:34 pm »


               

Did you try creating a custom faction for the trap?



               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Creating a Trap Friendly to a PC
« Reply #2 on: October 08, 2014, 06:28:43 pm »


               

I wonder if this trap should be hostile to everyone, but then you could use the set friendly functions to the PC. Does that work on a trap?


 


I was also wondering if there is an NWNX function that allows you to change the reputation between two individuals without affecting the faction reputation.



               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Creating a Trap Friendly to a PC
« Reply #3 on: October 08, 2014, 08:56:02 pm »


               nwnx_funcs has a SetTrapCreator() function.
               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Creating a Trap Friendly to a PC
« Reply #4 on: October 09, 2014, 04:30:03 pm »


               

Before going through the big procedure of setting up a custom faction hostile to everyone, and then making it friendly to the PC, I decided just to try spawning the traps as Defender or Merchant (which are neutral to the PC). They always appear red, so it seems to me that the faction parameter of those functions doesn't work..?


 


I did test that the SetTemporaryFriend function doesn't appear to work on traps/triggers either.


 


And I bet that SetTrapCreator would probably work....too bad it hasn't been ported to the Windows nwnx_funcs so I could test it. '<img'>



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Creating a Trap Friendly to a PC
« Reply #5 on: October 09, 2014, 08:43:38 pm »


               


Before going through the big procedure of setting up a custom faction hostile to everyone, and then making it friendly to the PC, I decided just to try spawning the traps as Defender or Merchant (which are neutral to the PC). They always appear red, so it seems to me that the faction parameter of those functions doesn't work..?


 


I did test that the SetTemporaryFriend function doesn't appear to work on traps/triggers either.


 


And I bet that SetTrapCreator would probably work....too bad it hasn't been ported to the Windows nwnx_funcs so I could test it. '<img'>




see my edit


 


http://www.nwnlexico...1091&oldid=8013


 


if its relevant, for ground traps it should work