Run a script OnActivate on a book in players inventory?

Post » Wed Nov 10, 2010 10:50 am

Is it possible to run OnActivate scripts on a book in the players inventory?

I've tried OnActivate and OnEquip and neither work, the book just opens as usual.

The OnActivate only works on a book that is in the gameworld, not in the inventory.
User avatar
GRAEME
 
Posts: 3363
Joined: Sat May 19, 2007 2:48 am

Post » Wed Nov 10, 2010 2:38 pm

You might be able to use http://cs.elderscrolls.com/constwiki/index.php/MenuMode.

I said 'might' because it would probably run no matter what book you opened.

1026 = Book
User avatar
Czar Kahchi
 
Posts: 3306
Joined: Mon Jul 30, 2007 11:56 am

Post » Wed Nov 10, 2010 5:30 pm

Is it possible to run OnActivate scripts on a book in the players inventory?

I've tried OnActivate and OnEquip and neither work, the book just opens as usual.

The OnActivate only works on a book that is in the gameworld, not in the inventory.

Try using Begin OnEquip Player. I've used that on many books in my test mods and it's worked for me each time, but only from the Inventory menu. I use Begin OnActivate Player for books that are placed in the game world.
User avatar
Josee Leach
 
Posts: 3371
Joined: Tue Dec 26, 2006 10:50 pm

Post » Wed Nov 10, 2010 12:43 pm

According to the http://cs.elderscrolls.com/constwiki/index.php/OnActivate :

Clicking on items in inventory causes the onEquip block to run, not the onActivate block.

* However, you can make an item run it's own onActivate block in the inventory menu (MenuMode 1008, MenuMode, onEquip, etc.) with Activate player, 1.

User avatar
Imy Davies
 
Posts: 3479
Joined: Fri Jul 14, 2006 6:42 pm


Return to IV - Oblivion