Disallowing an object refeence to be activated?

Post » Sat Nov 17, 2012 7:19 pm

What I mean by the cryptic title is this: Let's say I have a dead actor. If the player clicks on it, he'll get to the inventory screen. I can script the OnActivate event but the usual behavior of the player clicking it will still occur, no matter what. Same with books or chairs or anything else that behaves by clicking.

Is there a way to disable the activation behavior when the player clicks on it?
User avatar
Jessie Butterfield
 
Posts: 3453
Joined: Wed Jun 21, 2006 5:59 pm

Post » Sat Nov 17, 2012 7:57 pm

you can use BlockActivation(), which will bypass the normal activation of your object. it will still run whatever OnActivate event you have in the script though

example, if you use BlockActivation on a container (it has to be called some time before the OnActivate event, such as OnCellAttach or OnInit). when the player activates it, it will make a "fail" sound effect, but still fire the Event OnActivate block of the script in its entirety without opening the inventory menu screen
User avatar
Rachael Williams
 
Posts: 3373
Joined: Tue Aug 01, 2006 6:43 pm

Post » Sat Nov 17, 2012 5:00 pm

you can use BlockActivation(), which will bypass the normal activation of your object. it will still run whatever OnActivate event you have in the script though

example, if you use BlockActivation on a container (it has to be called some time before the OnActivate event, such as OnCellAttach or OnInit). when the player activates it, it will make a "fail" sound effect, but still fire the Event OnActivate block of the script in its entirety without opening the inventory menu screen

Awesome! That is exactly what I need. Many thanks.
User avatar
Life long Observer
 
Posts: 3476
Joined: Fri Sep 08, 2006 7:07 pm

Post » Sat Nov 17, 2012 5:10 pm

you can use BlockActivation(), which will bypass the normal activation of your object. it will still run whatever OnActivate event you have in the script though

example, if you use BlockActivation on a container (it has to be called some time before the OnActivate event, such as OnCellAttach or OnInit). when the player activates it, it will make a "fail" sound effect, but still fire the Event OnActivate block of the script in its entirety without opening the inventory menu screen

Basically what I did. I wanted a dead goat to be activatable, and display a message, without the inventory menu showing. So I attached a little BlockActivation script to it, then added another script calling the OnActivate message. Works brilliant :)
User avatar
Kim Kay
 
Posts: 3427
Joined: Fri Oct 13, 2006 10:45 am

Post » Sat Nov 17, 2012 9:28 pm

Awesome! That is exactly what I need. Many thanks.

In your situation I recommend to call BlockActivation in an OnDeath Event.
User avatar
Arrogant SId
 
Posts: 3366
Joined: Sat May 19, 2007 11:39 am


Return to V - Skyrim