Adding an extra interaction option for containers..?

Post » Tue Jun 19, 2012 10:53 am

How does one set up the options box that pops up when you look at a barrel/container.? I would like to include another option referencing the container before you open it. Hovering the crosshairs
over the model I would like to see extra options before you interact.
Can anybody point me in the right direction here. Thx..
User avatar
Da Missz
 
Posts: 3438
Joined: Fri Mar 30, 2007 4:42 pm

Post » Mon Jun 18, 2012 11:08 pm

You can give the player a perk that adds an extra activation option conditionalised to only apply to a certain type (or certain types) of container. That won't appear until after you've activated the container, though. I don't know if there is a way to change what the default activation text is for a container.

Cipscis
User avatar
Yama Pi
 
Posts: 3384
Joined: Wed Apr 18, 2007 3:51 am

Post » Tue Jun 19, 2012 9:23 am

Another way of doing this (although this would require activating the container first):

Dynamically attach scripts to the container using the methodology outlined http://www.gamesas.com/topic/1349649-dynamically-attaching-scripts-to-actors-near-the-player/.

Then, do something like this:
Scriptname activationMesserUpper extends ReferenceAliasMessage Property activationMessage Auto ; In this message, you'd define the additional options. One of these options would be what you want to do other than                                        ; activate, the other would be the normal activation process. For the sake of this example, first option (index 0) is                                        ; what you want to do, second option (index 1) is the normal activation process. There could be more.ObjectReference this ; Will store reference pointed at by alias.Event OnInit()  this = GetReference()  this.BlockActivation()EndEvent()Event OnActivate(ObjectReference akActionRef)  if( this.isActivationBlocked() && akActionRef == Game.GetPlayer() ) ; If activation blocked and activated by player.    int choice = activationMessage.Show()    if(choice == 0)      ; Do your own thing here.    else ; Second choice (index 1). Using else here because there's only two choices. if-else-if chain would be used for >2 options.         ; Note that if you still want it to activate afterwards, just take the code from the else part and put it outside of this if block,         ; and erase the else.      this.BlockActivation(false)      this.Activate()    endIf  else ; Activation not blocked.    this.BlockActivation() ; Blocking for future activation.  endIfendEvent

I didn't try compiling this, so there could be some mistakes. Also, I'm a bit on the tipsy side, so I could be grossly over-thinking this.
User avatar
Laura-Jayne Lee
 
Posts: 3474
Joined: Sun Jul 02, 2006 4:35 pm

Post » Tue Jun 19, 2012 11:14 am

You can give the player a perk that adds an extra activation option conditionalised to only apply to a certain type (or certain types) of container. That won't appear until after you've activated the container, though. I don't know if there is a way to change what the default activation text is for a container.

Cipscis

New PM dude..
User avatar
jessica breen
 
Posts: 3524
Joined: Thu Aug 03, 2006 1:04 am


Return to V - Skyrim