Evan555alpha Posted April 16, 2018 Posted April 16, 2018 So, I'm taking a copy of F4's jetpack effects, and making them in to a perk variant. I've got a proof of concept that works, but I've got a couple of questions about it: Is there any way to override the jetpack sounds? Or is that not possible without overwriting the sound files themselves? Is there any way to override the AP drain? The proof-of-concept version I've got drains all ~200 of my AP in a little over a second. And lastly, though only tangentially related: Is there a way to change facial morphs via script? Like how when certain pieces of dialogue are said, the eyebrows become cross looking, and such. The PoC itself is just a perk which adds an ability which references a duplicated spell, which references a duplicated MGEF. That's all there is to it, really.
AWP3RATOR Posted April 16, 2018 Posted April 16, 2018 3 hours ago, Evan555alpha said: So, I'm taking a copy of F4's jetpack effects, and making them in to a perk variant. I've got a proof of concept that works, but I've got a couple of questions about it: Is there any way to override the jetpack sounds? Or is that not possible without overwriting the sound files themselves? Is there any way to override the AP drain? The proof-of-concept version I've got drains all ~200 of my AP in a little over a second. And lastly, though only tangentially related: Is there a way to change facial morphs via script? Like how when certain pieces of dialogue are said, the eyebrows become cross looking, and such. The PoC itself is just a perk which adds an ability which references a duplicated spell, which references a duplicated MGEF. That's all there is to it, really. For the Jetpack AP drain, I'm using a mod called "Long Use Jetpack" which alters the FLOAT values to 0 - but they can just as easily be made lower, which will still consume AP, but not as quickly as vanilla values. For reference, the settings can be found in FO4Edit, under Game Settings: fJetpackDrainSustained fJetpackTimeToSustained fJetpackDrainInitial
Evan555alpha Posted April 16, 2018 Author Posted April 16, 2018 43 minutes ago, AWP3RATOR said: For reference, the settings can be found in FO4Edit, under Game Settings: fJetpackDrainSustained fJetpackTimeToSustained fJetpackDrainInitial Oof, overwriting vanilla game settings/records is something I don't want to do if it can be avoided. Reckon there'd be a way to do so either by using new game settings, or by not using game settings?
AWP3RATOR Posted April 16, 2018 Posted April 16, 2018 As I was looking up the jetpack sound references, it occurred to me that they are probably scripted. If we can find that script (haven't had luck yet), then these settings are probably called in the same place. I do see the sound descriptor for the jetpack sound in CK - but since it's not directly attached to anything with the PA jetpack, it leads me to assume that it's a scripted event like: Did the player Jump? -Are they wearing a jetpack? --Fire jetpack sound --Play jetpack animations --Drain AP appropriately --etc. If we can find that scripted event, you can override it - and or point it at your custom sound descriptor and AP drain scaling, if the specific jetpack being worn is your special one. Or to not alter the player action scripts at all - you could recreate that with a similar script tied to a ques alias and that checks for your specific jetpack, etc.
Evan555alpha Posted April 16, 2018 Author Posted April 16, 2018 31 minutes ago, AWP3RATOR said: If we can find that scripted event, you can override it - and or point it at your custom sound descriptor and AP drain scaling, if the specific jetpack being worn is your special one. Or to not alter the player action scripts at all - you could recreate that with a similar script tied to a ques alias and that checks for your specific jetpack, etc. I'll give it a look. I should note, however, that the PoC is almost essentially how it will work in the final version; tied to a perk. My main goal here is to make the wings in Chrysalis' Armour be more than just for show, which is why I am also trying to override the sounds, change facial expression, etc.
Carreau Posted April 16, 2018 Posted April 16, 2018 If you’re making copies of the magic effect, you can set the associated value to a dummy actor value. Or, for the enchantment duplicate you made, set the magnitude to 0. The way it looks like the CK links it all together is that the PA piece applies an enchantment, the enchantment calls the magic effect with a passed magnitude of 1 for AP drain. Since you’re duplicating all of the effects, you can change the parameters of your duplicates without impacting the vanilla PA variants. since jetpack is an effect archetype, I can only assume mucking around with game settings will impact anything that uses the archetype.
Evan555alpha Posted May 4, 2018 Author Posted May 4, 2018 So, coming back to this, would it be possible to create a jetpack-esque ability that doesn't involve the jetpack archetype? Like the Flying mod for Skyrim. Could it be done with the use of the TranslateTo function? Or possibly the TranslateToRef function, used in tandem with a function to get a looked at reference?
AWP3RATOR Posted May 6, 2018 Posted May 6, 2018 FO4's engine is a successor to Skryim's, and many of the mechanics cross over between the two. Generally speaking (because I haven't tested this out), I would think the same would apply here. That being said - the Skyrim version tended to crash or at least cause irregularities when the player moved too fast through cells - if you're not overriding the forward movement settings too much in addition to the actor's gravity encumbrance, it should be ok. (in theory)
Evan555alpha Posted May 6, 2018 Author Posted May 6, 2018 7 hours ago, AWP3RATOR said: FO4's engine is a successor to Skryim's, and many of the mechanics cross over between the two. Generally speaking (because I haven't tested this out), I would think the same would apply here. That being said - the Skyrim version tended to crash or at least cause irregularities when the player moved too fast through cells - if you're not overriding the forward movement settings too much in addition to the actor's gravity encumbrance, it should be ok. (in theory) Ah, I'd be trying to avoid changing the forward momentum. I think another possibility could be that I use a ModPos on the z axis, and use a combination of OnKeyUp and OnMagicEffectStart/Finish events. So it'd be something like: - The perk script listens for a keydown event on the spacebar - In this event there's a while loop that has an int exit condition - A keyup event changes the int, satisfying the while loop's exit condition Or possibly: - The perk script listens for a keydown event on the spacebar - This event applies a magic effect/spell on the player - When that magic effect starts, have the while loop - A keyup event that ends the magic effect/spell - when the effect finishes, end the loop.
Evan555alpha Posted May 7, 2018 Author Posted May 7, 2018 Welp, I think I've gotten it to work. It doesn't handle well at all, and I can't seem to move much along both the x and y axes when the TranslateTo function is in effect, but it does work. Spoiler Scriptname Evan555alpha:CAFlightAbilityScript extends Perk {This is the script that allows flight to happen.} Group PreReqs Quest Property MQ102 Auto Const {This quest needs to happen before we can do anything.} Perk Property CAFlightPerk Auto Const {Do nothing if we don't have this perk.} EndGroup Group Main Actor Property Player Auto {Who else?} Bool Property CanExit = False Auto {Can we exit the loop? Please?} Bool Property IsAlreadyRunning = False Auto {To prevent multiple instances.} EndGroup Group FX Sound Property NPCBloatflyIdleWingsLP Auto Sound Property NPCBloatflyAttack Auto Int Property SoundInstance = 0 Auto EndGroup Function ChangePosition(ObjectReference arTarget, Float X = 0.0, Float Y = 0.0, Float Z = 0.0, Float aX = 0.0, Float aY = 0.0, Float aZ = 0.0, Float Speed = 150.0) Float CurrentX = arTarget.GetPositionX() Float CurrentY = arTarget.GetPositionY() Float CurrentZ = arTarget.GetPositionZ() Float FutureX = CurrentX + X Float FutureY = CurrentY + Y Float FutureZ = CurrentZ + Z arTarget.TranslateTo(FutureX, FutureY, FutureZ, aX, aY, aZ, Speed) EndFunction Event OnInit() Bool IsDone = MQ102.IsStageDone(10) While IsDone == False Utility.Wait(1.0) EndWhile Self.RegisterForKey(32) EndEvent Event OnKeyDown(int keyCode) If Player.HasPerk(CAFlightPerk) == 1 Debug.Trace("PLayer has perk.") If (keyCode == 32) && IsAlreadyRunning == False Debug.Trace("Not Running. Started!") SoundInstance = NPCBloatflyIdleWingsLP.Play(Player) IsAlreadyRunning = True CanExit = False While CanExit == False ChangePosition(Player, 0.0, 0.0, 400.0, Player.GetAngleX(), Player.GetAngleY(), Player.GetAngleZ(), (MCM.GetModSettingFloat("Chrysalis' Armour", "fFlightSpeed:Time") * 10)) ;Player.MoveTo(Player, 0.0, 0.0, 5.0, False) Debug.Trace("Position Modded") Utility.Wait(2.0) EndWhile Debug.Trace("Loop Exited.") Self.RegisterForKey(32) Else Debug.Trace("Already Running.") Self.RegisterForKey(32) EndIf Else Self.RegisterForKey(32) EndIf EndEvent Event OnKeyUp(int keyCode, float time) If Player.HasPerk(CAFlightPerk) == 1 If ((keyCode == 32) && (time > 0.25)) Debug.Trace("You may now leave the loop.") CanExit = True NPCBloatflyAttack.Play(Player) Sound.StopInstance(SoundInstance) IsAlreadyRunning = False Self.RegisterForKey(32) ElseIf (keyCode == 32) Sound.StopInstance(SoundInstance) Self.RegisterForKey(32) Else Self.RegisterForKey(32) EndIf Else Self.RegisterForKey(32) EndIf EndEvent I've found that an MCM setting of about 40 or so is working well for the current translation height. However, once I get it more set in stone, I'll be removing it. Now, it shouldn't be too hard to add in a magic effect or something that start/stop with these events, to drain AP.
Evan555alpha Posted October 18, 2018 Author Posted October 18, 2018 Coming back to this, would it be worth looking into creating an F4SE plugin to override the default jetpack's sound, and then use what I initially did with the perk? It'd be a whole lot less clunky than the hacked together script that I've been using in the meantime. Of course, that comes with its own set of challenges, such as learning C++, knowing what exactly it is that I'm looking for to override, creating conditions for the override, etc.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.