Actor Script

Revision as of 04:31, 16 March 2013 by imported>KaXaK


Extends: ObjectReference Script

Script for the manipulation of actor instances.

Definition

ScriptName Actor extends ObjectReference

Properties

None

Global Functions

None

Member Functions

Function AddPerk(Perk akPerk)

  • Adds the specified perk to this actor.

bool Function AddShout(Shout akShout)

  • Adds the specified shout to this actor.

bool Function AddSpell(Spell akSpell, bool abVerbose)

  • Adds the specified spell to this actor.

Function AddToFaction(Faction akFaction)

  • Adds the actor to the specified faction at rank 0. If the Actor is already in the given faction, this function does nothing.

Function AllowBleedoutDialogue(bool abCanTalk)

  • Flags this actor as able to speak to the player when he is in bleed out and is essential down

Function AllowPCDialogue(bool abTalk)

  • Enables or disables the player's ability to talk to this actor.

Function AttachAshPile(Form akAshPileBase)

  • Attaches an "ash pile" to this actor using the passed-in form (or leveled item list) as a base.

bool Function CanFlyHere()

  • Can this actor fly here?

Function ClearArrested()

  • Clears this actor's arrested state.

Function ClearExpressionOverride()

  • Clears any expression override on this actor.

Function ClearExtraArrows()

  • Clears any arrow 3d on the actor.

Function ClearForcedLandingMarker()

  • Clears any forced landing marker on this actor.

Function ClearKeepOffsetFromActor()

  • Clears any keep offset from this actor.

Function ClearLookAt()

  • Clears this actor's script-forced look at target.

Function DamageActorValue(string asValueName, float afDamage)

  • Damages the specified actor value by the specified amount.

Function DamageAV(string asValueName, float afDamage)

  • Alias for DamageActorValue().

bool Function Dismount()

  • Forces the actor to dismount.

Function DispelAllSpells() native

  • Dispel all spell from this actor

bool Function DispelSpell(Spell akSpell) native

  • Dispel a spell from this actor

Function DoCombatSpellApply(Spell akSpell, ObjectReference akTarget) native

  • Apply a spell to a target in combat

Function DrawWeapon()

  • Forces this actor to draw his weapon

Function EnableAI(bool abEnable)

  • Enables or disables this actor's AI.

Function EndDeferredKill()

  • Removes the actor from a Deferred Kill state.

Function EquipItem(Form akItem, bool abPreventRemoval, bool abSlient)

  • Equips the specified item on this actor.

Function EquipShout(Shout akShout)

  • Forces this actor to equip this shout.

Function EquipSpell(Spell akSpell, int aiSource)

  • Forces this actor to equip thes spell, in the specified source.

Function EvaluatePackage()

  • Forces the AI to re-evaluate its package stack.

Function ForceActorValue(string asValueName, float afNewValue)

  • Forces the specified actor value to the specified value.

Function ForceAV(string asValueName, float afNewValue)

  • Alias for ForceActorValue().

ActorBase Function GetActorBase()

  • Returns the base actor object for this actor.

float Function GetActorValue(string asValueName)

  • Retrieves the specified actor value from the actor.

float Function GetActorValuePercentage(string asValueName)

  • Retrieves the specified actor value from the actor as a percentage of its maximum value. (From 0 to 1)

float Function GetAV(string asValueName)

  • Alias for GetActorValue().

float Function GetAVPercentage(string asValueName)

  • Alias for GetActorValuePercentage().

float Function GetBaseActorValue(string asValueName)

  • Gets the base value of the specified actor value.

float Function GetBaseAV(string asValueName)

  • Alias for GetBaseActorValue().

int Function GetBribeAmount()

  • Returns the amount of gold required to bribe this actor.

Faction Function GetCrimeFaction()

  • Obtains this actor's crime faction.

int Function GetCombatState()

  • Obtains this actor's current combat state.

Actor Function GetCombatTarget()

  • Obtains this actor's current combat target.

Package Function GetCurrentPackage()

  • Obtains the current package this actor's AI is running.

Actor Function GetDialogueTarget()

  • Obtains the actor's current dialogue target

int Function GetEquippedItemType(int aiHand)

  • Obtains the type of item equipped in the specified hand.

Armor Function GetEquippedShield()

  • Obtains the currently equipped shield on this actor.

Shout Function GetEquippedShout()

  • Obtains the currently equipped shout on this actor.

Spell Function GetEquippedSpell(int aiSource)

  • Obtains the currently equipped spell in the specified source on this actor.

Weapon Function GetEquippedWeapon(bool abLeftHand)

  • Obtains the currently equipped weapon on this actor.

int Function GetFactionRank(Faction akFaction)

  • Retrieves this actor's rank in the specified faction.

int Function GetFactionReaction(Actor akOther)

  • Obtains this actor's faction-based reaction to the other actor.

int Function GetFlyingState()

  • Obtains this actor's current flying state.

ObjectReference Function GetForcedLandingMarker()

  • Obtains the landing marker the actor is forced to land at (if any).

int Function GetGoldAmount()

  • Gets the amount of gold this actor has on his person.

int Function GetHighestRelationshipRank()

  • Gets this actor's highest relationship rank.

Actor Function GetKiller()

  • Gets this actor's killer. Returns None if this actor isn't dead.

int Function GetLevel() native

  • Gets this actor's current level.

ActorBase Function GetLeveledActorBase()

  • Returns a leveled actor's "temporary" base object.

float Function GetLightLevel()

  • Returns this actor's current light level

int Function GetLowestRelationshipRank()

  • Gets this actor's lowest relationship rank.

bool Function GetNoBleedoutRecovery()

  • Gets whether this actor can recover from bleedout or not.

bool Function GetPlayerControls() native

  • Queries whether this actor receives player input

Race Function GetRace()

  • Returns this actor's race.

int Function GetRelationshipRank(Actor akOther)

  • Retrieves the relationship rank between this actor and another.

int Function GetSitState()

  • Obtains this actor's sit state.

int Function GetSleepState()

  • Obtains this actor's sleep state.

float Function GetVoiceRecoveryTime()

  • Gets the voice recovery time from the actor.

bool Function HasAssociation(AssociationType akAssociation, Actor akOther)

  • Returns whether this actor has the specified association with the other actor.

bool Function HasFamilyRelationship(Actor akOther)

  • Returns whether this actor has a family relationship with the other actor.

bool Function HasLOS(ObjectReference akOther)

  • Checks to see if this actor has line-of-sight to another. (Only the player can do a LOS check to a non-actor)

bool Function HasMagicEffect(MagicEffect akEffect)

  • Checks to see if this actor is currently being affected by the given Magic Effect

bool Function HasMagicEffectWithKeyword(Keyword akKeyword)

  • Checks to see if this actor is currently being affected by a Magic Effect with the given Keyword

bool Function HasParentRelationship(Actor akOther)

  • Returns whether this actor has a parent relationship with the other actor.

bool Function HasPerk(Perk akPerk)

  • Checks to see if this actor has the given Perk

bool Function HasSpell(Form akForm)

  • Checks to see if this actor has the given Spell or Shout

bool Function IsAlarmed()

  • Obtains whether this actor is alarmed or not.

bool Function IsAlerted()

  • Returns if this actor is alerted or not.

bool Function IsAllowedToFly()

  • Is this actor allowed to fly?

bool Function IsArrested()

  • Returns whether this actor is currently arrested or not.

bool Function IsArrestingTarget()

  • Is this actor currently arresting his target? Only valid on alerted guards.

bool Function IsBeingRidden()

  • Is this actor being ridden?

bool Function IsBleedingOut()

  • Is this actor currently bleeding out?

bool Function IsBribed()

  • Gets if this actor has been bribed by the player.

bool Function IsChild()

  • Is this actor a child?

bool Function IsCommandedActor()

  • Is this actor commanded by another?

bool Function IsDead()

  • Obtains whether this actor is dead or not.

bool Function IsDetectedBy(Actor akOther)

  • Is this actor detected by the other one?

bool Function IsDoingFavor()

  • Is this actor currently flagged as doing a favor for the player?

bool Function IsEquipped(Form akItem)

  • Is the specified object equipped on this actor?

bool Function IsEssential()

  • Is this actor essential?

bool Function IsFlying()

  • Is this actor currently flying?

bool Function IsGhost()

  • Is this actor flagged as a ghost?

bool Function IsGuard()

  • Obtains whether this actor is a guard or not.

bool Function IsHostileToActor(Actor akActor)

  • Is this actor hostile to another actor?

bool Function IsInCombat()

  • Obtains whether this actor is in combat or not.

bool Function IsInFaction(Faction akFaction)

  • Returns whether this actor is in the specified faction.

bool Function IsInKillMove()

  • Returns whether this actor is in a kill move or not.

bool Function IsIntimidated()

  • Gets if this actor has been intimidated by the player.

bool Function IsOnMount()

  • Is the actor on a mount?

bool Function IsPlayersLastRiddenHorse()

  • Returns whether this actor is the horse the player last rode.

bool Function IsPlayerTeammate()

  • Returns whether this actor is currently a teammate of the player.

bool Function IsRunning()

  • Returns whether this actor is current running.

bool Function IsSneaking()

  • Is this actor currently sneaking?

bool Function IsSprinting()

  • Is this actor currently sprinting?

bool Function IsTrespassing()

  • Returns whether this actor is currently trespassing or not.

bool Function IsUnconscious()

  • Is this actor currently unconscious?

bool Function IsWeaponDrawn()

  • Does this actor have his equipped weapon and/or magic spell drawn?

Function KeepOffsetFromActor(Actor arTarget, float afOffsetX, float afOffsetY, float afOffsetZ, float afOffsetAngleX, float afOffsetAngleY, float afOffsetAngleZ, float afCatchUpRadius, float afFollowRadius)

  • Makes the actor switch to a state where it will try to keep a given offset from another actor

Function Kill(Actor akKiller)

  • Kills this actor with the specified actor as the guilty party.

Function KillEssential(Actor akKiller)

  • Kills this actor, even if he is essential.

Function KillSilent(Actor akKiller)

  • Kills this actor without a kill event with the killer being the guilty party

Function MakePlayerFriend()

  • Makes the actor a friend of the player.

Function ModActorValue(string asValueName, float afAmount)

  • Modifies the specified actor value by the specified amount.

Function ModAV(string asValueName, float afAmount)

  • Alias for ModActorValue().

Function ModFactionRank(Faction akFaction, int aiMod)

  • Modifies this actor's rank in the specified faction.

Function MoveToPackageLocation()

  • Pops this actor to the initial location for its current package.

Function OpenInventory(bool abForceOpen)

  • Opens this actor's inventory as if you were pick-pocketing them.

bool Function PathToReference(ObjectReference aTarget, float afWalkRunPercent)

  • Makes the actor path to the target reference at the speed given by afWalkRunercent.

bool Function PlayIdle(Idle akIdle)

  • Plays the passed idle on this actor.

bool Function PlayIdleWithTarget(Idle akIdle, ObjectReference akTarget)

  • Plays the passed idle on this actor, overriding the actor's current target with the one given.

Function PlaySubGraphAnimation(string asEventName)

  • Sends the event passed to the actor's sub graphs.

Function RemoveFromFaction(Faction akFaction)

  • Removes this actor from the specified faction.

Function RemoveFromAllFactions()

  • Removes this actor from all factions they are associated with.

Function RemovePerk(Perk akPerk)

  • Removes the specified perk from this actor.

bool Function RemoveShout(Shout akShout)

  • Removes the specified shout from this actor.

bool Function RemoveSpell(Spell akSpell)

  • Removes the specified spell from this actor.

Function ResetHealthAndLimbs()

  • Resets this actor's health and limb state.

Function RestoreActorValue(string asValueName, float afAmount)

  • Restores damage done to the specified actor value.

Function RestoreAV(string asValueName, float afAmount)

  • Alias for RestoreActorValue().

Function Resurrect()

  • Resurrects this actor.

Function SendAssaultAlarm()

  • Has this actor behave as if they were assaulted.

Function SendTrespassAlarm(Actor akCriminal)

  • Has this actor behave as if they caught the criminal trespassing

Function SetActorValue(string asValueName, float afValue)

  • Sets the specified actor value on the actor to the passed-in value.

Function SetAlert(bool abAlerted)

  • Flags this actor as currently alerted (or clears it)

Function SetAllowFlying(bool abAllowed)

  • Flags this actor as whether they are allowed to fly or not (lands them if they are flying and not allowed to)

Function SetAllowFlyingEx(bool abAllowed, bool abAllowCrash, bool abAllowSearch)

  • Sets whether this actor is allowed to fly or not. If not, and they are flying, will land the actor.

Function SetAlpha(float afTargetAlpha, bool abFade)

  • Sets this actor's alpha - optionally fading to that value rather then popping.

Function SetAttackActorOnSight(bool abAttackOnSight)

  • Flags this actor to be attacked by all actors when detected.

Function SetAV(string asValueName, float afValue)

  • Alias for SetActorValue().

Function SetBribed(bool abBribe)

  • Sets if this actor is being bribed by the player.

Function SetCrimeFaction(Faction akFaction)

  • Sets the faction that this actor reports crimes to.

Function SetCriticalStage(int aiStage)

  • Sets this actor's current critical stage (applying any related effects)

Function SetDoingFavor(bool abDoingFavor)

  • Flags this actor as doing a favor for the player.

Function SetDontMove(bool abDontMove)

  • Flags/unflags this actor as "don't move".

Function SetExpressionOverride(int aiMood, int aiStrength)

  • Sets an expression override on this actor.

Function SetEyeTexture(TextureSet akTexture)

  • Forces a new eye texture on the actor.

Function SetFactionRank(Faction akFaction, int aiRank)

  • Sets this actor's rank in the specified faction, adding it to the faction if necessary.

Function SetForcedLandingMarker(ObjectReference aMarker)

  • Forces the landing marker for this actor to the passed-in one.

Function SetGhost(bool abIsGhost)

  • Sets this actor as a ghost or not.

Function SetHeadTracking(bool abEnable)

  • Enables or disables this actor's head tracking.

Function SetIntimidated(bool abIntimidate)

  • Sets if this actor is being intimidated by the player.

Function SetLookAt(ObjectReference akTarget, bool abPathingLookAt)

  • Sets this actor's look at target, optionally using it for pathing as well.

Function SetNoBleedoutRecovery(bool abAllowed)

  • Sets or clears the "no bleedout recovery" flag on this actor.

Function SetNotShowOnStealthMeter(bool abNotShow)

  • Sets this actor to not effect the detection level on the stealth meter if he is not hostile to the player

Function SetOutfit(Outfit akOutfit,bool abSleepOutfit)

  • Change the default or sleep outfit and queue the models to be worn now.

Function SetPlayerControls(bool abControls)

  • Set/reset whether player input being sent to the actor.

Function SetPlayerResistingArrest()

  • Flags the player as resisting arrest from this actor's faction.

Function SetPlayerTeammate(bool abTeammate, bool abCanDoFavor)

  • Sets (or clears) this actor as a teammate of the player and if the teammate can do favors.

Function SetRace(Race akRace)

  • Sets the actor's race

Function SetRelationshipRank(Actor akOther, int aiRank)

  • Sets the relationship rank between this actor and another.

Function SetRestrained(bool abRestrained)

  • Flags this actor as restrained or not.

Function SetSubGraphFloatVariable(string asVariableName, float afValue)

  • Set a variable on all of an actor's sub graphs.

Function SetUnconscious(bool abIsUnconscious)

  • Sets this actor as unconscious or not.

Function SetVehicle(ObjectReference akVehicle)

  • Attaches or detaches this actor from a vehicle.

Function SetVoiceRecoveryTime(float afTime)

  • Sets the voice recovery time on the actor.

Function ShowBarterMenu()

  • Shows the barter menu for this actor.

Function ShowGiftMenu()

  • Shows the give/take menu for this actor.

Function StartCannibal(Actor akTarget)

  • Has the actor feed on a dead actor.

Function StartCombat(Actor akTarget)

  • Attempts to initiate combat with the other actor.

Function StartDeferredKill()

  • Puts the actor into a Deferred Kill state

Function StartSneaking()

  • Forces this actor to start sneaking.

Function StartVampireFeed(Actor akTarget)

  • Has the actor vampire feed on a sleeping actor

Function StopCombat()

  • Removes this actor from combat.

Function StopCombatAlarm()

  • Stops all combat and alarms against this actor.

bool Function TrapSoul(Actor akTarget)

  • Attempts to soul trap the target actor - and returns if it succeeded or not.

Function UnequipAll()

  • Unequips all items from this actor.

Function UnequipItem(Form akItem, bool abPreventEquip, bool abSilent)

  • Unequips an item from this actor.

Function UnequipItemSlot(int aiSlot)

  • Forces this actor to unequip all armor on the given slot.

Function UnequipShout(Shout akShout)

  • Unequips the specified shout from this actor.

Function UnequipSpell(Spell akSpell, int aiSource)

  • Unequips the specified spell from the specified source on this actor.

Function UnlockOwnedDoorsInCell()

  • Has this actor unlock any doors he owns in the cell he's currently in (if it is an interior).

bool Function WillIntimidateSucceed()

  • Returns whether an intimidation attempt by the player against this actor will succeed or not.

bool Function WornHasKeyword(Keyword akKeyword)

  • Returns whether or not this actor is wearing anything with the specified keyword.

SKSE Member Functions

Form Function GetWornForm(int slotMask)

  • Returns the form of the item worn with the specified slotMask.

Int Function GetSpellCount()

  • Returns the number of added spells for the actor.

Spell Function GetNthSpell(int n)

  • Returns the specified added spell for the actor.

Function QueueNiNodeUpdate()

  • Updates modifications linked to the actor.

Function EquipItemEx(Form item, int equipSlot, bool preventUnequip, bool equipSound)

  • Force equips the specified item to the specified slot.

Function UnequipItemEx(Form item, int equipSlot, bool preventEquip)

  • Force unequips the specified item at the specified slot.

Events

Event OnCombatStateChanged(Actor akTarget, int aeCombatState)

  • Sent when this actor's combat state changes.

Event OnDeath(Actor akKiller)

  • Event received when this actor dies.

Event OnDying(Actor akKiller)

  • Event received when this actor begins to die.

Event OnEnterBleedout()

  • Event received when this object enters bleedout.

Event OnGetUp(ObjectReference akFurniture)

  • Event received when this actor gets up off the specified furniture.

Event OnLocationChange(Location akOldLoc, Location akNewLoc)

  • Event received when the actor moves from one location to another.

Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)

  • Event received when this actor equips an object.

Event OnObjectUnequipped(Form akBaseObject, ObjectReference akReference)

  • Event received when this actor unequips an object.

Event OnPackageChange(Package akOldPackage)

  • Event received when this actor changes away from a package.

Event OnPackageEnd(Package akOldPackage)

  • Event received when this actor ends a package.

Event OnPackageStart(Package akNewPackage)

  • Event received when this actor starts running a new package.

Event OnPlayerBowShot(Weapon akWeapon, Ammo akAmmo, float afPower, bool abSunGazing)

  • Event called when the actor is the player, and the player has fired a bow.

Event OnPlayerLoadGame()

  • Event received by the player actor when a saved game is loaded.

Event OnRaceSwitchComplete()

  • Event received when this actor finishes switching races.

Event OnSit(ObjectReference akFurniture)

  • Event received when this actor sits on the specified furniture.

Notes

  • You may not attach a script to an actor if that actor would be used by a leveled actor list. If an actor is used in a leveled actor list, its "Scripts" section will be disabled.
    • There is a workaround in this in cases where you need actors to be both leveled and scripted - you can create a constant/self magic effect and apply that at the race level. For example, the FXDragonBloodDamageScript handles applying some special blood FX to dragons through combat. Since dragons are used to populate leveled lists, however, we attach this script to AbFXDragonBloodDamage, which is an effect on the AbDragonBloodFX spell. That's then assigned as a special racial ability of the DragonRace. You can look at a similar example in how the WispMothers work, too.