Jump to content

Recommended Posts

On 9/16/2018 at 2:07 PM, Gulfwulf said:

Hey DK,

 

This is the script for the Immersive Lovers Embrace Remastered mod that we were discussing on the issues tracker where the wrong animations were taking place. The author hasn't responded to any comments on the mod page in over a week, so I figured I'd post this here to see if either you or @Flashy (JoeR) could tell me what's wrong with it. I don't mind making changes and testing them because I like the idea behind the mod. Thanks.

  Reveal hidden contents

 



Scriptname ILER_MAIN_HUG_KISS extends Quest

;-- Properties --------------------------------------
;--Actors--
Actor Property DogmeatRef Auto Const
Actor Property theActor Auto  
;--Messages--
Message Property ILER_KISS_HUG_MSG Auto Const
Message Property ILER_KISS_HUG_NOT_READY_MSG Auto Const
Message Property ILER_PA_ERROR_MSG Auto Const
;--Sound--
Sound Property ILER_HUG Auto Const
Sound Property ILER_KISS Auto Const
;--Actors/ActorValues--
Actor Property PlayerRef Auto Const
ActorValue Property CA_Affinity Auto Const
;--ImageSpaceModifiers--
ImageSpaceModifier Property HoldAtBlackImod Auto Const
;--AAF-Framework--
AAF:AAF_API AAF_API
;--Integers--
Int Property animType Auto  
;--Globals--
GlobalVariable Property ILER_KISS_ANIM_DURATION Auto Const
GlobalVariable Property ILER_HUG_ANIM_DURATION Auto Const
GlobalVariable Property ILER_PA_IGNORE Auto Const
;--Items--
Armor Property ILER_RING_WEDDING Auto Const
Armor Property ILER_RING_ENGAGEMENT Auto Const
Armor Property ILER_RING_PROMISE Auto Const

;--Events------------------------------------------
Event AAF:AAF_API.OnAnimationStart(AAF:AAF_API akSender, Var[] akArgs)
    Debug.Trace("ILER: ILER_MAIN_HUG_KISS - OnAnimationStart event called")
	If animType == 1 								;Hug
		Debug.Trace("ILER: ILER_MAIN_HUG_KISS - Hug selection detected")
		ILER_HUG.playandwait(Game.GetPlayer())		;Play sound effect for Hug
    ElseIf animType == 2 							;Kiss
		Debug.Trace("ILER: ILER_MAIN_HUG_KISS - Kiss selection detected")
		ILER_KISS.playandwait(Game.GetPlayer())		;Play sound effect for Kiss
	EndIf
	Utility.Wait(1)                                                             ;Pause 1 sec
    String actorName = theActor.GetActorBase().GetName()                       ;Companion name to string
	Debug.Notification(actorName + " liked that.")                              ;Liked that notification

EndEvent

;--Functions---------------------------------------
Function LoadAAF()
	Debug.Trace("ILER: ILER_MAIN_HUG_KISS - LoadAAF function called")
    AAF_API = Game.GetFormFromFile(0x00000F99, "AAF.esm") as AAF:AAF_API
    If AAF_API
		;Debug.MessageBox("Installed")
		Debug.Trace("ILER: ILER_MAIN_HUG_KISS - LoadAAF - AFF API detected")
	else
		;Debug.MessageBox("Not Installed")
		Debug.Trace("ILER: ILER_MAIN_HUG_KISS - LoadAAF - AFF API NOT detected")
    Endif
EndFunction

Function KissHugTrigger()
	Debug.Trace("ILER: ILER_MAIN_HUG_KISS - KissHugTrigger Function called")
	Debug.Trace("ILER: ILER_MAIN_HUG_KISS - KissHugTrigger loading AAF API")
    RegisterForRemoteEvent(PlayerRef, "OnPlayerLoadGame")
    LoadAAF()

    Actor[] playerFollowers = Game.GetPlayerFollowers( )    ;Array that holds player followers
    Actor Companion = Game.GetPlayer()                      ;Intialise object to hold companion, temp hold player

    int index = 0
    while (index < playerFollowers.Length)
        If ( playerFollowers[index].IsPlayerTeammate() == True && playerFollowers[index] != DogmeatRef )
			Debug.Trace("ILER: ILER_MAIN_HUG_KISS - Matching companion Found " + playerFollowers[index].GetActorBase().GetName())
				
			If ( Companion.IsInPowerArmor() && ILER_PA_IGNORE.GetValue() == 0 || Game.GetPlayer().IsInPowerArmor() && ILER_PA_IGNORE.GetValue() == 0 ) ; PA check
				Debug.Trace("ILER: ILER_MAIN_HUG_KISS - Power armor error caught")
				ILER_PA_ERROR_MSG.show()
				return 
			ElseIf ( playerFollowers.Length > 1 )	;Multiple companions, picks the first one wearing a ring
				Debug.Trace("ILER: ILER_MAIN_HUG_KISS - Multiple companions detected")
				If RingType(playerFollowers[index]) != 0				;found companion with ring
					Debug.Trace("ILER: ILER_MAIN_HUG_KISS - Found a companion with a ring, chosing them")
					Companion = playerFollowers[index]		;Set companion equal to the current playerfollowers index
					theActor = Companion					;Set theActor to the companion - Public actor object assecable by the events
           			KissHugMain(Companion)					;Pass found companion to kiss hug function
            		return                              ;Found companion and called scene, kill
				ElseIf ( index == (playerFollowers.Length - 1) )	;Loop is on final index and didn't find matching companion
					Debug.MessageBox("Tip: When using multiple companions a ring is required to be equiped on the companion you wish to engage with.")
				EndIf
			Else
			    Companion = playerFollowers[index]	;Set companion equal to the current playerfollowers index
				theActor = Companion				;Set theActor to the companion - Public actor object assecable by the events
           		KissHugMain(Companion)				;Pass found companion to kiss hug function
            	return                              ;Found companion and called scene, kill
			EndIf
        EndIf
        index += 1 
    EndWhile

	Debug.Trace("ILER: ILER_MAIN_HUG_KISS - No companion found in range")
    Debug.Notification("No compatable companion detected")	;Informs player that no compatable companion found

EndFunction

int Function RingType(actor Companion)
  Debug.Trace("ILER: RingType function called")

	If Companion.IsEquipped(ILER_RING_WEDDING)
		debug.trace("ILER: RingType Function: Returns 3 (Wedding)", 0)
		return 3
		
	ElseIf Companion.IsEquipped(ILER_RING_ENGAGEMENT)
		debug.trace("ILER: RingType Function: Returns 2 (Engage)", 0)
		return 2
		
	ElseIf Companion.IsEquipped(ILER_RING_PROMISE)
		debug.trace("ILER: RingType Function: Returns 1 (Promise)", 0)
		return 1
  Else
  	debug.trace("ILER: RingType Function: Returns 0 (no ring)", 0)
		return 0
	EndIf
	
EndFunction

Function KissHugMain(Actor Companion)

	Debug.Trace("ILER: ILER_MAIN_HUG_KISS - KissHugMain Function called")
    int ibuttonILE = ILER_KISS_HUG_MSG.Show() 				;Shows the menu for hug/kiss
    float npcAffinity = Companion.GetValue(CA_affinity)		;Store companions affinity



    If ibuttonILE == 1 												;Hug
	Debug.Trace("ILER: ILER_MAIN_HUG_KISS - Hug option selected")

		If npcAffinity >= 250											;Affinity check on companion: >=250
			SceneHandler(Companion, 1)										;Call kissHug scene with Hug parameter
			Companion.SetValue( CA_affinity, npcAffinity+10 )  				;Buff +10 affinity to companion
		Else
			ILER_KISS_HUG_NOT_READY_MSG.Show()								;Show the not ready message	if they failed affinity check				
		EndIf

	ElseIf ibuttonILE == 2 											;Kiss
	Debug.Trace("ILER: ILER_MAIN_HUG_KISS - Kiss option selected")

		If npcAffinity >= 500											;Affinity check on companion: >=500
			Debug.Trace("ILER: ILER_MAIN_HUG_KISS >= Affinity check passed")
			SceneHandler(Companion, 2)									;Call kissHug scene with Kiss parameter
			Companion.SetValue( CA_affinity, npcAffinity+15 )  			;Buff +15 affinity to companion
		Else
			Debug.Trace("ILER: ILER_MAIN_HUG_KISS >= Affinity check failed")
			ILER_KISS_HUG_NOT_READY_MSG.Show()							;Show the not ready message	if they failed affinity check
		EndIf

	EndIf

EndFunction

Function SceneHandler(Actor Companion, int Type)

	If !AAF_API	;AAF Not installed
		Debug.Trace("ILER: ILER_MAIN_HUG_KISS - SceneHandler - AFF API NOT detected")
		KissHugScene(Companion, Type)
	Else		;AAF installed
		Debug.Trace("ILER: ILER_MAIN_HUG_KISS - SceneHandler - AFF API detected")
		KissHugSceneAAF(Companion, Type)
	EndIf

EndFunction

Function KissHugScene(Actor Companion, int Type)

	Debug.Trace("ILER: ILER_MAIN_HUG_KISS - KissHugScene Function called")
    Utility.Wait(0.5)                                                           ;Slight pause
	Game.ForceThirdPerson()		                                                ;Force Third Person
	Utility.Wait(0.5)                                                           ;Slight pause
	HoldAtBlackImod.ApplyCrossFade(2)                                           ;Crosfade to black over 2 secs
	InputEnableLayer myLayer = InputEnableLayer.Create()                        ;Input layer to disable controls
	myLayer.DisablePlayerControls(true, true, true, true, true, true, true)     ;Disable player controls
	Debug.EnableAI(False)                                                       ;Disable all AI debug
	Debug.EnableDetection(False)                                                ;Disable all AI Detection
	Utility.Wait(3)                                                             ;Pause 3 secs
	Companion.MoveTo(Game.GetPlayer())                                          ;Move companion to player

    If type == 1 								;Hug
		ILER_HUG.playandwait(Game.GetPlayer())		;Play sound effect for Hug
    ElseIf type == 2 							;Kiss
		ILER_KISS.playandwait(Game.GetPlayer())		;Play sound effect for Kiss
	EndIf

	Utility.Wait(1)																;Slight pause
    myLayer.EnablePlayerControls()                                              ;Enable all controls
	Debug.EnableAI()                                                            ;Enable all AI debug
	Debug.EnableDetection()                                                     ;Enable all AI Detection
	ImageSpaceModifier.RemoveCrossFade(2)                                       ;Fade back in 2 secs
	Utility.Wait(1)                                                             ;Pause 1 sec
    String actorName = Companion.GetActorBase().GetName()                       ;Companion name to string
	Debug.Notification(actorName + " liked that.")                              ;Liked that notification

EndFunction

Function KissHugSceneAAF(Actor Companion, int type)

	Debug.Trace("ILER: ILER_MAIN_HUG_KISS - KissHugSceneAAF Function called")
	animType = type																		;Retrieve the user selection: 1=Hug 2=Kiss
	Actor[] Actors = New Actor [2]														;Actor Array for our two actors for the scene
	Actors[0] = Game.GetPlayer()														;First actor set as player
	Actors[1] = Companion																;Second actor set as companion

	; Create some dank SceneSettings
	AAF:AAF_API:SceneSettings HugSettings = AAF_API.GetSceneSettings()
	AAF:AAF_API:SceneSettings KissSettings = AAF_API.GetSceneSettings()

	; Adjust Hug settings:
	HugSettings.duration = ILER_HUG_ANIM_DURATION.GetValue()
	HugSettings.position = "Atomic Embrace"

	; Adjust Kiss settings:
	KissSettings.duration = ILER_HUG_ANIM_DURATION.GetValue()
	KissSettings.position = "Atomic Kissing"

	; Type1 = Hug | Type2 = Kiss
	If type == 1
		Debug.Trace("ILER: ILER_MAIN_HUG_KISS - KissHugSceneAAF - Hug detected, call hug anim")
		AAF_API.StartScene(actors, HugSettings)	;Calls animation scene via API - Start a scene (including the adjusted settings struct as a parameter):
	ElseIf type == 2
		Debug.Trace("ILER: ILER_MAIN_HUG_KISS - KissHugSceneAAF - Kiss detected, call kiss anim")
		AAF_API.StartScene(actors, KissSettings)	;Calls animation scene via API - Start a scene (including the adjusted settings struct as a parameter):
	EndIf
	Debug.Trace("ILER: ILER_MAIN_HUG_KISS - KissHugSceneAAF - End of function, rest of code should be called from animation start event")
	;Rest of code gets executed in the event

EndFunction

 

 

 

 

Basically what happens is that AAF plays a random animation whenever you use the pop-up menu to either hug or kiss your romanced companion rather than the proper animation. I would debug it myself, but I only know enough scripting to be dangerous and I would have to basically rewrite it using Flashy's template to figure out what's going on. Thanks again.

I did ask him about the blackout and he says it is one error in AAF.

Even if you have turned off the blackout in the menu it still are there.

 

 

Share this post


Link to post
13 minutes ago, Gulfwulf said:

It's attached to a quest that starts automatically. Could I remove the mod, then use the save game cleaner to remove the scripts? I'd rather not have to start a new game just to test this out because it requires a romanced companion to work.

I tested it out myself with ILER and with another mod that passes position names to AAF and had the same problem.  It looks like it may be a problem in AAF.

 

If you do want to clean your save, do it while the mod is still installed.  Doing a blanket removal of unattached script instances is not safe in FO4, so you need to leave the mod installed so that you can identify its records in the save.  In ReSaver, you can apply a filter for that mod, expand everything under script instances and changeforms, select everything, and delete them all.  This ensures you are only removing records from that mod.  Then you can safely update or uninstall the mod.

Share this post


Link to post
2 hours ago, fred200 said:

I can't let this pass without mentioning:

https://www.creationkit.com/fallout4/index.php?title=Notepad%2B%2B

 

Notepad++ has been great for anything I wanted to do, from XML to Papyrus to compiles.

 

Yes. Many people use Notepad++ also. I started with Sublime Text and never felt that anything was missing. But, I would be curious to hear about any pros/cons from someone who has used both.

Share this post


Link to post
On 9/16/2018 at 5:07 AM, Gulfwulf said:

Hey DK,

 

This is the script for the Immersive Lovers Embrace Remastered mod that we were discussing on the issues tracker where the wrong animations were taking place. The author hasn't responded to any comments on the mod page in over a week, so I figured I'd post this here to see if either you or @Flashy (JoeR) could tell me what's wrong with it. I don't mind making changes and testing them because I like the idea behind the mod. Thanks.

  Reveal hidden contents

Basically what happens is that AAF plays a random animation whenever you use the pop-up menu to either hug or kiss your romanced companion rather than the proper animation. I would debug it myself, but I only know enough scripting to be dangerous and I would have to basically rewrite it using Flashy's template to figure out what's going on. Thanks again.

This is fixed in beta 19.

Share this post


Link to post
1 hour ago, dagobaking said:

This is fixed in beta 19.

Cool. Any ETA on when it'll be released to us unwashed masses?

 

[Edit]: what was the problem?

Share this post


Link to post
3 hours ago, EgoBallistic said:

 

That LLFP error means that your version of F4SE is out of date or at least doesn't match what that version of LLFP was built for.  LLFP is a F4SE plugin that comes with AAF, and it can also be downloaded separately.  For best results, make sure your Fallout 4 is up to date, you have the latest F4SE, and you are using the latest release of AAF. 

 

Not sure if the LLFP error is related to your canine CTD, but best to have everything installed correctly before trying to diagnose a problem.  Note that there is not a general problem with canine animations and AAF, they normally work just like any other animation.

Is it possible to install an older version of LL FP over what AAF provides then? I don't want to have to re-optimize 20+ gigs of textures if I don't have to, that's a day-long job

Share this post


Link to post
2 minutes ago, trees said:

Is it possible to install an older version of LL FP over what AAF provides then? I don't want to have to re-optimize 20+ gigs of textures if I don't have to, that's a day-long job

I think so. Give it a go. Worse that can happen is it don't work.

Share this post


Link to post
11 minutes ago, trees said:

Is it possible to install an older version of LL FP over what AAF provides then? I don't want to have to re-optimize 20+ gigs of textures if I don't have to, that's a day-long job

It is possible, yes.  All of the previous versions of LLFP are on its download page.

 

But I don't understand why you would need to re-optimize your textures if you update your game version and F4SE.  If your textures are loose files they will still override anything from the BA2s, and none of the Fallout 4 texture BA2s have been updated since May 2016.

Share this post


Link to post

updating to beta 18 from 17 keeps giving me a AAF ERROR 051 and breaks all animations for me is there something i did wrong?

Share this post


Link to post

Was wondering if there is way to speed up the redressing after the animation ends ?? right now it looks like it waits too long before the redress scripts kicks in. due to the delay sometimes the redress does not seem to trigger at all untill next animations sequence.

 

btw i am bit confused since you are talking about beta 18 and 19 yet at nexus there is still beta 10 are we talking about the same beta file from 31st of august ??

Share this post


Link to post
19 minutes ago, nestor28 said:

updating to beta 18 from 17 keeps giving me a AAF ERROR 051 and breaks all animations for me is there something i did wrong?

Run the installer again and tell it to install the Sample XML files.  Apparently something in the base AAF XML files is referring to something in the sample AAF_reactionSetData.xml.

Share this post


Link to post
8 minutes ago, D_ManXX2 said:

Was wondering if there is way to speed up the redressing after the animation ends ?? right now it looks like it waits too long before the redress scripts kicks in. due to the delay sometimes the redress does not seem to trigger at all untill next animations sequence.

data\AAF\AAF_settings.xml

 

Share this post


Link to post
2 minutes ago, EgoBallistic said:

Run the installer again and tell it to install the Sample XML files.  Apparently something in the base AAF XML files is referring to something in the sample AAF_reactionSetData.xml.

ok thanks i'll try it now.

Share this post


Link to post
1 hour ago, D_ManXX2 said:

Was wondering if there is way to speed up the redressing after the animation ends ?? right now it looks like it waits too long before the redress scripts kicks in. due to the delay sometimes the redress does not seem to trigger at all untill next animations sequence.

 

btw i am bit confused since you are talking about beta 18 and 19 yet at nexus there is still beta 10 are we talking about the same beta file from 31st of august ??

Think it's only patreons and mod makers that have access to the most recent dev builds. Everyone else needs to wait one month for the next nexus release.

Share this post


Link to post
57 minutes ago, Campbell said:

Think it's only patreons and mod makers that have access to the most recent dev builds. Everyone else needs to wait one month for the next nexus release.

Yes, that is true.

 

This isn't a bad thing. Development is moving at a rapid pace. (as evident with the version numbers) and many changes are going to come down... Like how you access the AAF function for example minor change. will have to push the Home key then enter as opposed to the old style of just the Home key... this is to make it more stable and responsive from my understanding. AND so far I can tell you it is true.

 

Give the team a bit of time to get this up and running. It is moving quite well and keep in mind it took some time to get a really solid version of Sexlab and Sexout for that matter.

 

Share this post


Link to post
5 hours ago, Gulfwulf said:

Cool. Any ETA on when it'll be released to us unwashed masses?

 

[Edit]: what was the problem?

Should be around 9/30

 

There is a weird issue with Papyrus where it will sometimes capitalize the first letter of a variable name or variable value. Testing on my machine, the position setting gets turned from "position" to "Position". I thought that this would be universal behavior. But, apparently, due to some unknown variation, it leaves "position" as "position" in some cases. So, I fixed it by checking both variations for a value.

3 hours ago, nestor28 said:

updating to beta 18 from 17 keeps giving me a AAF ERROR 051 and breaks all animations for me is there something i did wrong?

I removed some placeholder XML files out of the standard install. I have to double-check. But, I think this is being caused because another mod is referring to an entry in the placeholder XML that is no longer there.

3 hours ago, D_ManXX2 said:

Was wondering if there is way to speed up the redressing after the animation ends ?? right now it looks like it waits too long before the redress scripts kicks in. due to the delay sometimes the redress does not seem to trigger at all untill next animations sequence.

This is a deliberate feature so that users can see overlay effects after an animation. Besides, it's not very realistic that clothes instantly appears on the moment an animation ends.

 

That said, you can adjust the delay in AAF_settings.xml with the 'reequip_delay' setting.

3 hours ago, D_ManXX2 said:

btw i am bit confused since you are talking about beta 18 and 19 yet at nexus there is still beta 10 are we talking about the same beta file from 31st of august ??

10 is the last public build. The more recent ones are test builds available to mod authors and patrons. I should have another public build ready around 9/30.

Share this post


Link to post

Confirming that with a new game and no placeholder XML installed I don't get error 051. I think that there is another AAF mod referencing the placeholder XML...

Share this post


Link to post
1 hour ago, dagobaking said:

I removed some placeholder XML files out of the standard install. I have to double-check. But, I think this is being caused because another mod is referring to an entry in the placeholder XML that is no longer there.

I tried what EgoBallistic said and reinstalled with the sample XML files and everything fine now. thanks for getting back to me quickly.

Share this post


Link to post
2 hours ago, dagobaking said:

Should be around 9/30

 

There is a weird issue with Papyrus where it will sometimes capitalize the first letter of a variable name or variable value. Testing on my machine, the position setting gets turned from "position" to "Position". I thought that this would be universal behavior. But, apparently, due to some unknown variation, it leaves "position" as "position" in some cases. So, I fixed it by checking both variations for a value.

Cool. I'll check out the next public build and let you know if I have any issues.

Share this post


Link to post
2 hours ago, nestor28 said:

I tried what EgoBallistic said and reinstalled with the sample XML files and everything fine now. thanks for getting back to me quickly.

I would still like to figure out what it is that is referencing the sample XML.

Share this post


Link to post
10 hours ago, dagobaking said:

I would still like to figure out what it is that is referencing the sample XML.

AAF itself is using the "default" reactionSet as a fallback if an Action does not specify a reactionSet.  The compatibility patch for Leito and Crazy adds action XMLs for FF and Dog animations which do not specify reactionSets.  So you will only get this error if you have Leito and Crazy and the compatibility patch for them installed.

Share this post


Link to post

Is someone else having problems with Crimsonrider's Clothing of the Commonwealth not being unequipped when animating? I have this issue but I really don't know if it's a load order problem or something else...

 

Thanks for reading this :)

Share this post


Link to post
1 hour ago, kadsend said:

Is someone else having problems with Crimsonrider's Clothing of the Commonwealth not being unequipped when animating? I have this issue but I really don't know if it's a load order problem or something else...

 

Thanks for reading this :)

which armor slot is it using?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...