Difference between revisions of "Actor Script"
Jump to navigation
Jump to search
Added two new Sections to clarify that certain functions/events only work with Skyrim Special Edition.
imported>Jlundin (→Events: Adding links to SSE 1.5.3 events) |
imported>Texashokies (Added two new Sections to clarify that certain functions/events only work with Skyrim Special Edition.) |
||
Line 114: | Line 114: | ||
'''Float [[GetActorValue - Actor|GetActorValue]](String ''asValueName'')''' | '''Float [[GetActorValue - Actor|GetActorValue]](String ''asValueName'')''' | ||
*Retrieves the specified actor value from the actor. | *Retrieves the specified actor value from the actor. | ||
'''Float [[GetActorValuePercentage - Actor|GetActorValuePercentage]](String ''asValueName'')''' | '''Float [[GetActorValuePercentage - Actor|GetActorValuePercentage]](String ''asValueName'')''' | ||
Line 123: | Line 120: | ||
'''Float [[GetActorValue - Actor|GetAV]](String ''asValueName'')''' | '''Float [[GetActorValue - Actor|GetAV]](String ''asValueName'')''' | ||
*Alias for GetActorValue(). | *Alias for GetActorValue(). | ||
'''Float [[GetActorValuePercentage - Actor|GetAVPercentage]](String ''asValueName'')''' | '''Float [[GetActorValuePercentage - Actor|GetAVPercentage]](String ''asValueName'')''' | ||
Line 219: | Line 213: | ||
'''Int [[GetSleepState - Actor|GetSleepState]]()''' | '''Int [[GetSleepState - Actor|GetSleepState]]()''' | ||
*Obtains this actor's sleep state. | *Obtains this actor's sleep state. | ||
'''Float [[GetVoiceRecoveryTime - Actor|GetVoiceRecoveryTime]]()''' | '''Float [[GetVoiceRecoveryTime - Actor|GetVoiceRecoveryTime]]()''' | ||
Line 321: | Line 312: | ||
'''Bool [[IsOnMount - Actor|IsOnMount]]()''' | '''Bool [[IsOnMount - Actor|IsOnMount]]()''' | ||
*Is the actor on a mount? | *Is the actor on a mount? | ||
'''Bool [[IsPlayersLastRiddenHorse - Actor|IsPlayersLastRiddenHorse]]()''' | '''Bool [[IsPlayersLastRiddenHorse - Actor|IsPlayersLastRiddenHorse]]()''' | ||
Line 420: | Line 408: | ||
'''[[SendAssaultAlarm - Actor|SendAssaultAlarm]]()''' | '''[[SendAssaultAlarm - Actor|SendAssaultAlarm]]()''' | ||
*Has this actor behave as if they were assaulted. | *Has this actor behave as if they were assaulted. | ||
'''[[SendTrespassAlarm - Actor|SendTrespassAlarm]](Actor ''akCriminal'')''' | '''[[SendTrespassAlarm - Actor|SendTrespassAlarm]](Actor ''akCriminal'')''' | ||
*Has this actor behave as if they caught the criminal trespassing | *Has this actor behave as if they caught the criminal trespassing | ||
'''[[SetActorValue - Actor|SetActorValue]](String ''asValueName'', Float ''afValue'')''' | '''[[SetActorValue - Actor|SetActorValue]](String ''asValueName'', Float ''afValue'')''' | ||
Line 582: | Line 564: | ||
'''Bool [[WornHasKeyword - Actor|WornHasKeyword]](Keyword ''akKeyword'')''' | '''Bool [[WornHasKeyword - Actor|WornHasKeyword]](Keyword ''akKeyword'')''' | ||
*Returns whether or not this actor is wearing anything with the specified keyword. | *Returns whether or not this actor is wearing anything with the specified keyword. | ||
== Special Edition Exclusive Functions == | |||
'''Bool [[IsOverEncumbered - Actor|IsOverEncumbered]]()''' | |||
*Is the actor currently over-encumbered? | |||
'''Float [[GetActorValueMax - Actor|GetActorValueMax]](String ''asValueName'')''' | |||
*Retrieves the specified actor value's maximum value - taking into account buffs and debuffs. | |||
'''Float [[GetActorValueMax - Actor|GetAVMax]](String ''asValueName'')''' | |||
*Alias for GetActorValueMax(). | |||
'''Float [[GetWarmthRating - Actor|GetWarmthRating]]()''' | |||
*Obtains the total "warmth rating" for the actor | |||
'''[[SendLycanthropyStateChanged - Actor|SendLycanthropyStateChanged]](Bool ''abIsWerewolf'')''' | |||
*Tells anyone who cares that the lycanthropy state of this actor has changed | |||
'''[[SendVampirismStateChanged - Actor|SendVampirismStateChanged]](bool ''abIsVampire'')''' | |||
*Tells anyone who cares that the vampirism state of this actor has changed | |||
== SKSE Member Functions == | == SKSE Member Functions == | ||
Line 657: | Line 659: | ||
'''[[OnLocationChange - Actor|OnLocationChange]](Location ''akOldLoc'', Location ''akNewLoc'')''' | '''[[OnLocationChange - Actor|OnLocationChange]](Location ''akOldLoc'', Location ''akNewLoc'')''' | ||
*Event received when the actor moves from one location to another. | *Event received when the actor moves from one location to another. | ||
'''[[OnObjectEquipped - Actor|OnObjectEquipped]](Form ''akBaseObject'', ObjectReference ''akReference'')''' | '''[[OnObjectEquipped - Actor|OnObjectEquipped]](Form ''akBaseObject'', ObjectReference ''akReference'')''' | ||
Line 681: | Line 680: | ||
'''[[OnPlayerLoadGame - Actor|OnPlayerLoadGame]]()''' | '''[[OnPlayerLoadGame - Actor|OnPlayerLoadGame]]()''' | ||
*Event received by the player actor when a saved game is loaded. | *Event received by the player actor when a saved game is loaded. | ||
'''[[OnRaceSwitchComplete - Actor|OnRaceSwitchComplete]]()''' | '''[[OnRaceSwitchComplete - Actor|OnRaceSwitchComplete]]()''' | ||
Line 691: | Line 687: | ||
*Event received when this actor sits on the specified furniture. | *Event received when this actor sits on the specified furniture. | ||
'''[[ | == Special Edition Exclusive Events == | ||
*Event received when this actor | |||
'''[[OnLycanthropyStateChanged - Actor|OnLycanthropyStateChanged]](Bool ''abIsWerewolf'')''' | |||
*Event received when the lycanthropy state of this actor changes | |||
'''[[OnPlayerFastTravelEnd - Actor|OnPlayerFastTravelEnd]](Float ''afTravelGameTimeHours'')''' | |||
*Event received when the player finishes fast travel. | |||
'''[[OnVampirismStateChanged - Actor|OnVampirismStateChanged]](bool ''abIsVampire'')''' | '''[[OnVampirismStateChanged - Actor|OnVampirismStateChanged]](bool ''abIsVampire'')''' | ||
*Event received when the vampirism state of this actor changes | *Event received when the vampirism state of this actor changes | ||
'''[[OnVampireFeed - Actor|OnVampireFeed]](Actor ''akTarget'')''' | |||
*Event received when this actor feeds on another, as a vampire | |||
== Notes == | == 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. | * 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. | ** 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. |