Quetzlsacatanango Posted July 16, 2010 Share Posted July 16, 2010 I have a trigger box, and I want anyone that triggers it to be added to a faction. My script looks like: scn QTriggerScript ref rFA Begin OnTriggerEnter Set rFA to getself rFA.addtofaction QFaction 10 End I tried it without the variable at all, simply putting the 'addtofaction' line, and that didn't work, then I tried it this way. I have rarely if ever used reference variable, but this compiles fine and seems like it should work. But NPCs entering the trigger don't join the faciton. What up with that? Link to comment Share on other sites More sharing options...
pkleiss Posted July 16, 2010 Share Posted July 16, 2010 Sorry, I'm not Cipscis (then, who is?), but... In your script GetSelf will return the trigger, not the NPC who activated the trigger. Try GetActionRef instead.I don't now if the player matters, but you might want to check for the player and not add the faction to him. Link to comment Share on other sites More sharing options...
Quetzlsacatanango Posted July 16, 2010 Author Share Posted July 16, 2010 That was it, muchas gracias. I had read that Getactionref was only good inside an OnActivate block, but apparently that was incorrect. Link to comment Share on other sites More sharing options...
pkleiss Posted July 16, 2010 Share Posted July 16, 2010 According to the wiki:This function is only useful inside an OnActivate, OnTriggerEnter, OnTriggerLeave, or OnTrigger block. Link to comment Share on other sites More sharing options...
Recommended Posts