Jump to content

[LE] How to change ownership of an targeted object (crafting station)


Sthaagg

Recommended Posts

Hello,

 

First, I'm a very big newbie with creation kit and papyrus.

 

I want to make a simple mod which add a lesser power to the player which permits to change ownership of a crafting station (or other object but it is the first idea).

 

I understood how to make my quest to add the power to the player

How to "create" a lesser power which rely to my script but....

 

I can't understand how to build my script.

 

I think this function is what i want :

Function SetActorOwner(ActorBase akActorBase) native

This example seems close to what i want to do :

; Set the player as the owner of the sword (other actors will "steal" it)
SwordProperty.SetActorOwner(Game.GetPlayer().GetActorBase())

But i don't understand how to use it with a targeted object.

 

If someone could give me a hint, i will be very grateful :)

 

 

Link to comment
Share on other sites

What you'll want to do is use Game.GetCurrentCrosshairRef() to pull whatever the player currently has the crossover over. Then you'd run some if/endif blocks to check and make sure it's the kind of reference you want to act on, and then you'd run your change-ownership functions on it. Probably put up a notice to the player to let them know it fired successfully, too.

 

I'm not 100% sure why you'd want to be changing the ownership of crafting stations, though.

Link to comment
Share on other sites

Thank you for your answer, i haven't thought to use crosshair keyword :/

 

I've got the idea to make that because i use mods which require that you pay when you want to use crafting station, it works very well but when crafting station's owner si set incorrectly, PNJs want you to pay to use it too. It is especially unimmersive when it is your home for example.

I think it could works for bed or bedroll too, to let you benefit of certain perk when you sleep in your bed (Ordinator have this kind of perk) which doesn't when you play a nomad playthrough.

 

So it is a kind of compatibility power ;).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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