Get Object Reference by ID

Post » Sun Oct 13, 2013 7:51 am

Hey, guys. I tried googling this but to no avail. Basically, I created a custom Actor in the creation kit. Now, I need to be able to reference him programatically.

For instance, I need to run something like:

Actor myActor = Game.getActorById(myActorID);

Actor.setPositionX = 1;

Actor.setPositionY = 2;

Actor.setPositionZ = 3;

Any suggestions?

User avatar
Paula Rose
 
Posts: 3305
Joined: Fri Feb 16, 2007 8:12 am

Post » Sat Oct 12, 2013 9:31 pm

You can use a property. Declare the following in your script and then compile:

Actor Property myActor Auto

Then open the Properties Window for the script and select the actor you want from the drop down list when you select the myActor property.

You can then call functions on the actor:

Float fSmithingSkill = myActor.GetActorValue("Smithing")
User avatar
Philip Rua
 
Posts: 3348
Joined: Sun May 06, 2007 11:53 am


Return to V - Skyrim