how to make a trigger on item collected?

Post » Tue Jan 08, 2013 12:08 am

Hi I have placed a weapon and I want a monster to appear when the player collects the weapon , but I do not want to stick a script for that in that weapon so how can I do to :

1 enable the trigger monster when sword is collected

2 lock a door when the sword is collected

???
User avatar
Angelina Mayo
 
Posts: 3427
Joined: Wed Jan 24, 2007 4:58 am

Post » Tue Jan 08, 2013 9:25 am

Is the sword in a container or just placed somewhere in the open?

If it is in a container, then you could attach a script to the container. Then you could use the OnItemRemoved event.

If it is placed in the open, then you could attach a script to a player alias and use the OnItemAdded event (I assume your scenario is part of a quest). Or surround the sword with a invisible volume that acts as an activator and attach a script to that. Then you could use the OnActivate event. The latter isn't foolproof, since the sword could be moved by accident before activating the invisible activator.
User avatar
Pants
 
Posts: 3440
Joined: Tue Jun 27, 2006 4:34 am

Post » Tue Jan 08, 2013 12:49 am

Why do you not want to add a script to the weapon?

You could make the weapon an alias and apply the script that way, as to not change the base form of the weapon.
User avatar
Colton Idonthavealastna
 
Posts: 3337
Joined: Sun Sep 30, 2007 2:13 am

Post » Tue Jan 08, 2013 2:10 am

You could make the weapon an alias and apply the script that way, as to not change the base form of the weapon.

This would probably be the best option. You could probably use the OnContainerChanged event.
User avatar
Alan Cutler
 
Posts: 3163
Joined: Sun Jul 01, 2007 9:59 am


Return to V - Skyrim