Jump to content

SetActorOwner problem


ZZhukov

Recommended Posts

I have a problem compilating a tiny script fragmet, but I can't figure out what I'm doing wrong. I'm trying to change the owner of a cell within a quest and all I got is this outcome:

Starting 1 compile threads for 1 files...
Compiling "ZZZ_DummyQuest_02000D62"...
D:\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\ZZZ_DummyQuest_02000D62.psc(20,10): SetActorOwner is not a function or does not exist
No output generated for ZZZ_DummyQuest_02000D62, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on ZZZ_DummyQuest_02000D62

The script is in a quest stage, and is just as simple as this:

Alias_Cell.SetActorOwner(none)

Nothing more, nothing less. The alias points to a Location Alias.

 

What am I missing?

Link to comment
Share on other sites

That is because neither LocationAlias or Location have a function named SetActorOwner()

In order to get a cell in script you need an ObjectReference to something in the game world such as an Actor.

 

So if I follow the reference correctly your fragment should be closer to this..

	Cell myCell = Game.GetPlayer().GetParentCell()
	myCell.SetActorOwner(Game.GetPlayer().GetActorBase())
Link to comment
Share on other sites

Ok, that's useful. Thanks!

 

 

Solved, using an object in the cell:

Cell myCell = Alias_Axe.GetReference().GetParentCell()
myCell.SetActorOwner(Game.GetPlayer().GetActorBase())
Edited by ZZhukov
Link to comment
Share on other sites

I do think anything can be an objectReference. Try adding/filling an alias to any old thing and use get ref. Not sure I remember the quirks of quest fragments but it should be something like this.

ReferenceAlias property MyContainer  Auto

Function MyBodyIsAFragment()
	ObjectReference containerRef = MyContainer.GetReference()
	Cell myCell = containerRef.GetParentCell()
	myCell.SetActorOwner(Game.GetPlayer().GetActorBase())
EndFunction 
edit: LOL you ninja posted me!
Link to comment
Share on other sites

  • Recently Browsing   0 members

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