Search the Community
Showing results for tags 'alias'.
-
I run into a new issue (whatelse ) I was never aware of. My scripting knowledge is very limited and here I'm not sure what the OnInit function really does. I know that OnInit fires twice, tested that with a messagebox. The script is about follower mounting, when player mounts his horse or whatever: scriptName _RubyPlayerMountMonitorScript extends ReferenceAlias ;-- Properties -------------------------------------- actor property Ruby auto visualeffect property Effect auto faction property CurrentFollowerFaction auto actor property PlayerRef auto actor property Assan auto ;-- Variables --------------------------------------- actor Player ;-- Functions --------------------------------------- ; Skipped compiler generated GotoState ; Skipped compiler generated GetState function FollowerMount(actor myFollower, actor myHorse, String asEventName, Float afTime) form EquippedItemLeft = PlayerRef.GetEquippedObject(0) form EquippedItemRight = PlayerRef.GetEquippedObject(1) if myFollower.IsInFaction(CurrentFollowerFaction) == 1 as Bool if myFollower.GetActorValue("WaitingForPlayer") == 0 as Float if EquippedItemLeft as Bool || EquippedItemRight as Bool if asEventName == "tailHorseMount" debug.SendAnimationEvent(Ruby as objectreference, "IdleForceDefaultState") myFollower.OnAnimationEvent(none, "tailHorseMount") Effect.play(myHorse as objectreference, 0.300000, none) myHorse.MoveTo(myFollower as objectreference, 50.0000 * math.sin(myFollower.GetAngleZ() + 90.0000), 50.0000 * math.cos(myFollower.GetAngleZ() + 90.0000), 0.000000, true) utility.Wait(0.100000) myFollower.SetAnimationVariableBool("bIsRiding", 1 as Bool) myFollower.EvaluatePackage() endIf if asEventName == "tailHorseDismount" Bool dismountInitiated = myFollower.Dismount() myFollower.SetAnimationVariableBool("bIsRiding", 0 as Bool) myFollower.EvaluatePackage() endIf else return endIf endIf endIf endFunction function OnInit() ; Debug.Messagebox("Script running") utility.Wait(5.00000) Player = game.GetPlayer() self.RegisterForAnimationEvent(PlayerRef as objectreference, "tailHorseMount") self.RegisterForAnimationEvent(PlayerRef as objectreference, "tailHorseDismount") endFunction function OnAnimationEvent(objectreference akSource, String asEventName) if akSource == PlayerRef as objectreference self.FollowerMount(Ruby, Assan, asEventName, 0.300000) else return endIf endFunction This script is attached to the alias of my follower Ruby in a script started quest. It works very good. With Alternate Start from Arthmoor activated. With only vanilla Skyrim it works very good. Until I open racemenu with the console and change my character. After closing racemenu, script is no longer working. I tested without MO. I tested without changing character, saved the game, shut down, load the game and the save and script runs fine. So it must have to do with racemenu (not the mod racemenu! I don't use). I tested on a start enabled quest. Same result, script stops working. What happens here and what can I do to make that work? And a second problem occurs: I wrote my playerhorse now follows fine again, but that is only partially true, like I just now discovered. It works fine if I use Alternate Start. When I use only vanilla Skyrim, the NPC walks away as soon as I tell her to wait. The horse stays, like she should. A script changes the wait globalvariable to 1, package stack is evaluated for horse and npc and the stay package has the wait globalvariable set as condition as well as a quest stage set. There is no package everywhere that could fire in this quest stage. Why does it work with Alternate Start? And not with vanilla? It's really tiring. Your suggestions are much appreciated. Update: Playerhorse now behaves correctly. CK didn't save my property and I overlooked it.