How do refer to the marker.placeatme(newactor.getactorbase()

Post » Thu Jun 21, 2012 10:45 am

I am using the following in an ObjectReference script


outsidemarker.placeatme(JohnDoe.getactorbase())


How do I the refer to the actor created from JohnDoe ?

for example

JohnDoe.setAV("Aggression", fAggression)

but the actor was created from JohnDoe so what is his or her REFERENCE ?
User avatar
Gemma Woods Illustration
 
Posts: 3356
Joined: Sun Jun 18, 2006 8:48 pm

Post » Thu Jun 21, 2012 10:22 pm

ObjectReference JohnDoeRef = OutsideMarker.PlaceAtMe(JohnDoe.GetActorBase())

(JohnDoeRef as Actor).SetAV("Aggression", fAggression)



if you need to hold JohnDoeRef as persistent for future script actions, you will need to declare it as a ObjectReference Property set initially to None then JohnDoeRef = PlaceAtMe... etc because the code above is using a temporary variable JohnDoeRef, in which the value will be gone once the script function is done (you wont be able to refer to it in the future if need be, but it will also release persistence for the created reference).
User avatar
jenny goodwin
 
Posts: 3461
Joined: Wed Sep 13, 2006 4:57 am

Post » Thu Jun 21, 2012 9:07 pm

Awesome!
User avatar
ijohnnny
 
Posts: 3412
Joined: Sun Oct 22, 2006 12:15 am


Return to V - Skyrim