CylonSurfer Posted January 24, 2019 Share Posted January 24, 2019 (edited) So I need to force the player into a suit of power armor during an event in my mods quest script. I have the Power Armor suit stored as a quest alias and I'm able to call its object ref at any time and run other actions on it fine. For example, I can successfully run 'Player.SwitchToPowerArmor(MyPAQuestAlias)' which immediately snaps the player into the power armor which on the surface appeared to work just fine as the switch takes place during a 'Game.FadeOutGame()'. However during further testing I discovered that 'SwitchToPowerArmor' has some undesirable side effects if run on the player, such as on occassion causing the PA HUD to not display correctly until the player manually exits and then manually enters the Power Armor again. Due to the issues with 'SwitchToPowerArmor' I've been testing other ways to force the player into the PA but have been unable to get anything working. What I've tried: Player.SwitchToPowerArmor(MyPAQuestAlias) - Bugged PA HUDPlayer.MoveTo(MyPAQuestAlias) - Player moves to PA ending up inside the frame furniture but not activating it. Player control is disabled and non recoverable.MyPAQuestAlias.Activate(Player) - Does nothing at all. The PA does not activate. Player.SnapIntoInteraction(MyPAQuestAlias) - Results are the same as Player.MoveTo(MyPAQuestAlias) I'm kinda running out of ideas... I really need the player to run a normal activation on the Power Armor furniture in question but 'Active()' seems like it doesn't work. One thing I pondered was adding a perk to the player which would change the PA default activate to 'immediate' but I'm really not sure if you can change a detault activation to immediate like you can with additional entry points. I'm not sure if anyone has tried that before. Any way, I'm really looking for any suggestions or advice as to how I may achieve this or if I've missed something which would cause 'Activate()' to not work on a PA furniture object. Cheers all! Edited January 24, 2019 by CylonSurfer Link to comment Share on other sites More sharing options...
SKKmods Posted January 24, 2019 Share Posted January 24, 2019 Transferring in from the reddit thread, looks like you have whacked-all-the-moles I am aware of, so cant suggest anything else :( Holdon, as a workaround to the PA HUD imagespace, try using some ninja from the BOS101 Danse puts on his PA helmet scripts. Start with no helmet on the the PA frame, when the player event OnSit() fires do something like: RegisterForAnimationEvent(Game.GetPlayer(),"EquipHelmet") Game.GetPlayer().AddItem(thePAHelmentType) Game.GetPlayer().PlayIdle(IdleEquipHelmet) Game.GetPlayer().EquipItem(thePAHelmentType) ;; dunno if the idle does this Event OnAnimationEvent(ObjectReference akSource, string asEventName) If asEventName == "EquipHelmet" UnregisterForAnimationEvent(Game.GetPlayer(),"EquipHelmet") Game.GetPlayer().AttachModToInventoryItem(ArmorPoweredFrame, thePAHelmentType) ;; dunno if this is needed its floating in a debug stage Endif EndEvent Link to comment Share on other sites More sharing options...
CylonSurfer Posted January 25, 2019 Author Share Posted January 25, 2019 (edited) Thanks for the idea, I'll take a look at that over the weekend. I spent a little time running some traces last night and just testing the mod in general. One thing I picked up on is that the mods perk to add an additional entry point to the power armor furniture is stopping companions from being ordered into power armor, they don't even try or say "I can't do that", it's simply like there is no attempt made to enter the PA. The perk has two conditions for it to show the additional activator label: 1. Furniture has the power armor keyword2. That the player is not currently in power armor So by quickly hopping into a PA suit I was able to confirm that while my perks entry point conditions are not met I can order companions into power armor without issue, but when I get out of a PA suit and issue returns due to the entry point being active. So other than having another issue I'm going to have to fix this got me to thinking about this particular problem and I wonder if when I call 'MyPAQuestAlias.Activate(Player)' to force the player into the PA via my quest script (which is called from my entry point fragment), it is actually trying to run the Activate() BUT using the perk entry point activation which is already in use... I'm going to test this later by adding a keyword condition to the perk entry point, something along the lines of 'if the player has myPAkeyword then don't enable the additional activator' and then in my quest script before calling Activate() i'll add the keyword to the player which should in theory disable the additional entry point and (hopefully) cause the power armor to procress Activate() as normal. Of course, nothing is to actually say this will resolve my problem, the PA furniture processing the default activation may still not do what I want it to do... but here's hoping it does! Then of course I'll have to move on to how I block the entry point while ordering companions into power armor to fix that.... Edited January 26, 2019 by CylonSurfer Link to comment Share on other sites More sharing options...
CylonSurfer Posted February 2, 2019 Author Share Posted February 2, 2019 (edited) So I'm still trying to figure this one out, it is really stumping me to be honest. To trace the issue I set up a script monitoring my Power Armor Reference Alias for OnActivate events and firing off a debug messagebox when it gets activated, interestingly enough when I manually activate the power armor suit, my message box fires up and of course the player enters the PA after dismissing it, when I call 'MyQuestPARef.Activate(PlayerRef)' from within my quest script the onactivate event is triggered, I see my debug message box but after dismissing it the player does not enter the PA. This is the case with or without the debug message box in my code. I really cannot figure out what the different is between the player manually activating the power armor or doing the same via a script, clearly the object ref is getting the OnActivate event in both cases... I really could use some help or suggestions for what else I could maybe check for. Edited February 2, 2019 by CylonSurfer Link to comment Share on other sites More sharing options...
SKKmods Posted February 3, 2019 Share Posted February 3, 2019 I have just hit a similar issue with perk injected activate menu option on Settlement Workshops. I would guess we are hitting a default object behaviour which is tied to code in the game engine rather than papyrus scripted. Link to comment Share on other sites More sharing options...
CylonSurfer Posted February 3, 2019 Author Share Posted February 3, 2019 Maybe! Not sure if this one is possible to work around, such a shame as the difference automating the power armor acitvation for the player makes is honestly night and day in my mod. I even rewrote my scripts to deal with the HUD issues 'SwitchToPowerArmor' introduced and was really stoked with the results....well until I ordered a companion into a PA suit and noticed that if I used 'SwitchToPowerArmor' on the player the camera height change wasn't applying so I was only chest height compared to my companion... Not been able to figure any way around that issue either. Meh! Link to comment Share on other sites More sharing options...
Recommended Posts