Jump to content

[LE] SetPosition Actor Script Equivalent


Recommended Posts

Hi all I am trying to make a script that places an item at an actor when he is killed. The problem I have is the item is placed too low (inside the dead body mesh). So the player cant pick up the item. I need the item to be placed higher than the body. How do I use SetPosition within an actor script?? This is the script I have that wont compile:

Scriptname MWHSDarkSoulDeathScript extends Actor  

Activator Property SummonFX Auto

Activator Property DSL Auto

Event OnDying(Actor akKiller)
	Self.PlaceAtMe(SummonFX)
	Self.PlaceAtMe(DSL)
	DSL.SetPosition(0, 0, 10)
EndEvent

Can anyone help me with this cant find any solution on the CK website

Link to comment
Share on other sites

You aren't quite grasping how the script object tree works. Your problem isn't that you're trying to use it within an Actor script; your problem is that you're trying to use it on an activator, which, as a base form type, doesn't exist in the world and thus has no position. SetPosition() can only be run on ObjectReferences.

 

PlaceAtMe will return the ObjectReference it created. You then need to call SetPosition *on that*.

 

Fortunately it's a very simple tweak:

 

 

Scriptname MWHSDarkSoulDeathScript extends Actor 

Activator Property SummonFX Auto

Activator Property DSL Auto

Event OnDying(Actor akKiller)
    Self.PlaceAtMe(SummonFX)
    ObjectReference DSLRef = Self.PlaceAtMe(DSL)
    DSLRef.SetPosition(0, 0, 10)
EndEvent
Link to comment
Share on other sites

Hey Thanks for the reply but I got around it by attaching a different script to the actor that makes the player absorb the Dark Soul instead. I will remember that for next time though.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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