Background for Skyrim SE
Member of the ObjectReference script
ActorfunctionPlaceActorAtMe(ActorBaseakActorToPlace, intaiLevelMod=4, EncounterZoneakZone=NONE)Native

Description

Wiki Description

Places a new Actor at this object's location.

Documentation Comment

Create an actor at this object's location. Level mod is one of the following:
0 - Easy
1 - Medium
2 - Hard
3 - Boss
4 - None


Caveats

CK Wiki - Notes

  • A common mistake with PlaceActorAtMe is passing an object of type Actor as its akActorToPlace parameter. Attempting to do so will result in this compilation error:

    type mismatch on parameter 1 (did you forget a cast?)
    

    This is the same error as you would see if you were to use an ObjectReference as the first parameter of ObjectReference.PlaceAtMe(...), which should be of type Form.

    The first parameter of PlaceActorAtMe should be of type ActorBase. If you need to get an ActorBase from an Actor, use the ObjectReference.GetBaseObject() function.

    Actor Property MyActor Auto
    ActorBase MyActorBase
    
    Event OnInit()
        MyActorBase = MyActor.GetBaseObject() as ActorBase
    EndEvent
    
    ; ...
        PlaceActorAtMe(MyActorBase)
    ; ...
    

    GetBaseObject returns an object of type Form, which is the parent of ActorBase, so if you need to use any functions or properties defined in the ActorBase script make sure to cast the object before using it.

    Note that Actor.GetActorBase() can be used as shorthand for GetBaseObject when you're expecting an ActorBase:

    MyActorBase = MyActor.GetBaseObject() as ActorBase ; Is functionally equivalent to...
    MyActorBase = MyActor.GetActorBase()
    

    However, this shorthand function is the slower option and therefore not recommended.


Parameters

ActorBaseakActorToPlace

CK Wiki Description

The ActorBase to base the new actor on.

intaiLevelMod=4

CK Wiki Description

The level modifier to use.

  • Must be one of the following:* 0:Easy

    • 1:Medium
    • 2:Hard
    • 3:Boss
    • 4:None
  • Default:4

EncounterZoneakZone=NONE

CK Wiki Description

The EncounterZone to use when placing the new actor.

  • Default:None

Examples

; Place a new wolf at this location - and have it attack the player
MarkerProperty.PlaceActorAtMe(WolfBaseProperty).StartCombat(Game.GetPlayer())
; Place a new boss bear at this location
MarkerProperty.PlaceActorAtMe(BearBaseProperty, 3)

Auto-Generated Example

ActorBase myActorBase__akActorToPlace
int myInt__aiLevelMod
EncounterZone myEncounterZone__akZone

Actor returnedValue = myObjectReference__toCallFunctionOn.PlaceActorAtMe(myActorBase__akActorToPlace, myInt__aiLevelMod, myEncounterZone__akZone)

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.