Jump to content

[LE] Armor as activator


Tasheni

Recommended Posts

You need to attach a script to it that on equip will run.

About a year ago i made a script that when the npc wears the armor, it will slowly drain his health, and on death it will activate certain doors and other activators.

The script had an on death activate link ref > this was linked to an xMarker activator with a default trap lever script > and the xMarker activator to all the doors and activators.

(I never actually used it in the mod i was working)

If i find it i'll post it, althought i think a much more expirienced scripter than me would be more appropriate for what you are aiming to achive.

Edited by maxarturo
Link to comment
Share on other sites

I don't quite get it...

"I want to have the armor - or outfit - clickable, when it's worn"

So... it will only work in 3rd person view and when worn will appear an "activate armor" message (which it will always going to be in your screen since you can't set the 3rd person camera out of the actor focus), i don't know if i've understand correctly...

Link to comment
Share on other sites

What do you want the activator to do specifically? You want something to happen when you equip the armor, right? You can attach a script containing the OnEquipped() function to an armor piece and have it activate, when equipped, your custom activator(s). PM me if any questions.
Link to comment
Share on other sites

Thanks a lot for replying. I want a piece of armor work as an activator, if it's equipped. The activator should display a text "click me" and behind that simply run the script to open inventory. For example you have a packmule. The bags of it are attached as outfit. The mule has the keyword ActorTypeHorse and can be ridden. I could use BlockActivation for reach the inventory, but then it's not compatible anymore to Convenient or Immersive Horses. So it would be great, if I would simply need to click on that piece of bag to open the inventory.

I apologize if I was not clear enough - I guess it was not that clear in my head :)

Link to comment
Share on other sites

A solution (may not be the best one) that requires SKSE

You will need to register for a given key press.

Set up code to that listens for that key press.

When the key is pressed if and only if the current cross hair target is your packmule then open the inventory.

 

Here is an example. Adjust as necessary.

GlobalVariable Property SomeVar Auto
Actor Property MyMule Auto
ObjectReference Ref = None

Event OnKeyDown(Int KeyCode)
  If KeyCode == SomeVar.GetValue() 
    Ref = Game.GetCurrentCrosshairRef()
    If Ref != None
      If Ref as Actor 
        If (Ref as Actor) == MyMule
          ;do stuff
        EndIf
      EndIf
    EndIf
  EndIf
EndEvent

You can even take it further and include additional statement checks to ensure that the crosshair target does have the required item before proceeding.

 

EDIT: Slight tweak to code.

Edited by IsharaMeradin
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...