Quote: "any idea how make NPC activate switch ?"
Yes, a few of them. Off the top of my head, use the command
anywithinzone...
3.3.1.2 ANYWITHINZONE=X
Description: Is true if any entity is within the zone and X is 1, or if the no entity is within the zone and X is not 1.
Range: X = 1 – returns true if any entity is within the zone.
X 1 – returns true if no entities are within the zone.
Example: :anywithinzone=1:state=10
:anywithinzone=0:state=20
Take a look at a standard switch script...
;Artificial Intelligence Script
;Header
desc = Switch Activate (toggle on and off)
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10
:plrdistwithin=50:hudshow=useswitchprompt,hudfadeout=useswitchprompt
:state=10,plrdistwithin=50,plrusingaction=1:state=1,plrsound=$0,activateifused=1,alttexture=1
:state=1,plrusingaction=0:state=2
:state=2,plrdistwithin=50,plrusingaction=1:state=3,plrsound=$1,activateifused=0,alttexture=0
:state=3,plrusingaction=0:state=10
;End of Script
You would need to remove the
plrdistwithin and replace with the
anywithinzone, and the
plrusingaction would also be no use. I would use an "etimer" and have a pause making it look like the NPC walked up to the switch, paused right in front, and activated it. The switch script would run the
anywithinzone=x command and when the NPC is in the zone, use the "etimer" to give a pause before the switch activates the door (or whatever it activates).
Not hard to achieve using the basic commands available. Refer to the
Script Syntax for listing. Also refer to your "Docs" folder for the Official Community Guide which has a tonne of information that is valuable. If you don't have it, look
here.
There's no problem that can't be solved without applying a little scripting.