Object Window->Actors->Actor->Player -- that's the player base actor, you can attach a script to that. Or you can create a quest, make a ReferenceAlias and use Force Fill to point directly to the player reference (select any cell and you'll see the Player in the reference list). Then attach a script to that alias.
So if my quest script includes an "OnEnterBleedout" event and there is a referencealias for the Player within the script, will it run properly?
I'm testing this within my mod and I can't seem to get it to work properly.
(I have an alias set up as you instructed within the quest, and I have declared the property within the script.)
This is my code:
Event OnInit() Player = Player_Alias.GetActorReference()EndEventEvent OnEnterBleedOut() Debug.Messagebox("This is actually running.") If Player.GetAV("health") < 1 Debug.Messagebox("You Died.") Player.Resurrect() Player.SetAV("Health", 10) Game.ForceFirstPerson() Player.Moveto(LichDeathMarker) Endif EndEventFunction MakePlayerEssential() Player.GetActorBase().SetEssential()EndFunctionReferenceAlias Property Player_Alias AutoActor Property Player AutoI have manually set the Player_Alias property to the Alias I created within the quest too. When using this code, there are no errors, but it does not run properly. It seems as though the Player actor isn't actually pointing to the player, and anything applied to it does absolutely nothing (However if I use Player = Game.GetPlayer() it works just fine)
Additionally, when testing the code and setting Player to Game.GetPlayer() I was able to make the PC Essential, but he never stands up after being "killed" (Is that normal?), and the code for the OnEnterBleedout event never runs.