-
Posts
143 -
Joined
-
Last visited
Everything posted by Pelgar
-
Does FO4 have the IsInFurnitureState Condition?
Pelgar replied to Lemecc's topic in Fallout 4's Creation Kit and Modders
Yes, if GetSitting returns the same values as GetSitState a 0 return would indicate not using furniture. -
Does FO4 have the IsInFurnitureState Condition?
Pelgar replied to Lemecc's topic in Fallout 4's Creation Kit and Modders
I think that in Fallout 4 you are going to want the GetSitting condition. The name is a bit deceptive as It will return a positive if the actor it's called on is using any furniture, probably including power armor. I have not tested it but my guess is it will probably return the same as the script function GetSitState. If I'm right you'll want to test for a return value of 3. -
How to easily locate a NIF's Geometry?
Pelgar replied to tonicmole's topic in Starfield's Creation Kit and Modders
With the nif open in nifskope select BSGeometry in the Block List. Scroll to the bottom of Block Details and expand Meshes. Expand Mesh 0, scroll down to Mesh Path. For example, I have Outfit_Sarah_Torso_f.nif open in nifskope. The path to this nif's geometry is 6f89b710a8601cc1e79b\b9a4813c2649254b121f. 6f89b710a8601cc1e79b is the geometry sub folder and b9a4813c2649254b121f. is the .mesh file name. Hope this helps. -
The companions lock the armor. The best approach I can think of would be to build a patch that list all companions, both vanilla and modded that you use. There is a keyword, ShowWornItem or ShowWornItems something like that. I'm not where I can look it up right now. Use the patch to add that keyword to each of your companions. The keyword to add to your companions is ShowWornItemsKeyword, I just looked it up.
-
Let's talk about NpcBenchChurchSit01
Pelgar replied to pepperman35's topic in Fallout 4's Creation Kit and Modders
I removed the AnimFurnPraying keyword from the pew. I mentioned the condition on the FurniturePraying idle in the text but I forgot to tell you to remove it, in your copy of the idle, in the Fo4Edit instructions. -
Let's talk about NpcBenchChurchSit01
Pelgar replied to pepperman35's topic in Fallout 4's Creation Kit and Modders
I was curious as to why this was not working so I made a quick test mod to see if I could make it happen. In the CK I made a copy of NpcBenchChurchSit01 and deleted AnimFurnPraying [KYWD:00140F74] then added AnimFurnChairSitAnims [KYWD:00030BB2]. I had a settler sit on the bench in game and tried the FurniturePraying idle on her via the console. I got the exact same results you've been getting, nothing happened. I then took a look at the idle itself in F04Edit and found the problem or actually problems. The first problem was there was a condition on the idle: (Subject.CurrentFurnitureHasKeyword(AnimFurnPraying [KYWD:00140F74]) = 1.000000 AND). With the AnimFurnPraying Keyword removed from my test bench it didn't have a chance of playing. Unfortunatly adding the keyword to my bench didn't help. I continued looking at the FurniturePraying idle and found it didn't have an animation file. I don't know exactly how they get the furniture idles working so I made a copy of FurniturePraying using F04Edits Copy as new record right click menu. I did this in FO4Edit becasue it's really easy to do there and I don't have a clue how to do it in the CK. Changes I made to FurniturePraying: EDID-Editor ID: PelgFurniturePraying (Of course you should name it something that works for you) ENAM - Animation Event: dyn_activationloop ANAM - Related Idle Animations Related Idle Anamation #0 (Parent): NULL - Null Reference [00000000] (Double click then hit delete) Related Idle Animation #1 (Previous Sibling): Null Flags: Parent (Double click then check Parent) GNAM - Animation File: Actors\Character\Animations\Furniture\Pray\IdleLoop.hkx https://youtu.be/uv_gYif7Nr4 -
Let's talk about NpcBenchChurchSit01
Pelgar replied to pepperman35's topic in Fallout 4's Creation Kit and Modders
I honestly don't know what may be going on here. Possibly the package that is seating the npcs is forcing the current animation especially if it has a script in the OnChange event or a forced idle attached to it. I would probably also play around with the timing of the Wait(0.3) between the two calls to PlayIdle. A value of 1.0 would give a full one second wait between playidle calls, probably overkill but should make sure that the idlestop anim is playing on the npc before playing the FurniturePraying idle. -
Let's talk about NpcBenchChurchSit01
Pelgar replied to pepperman35's topic in Fallout 4's Creation Kit and Modders
Try changing the line: WorkshopNPCScript theNPC = ActorsAll[j] as WorkShopNPCScript To: Actor theNPC = ActorsAll[j] as Actor PlayIdle runs on the actor script. -
Let's talk about NpcBenchChurchSit01
Pelgar replied to pepperman35's topic in Fallout 4's Creation Kit and Modders
IdleStop_Loose points to IdleStop. -
Let's talk about NpcBenchChurchSit01
Pelgar replied to pepperman35's topic in Fallout 4's Creation Kit and Modders
I think the following modification to your code will work, maybe not elegantly. I've dabbled with forcing sitting npcs into new idles and found that it's simply not going to happen if you don't stop the current idle first. It can be a bit jerky so I added the fade to black, use it or don't totally up to you. Call with TransitionToPraying(True) if you want fade out / fade in. If you don't want fade call it with TransitionToPraying(False) Scriptname TempTest extends Quest Idle Property FurniturePraying Auto Const ObjectReference[] Property ActorsAll auto Idle Property IdleStop_Loose Auto Const Function TransitionToPraying(bool bFadeOut) ;Set true if you want fade to black int j = 0 if bFadeOut Game.FadeOutGame(True, True, 0.1, 0.1, True) EndIf While j < ActorsAll.Length WorkshopNPCScript theNPC = ActorsAll[j] as WorkShopNPCScript theNPC.PlayIdle(IdleStop_Loose) Utility.Wait(0.3) theNPC.PlayIdle(FurniturePraying) j += 1 EndWhile If bFadeOut Utility.wait(0.5) Game.FadeOutGame(False, True, 0.1, 0.1, False) EndIf EndFunction -
Clearing a settler's current workshop
Pelgar replied to Minuos's topic in Fallout 4's Creation Kit and Modders
I'm not sure how you would do that with OpenWorkshopSettlementMenu(). I have a script that I've been using for a while now that places new npc's in settlement via the workshop. The settlers are added to the workshop and commendable on placement. I attach the script, along with WorkshopNPCScript, to the actor I want to place. Scriptname PelgWorkshopNPCScript extends Actor Conditional WorkshopParentScript Property WorkshopParent Auto Const Bool property bAddedToWkShop = false auto Event OnWorkshopObjectPlaced(objectreference akReference) If (!bAddedToWkShop) ;Debug.MessageBox("OnWorkshopObjectPlaced Event ran on Pelg Settler.") self.EvaluatePackage(true) self.AddKeyword(WorkshopParent.WorkshopAllowCommand) self.AddKeyword(WorkshopParent.WorkshopAllowMove) self.SetNoBleedoutRecovery(false) actor PelgSettler = Self as actor workshopnpcscript WkShpScript = PelgSettler as workshopnpcscript WkShpScript.bCommandable = true WkShpScript.bAllowCaravan = true WkShpScript.bAllowMove = true WkShpScript.bIsWorker = true WkShpScript.bCountsForPopulation = true WkShpScript.bWork24Hours = false WkShpScript.assignedMultiResource = WorkshopParent.WorkshopRatings[WorkshopParent.WorkshopRatingFood].resourceValue workshopscript workshopRef = self.getLinkedRef(WorkshopParent.WorkshopItemKeyword) as workshopscript WorkshopParent.AddActorToWorkshopPUBLIC(PelgSettler as workshopnpcscript, workshopRef, false) bAddedToWkShop = true EndIf EndEvent Hope this helps -
My best guess is that the script property in your actor script is not set to the quest it belongs to, this has tripped me up a few times.
- 2 replies
-
- events
- quest scripts
-
(and 2 more)
Tagged with:
-
Can't get 3rdPUseStimpakOnSelfOnGround to play
Pelgar replied to Pelgar's topic in Fallout 4's Creation Kit and Modders
I finally got Jenny to using the stimpak on herself. It was quite difficult to find the right combination of functions to damage health, restore health and play nice with each other. The only problem I have with it now is the stimpak is left sticking in Jenny's wrist until she exits the furniture idle (probably nothing I can do about that). The code below is the relevant parts of a much larger quest script. I'm not asking for any help here just showing how it was accomplished. ScriptName CompJennyIntroScript extends Quest conditional ReferenceAlias Property Alias_Jenny Auto Const ActorValue Property RightMobilityCondition Auto Const ActorValue Property LeftMobilityCondition Auto Const Potion Property Stimpak Auto Const int Property JennyWaitTimerID Auto Const bool Property bJennysRevengeReady Auto conditional Function JennyStimpakSelf() Actor Jenny = Alias_Jenny.getActorReference() float fLeftMob = Jenny.GetValue(LeftMobilityCondition) float fRightMob = Jenny.GetValue(RightMobilityCondition) Debug.Trace("JennyStimpakSelf: Before damageValue LeftMobilityCondition = " + fLeftMob) Debug.Trace("JennyStimpakSelf: Before damageValue RightMobilityCondition = " + fRightMob) Jenny.damageValue(LeftMobilityCondition,100) Jenny.damageValue(RightMobilityCondition,100) fLeftMob = Jenny.GetValue(LeftMobilityCondition) fRightMob = Jenny.GetValue(RightMobilityCondition) Debug.Trace("JennyStimpakSelf: After damageValue LeftMobilityCondition = " + fLeftMob) Debug.Trace("JennyStimpakSelf: After damageValue RightMobilityCondition = " + fRightMob) Utility.Wait(0.5) Jenny.Additem(Stimpak, 1) Utility.Wait(0.5) Jenny.Equipitem(Stimpak) IF JennysRevenge.IsPlaying() JennysRevenge.Stop() EndIf StartTimer(3, JennyWaitTimerID) EndFunction Function ResetJennysHealth() IF JennysRevenge.IsPlaying() JennysRevenge.Stop() EndIf Actor Jenny = Alias_Jenny.getActorReference() Jenny.ResetHealthAndLimbs() float fLeftMob = Jenny.GetValue(LeftMobilityCondition) float fRightMob = Jenny.GetValue(RightMobilityCondition) Debug.Trace("ResetJennysHealth: After ResetHealthAndLimbs LeftMobilityCondition = " + fLeftMob) Debug.Trace("ResetJennysHealth: After ResetHealthAndLimbs RightMobilityCondition = " + fRightMob) PlayerMeetJenny.Stop() SetJennysRevenge(True) JennysRevenge.Start() EndFunction Function SetJennysRevenge(bool bReady) bJennysRevengeReady = bReady EndFunction Event onTimer(int iTimer) If iTimer == JennyWaitTimerID ResetJennysHealth() EndIf EndEvent -
Can't get 3rdPUseStimpakOnSelfOnGround to play
Pelgar replied to Pelgar's topic in Fallout 4's Creation Kit and Modders
Crippling both legs and having her equip a stimpak worked in the console. She even played the stimpak anim while siting in the furniture idle marker. Thanks Octodecoy. I'll add a couple Phases to the scene and see if I can get it to work in script. -
Can't get 3rdPUseStimpakOnSelfOnGround to play
Pelgar replied to Pelgar's topic in Fallout 4's Creation Kit and Modders
I don't know if it would work but I'll sure give it a try. When you meet Jenny in the game she is sitting on the floor, at a woundedSit Furniture marker. I've been thinking that the furniture marker was probably the reason the idle would not play. When the PC gives Jenny a stimpak she gets up, walks to the next room and shoots one to three Gunners. I'd just like for her to play a stimpak animation when the pc gives her the stimpak. It would be fine with me if the PC stimpaked her the way he does a downed companion but how to force that to happen has eluded me for about six months now. I'll try as you suggeseted, crippling her and having her equip a stimpack. -
Can't get 3rdPUseStimpakOnSelfOnGround to play
Pelgar replied to Pelgar's topic in Fallout 4's Creation Kit and Modders
The idle did not play but it had some interesting results. I tried Playidle 3rdPUseStimpakOnSelfOnGround with healthy Curie selected. The anim did not play but the console generated a line saying GetActorValue: RightMobilityCondition >> 100. This makes me think maybe the NPC would not play the anim if they are healthy. So I shoot Curie in the head and try again but the results were exactly the same. Next I tried setting RighMobilityCondition to 10 and tried playidle again. I got the same line except it reported the new (10) value. So I set RightMoblitlyCondition to 0 and try again. Now the console reports GetActorValue: LeftMobilityCondition >> 100. I then set LeftMobilityCondition to 0 and try playidle again but noting happens. The bottom line is this all leads me to believe that if I get the right condition set the idle may actually play. -
Can't get 3rdPUseStimpakOnSelfOnGround to play
Pelgar replied to Pelgar's topic in Fallout 4's Creation Kit and Modders
No I haven't but I'll give it a try now. Just to be clear, the actual name of the animation is 3rdPUseStimpakOnSelfOnGround I had to put the underscore in front of the property name because the CK will not allow a property name to start with a number. I did fill the property with 3rdPUseStimpakOnSelfOnGround Thanks for the input. -
Can't get 3rdPUseStimpakOnSelfOnGround to play
Pelgar replied to Pelgar's topic in Fallout 4's Creation Kit and Modders
I have now tried an OnExitFurniture event on the WoundedSit (ref) Jenny is using. Still no joy. Scriptname CJWoundedSitStimpak extends ObjectReference Const ReferenceAlias Property Alias_Jenny Auto Const ;checked, double checked, triple checked. It is filled. Idle Property _3rdPUseStimpakOnSelfOnGround Auto Const Event OnExitFurniture(ObjectReference akActionRef) If akActionRef == Alias_Jenny.GetActorRef() Debug.Notification( "Actor " + akActionRef + " exited furniture.") If Alias_Jenny.GetActorRef().PlayIdle(_3rdPUseStimpakOnSelfOnGround) Debug.Notification("Playing Idle") Else Debug.Notification("Failed to play Idle!") EndIf EndIF EndEvent I then tried the following: No success here either. Scriptname CJWoundedSitStimpak extends ObjectReference Const ReferenceAlias Property Alias_Jenny Auto Const ;checked, double checked, triple checked. It is filled. Idle Property _3rdPUseStimpakOnSelfOnGround Auto Const Event OnExitFurniture(ObjectReference akActionRef) If akActionRef == Alias_Jenny.GetActorRef() Debug.Notification( "Actor " + akActionRef + " exited furniture.") Alias_Jenny.GetActorRef().PlaySubGraphAnimation("3rdPUseStimpakOnSelfOnGround") EndIf EndIF EndEvent There is bound to be some way to get this animation to play! -
Can't get 3rdPUseStimpakOnSelfOnGround to play
Pelgar replied to Pelgar's topic in Fallout 4's Creation Kit and Modders
I tried your code and got the "Failed to play Idle!" notification. It would be nice if it could tell you why it failed! -
Can't get 3rdPUseStimpakOnSelfOnGround to play
Pelgar replied to Pelgar's topic in Fallout 4's Creation Kit and Modders
I have now and it is running. I was sure it was running because several infos and scenes depend on the keyword this script adds. Jenny is sitting in a NPCWoundedSit furniture. I think I will try adding a script to the NPCWoundedSit and see if I can get the anim. to play in an OnExitFurniture Event. I have also tried using PlaySubGraphAnimation with no joy. I tried moving the animation code to the quest script and calling it via kmyQuest, still no joy. Fantafaust: just want you to know that I really appreciate you trying to help me with this. It's been a thorn in my side for over six months now, I keep coming back to it but nothing I do works. -
Infirmary, sick people and beds
Pelgar replied to pepperman35's topic in Fallout 4's Creation Kit and Modders
I haven't looked at how they force old Shawn into that bed but it's not designed for animated entry. Before doing the following I suggest making a copy of the bed and using it, I don' t like to make changes to vanilla assets if I can help it. Open your copy of the bed in the CK, Find Active Markers section (mid left). Select Interact Point 0 then under Markers Position/Orientation set Rot to 90. This should get the npc laying in the proper direction. If the npc sinks to deep into the bed you can adjust the Z position. You can adj. the pos. from head to foot of bed via the Y pos. Of course side to side is adjusted with X pos. -
Infirmary, sick people and beds
Pelgar replied to pepperman35's topic in Fallout 4's Creation Kit and Modders
I don't think the vanilla games uses SnapIntoInteraction on a bed anywhere. They make heavy use of it in vertibirds. I've included the entire script that I have attached to a custom bed in a companion mod that I'm about ready to release. You can see it working at: https://youtu.be/rlnXoJ3nk58 Scriptname CompJennyBedScript extends ObjectReference Armor Property SkinNaked Auto Const Armor Property JennysSkinNaked Auto Const Armor Property SkinNaked_AO Auto Const Armor Property JennysSkinNaked_AO Auto Const Bool Property bPlayerSleeping Auto Bool Property bUndressCompleteSP1 Auto Bool Property bUndressCompleteSP2 Auto Bool Property bSP1NotRomantic Auto Bool Property bSP2NotRomantic Auto Bool Property bBedAssignedToSP1 Auto Actor Property SleepPartner01 Auto Actor Property SleepPartner02 Auto Actor Property Jenny Auto CompJennyStartupQScript Property CJStartUpScript Auto Keyword Property CompJenny_SleepingWithPC Auto Const Keyword Property playerCanStimpak Auto Const Message Property CompJennyReplaceSleepCompMsg Auto Const Message Property CompJennySleepCompNotRomantic Auto Const Message Property CompJennyBedMessage_BothAlreadyAssigned Auto Const ActorValue Property CA_IsRomantic Auto Const GlobalVariable Property CompJennyF4SEVersion Auto Const Int Property nTimerPC Auto Const Int Property nSP1UndressComplete Auto Const Int Property nSP2UndressComplete Auto Const Int Property nTimerSP1 Auto Const Int Property nTimerSP2 Auto Const Int Property nTimerWorker Auto Const ActorBase Property baSupplyLineWorker Auto Const Actor[] RomanceableAry Form[] WornSP1 Form[] WornSP2 int nTempCountArmorSP1 = 0 Int nTmpCountUEFiredSP1 = 0 int nTempCountArmorSP2 = 0 Int nTmpCountUEFiredSP2 = 0 Armor NudeSuitSP1 = None Armor NudeSuitSP2 = None int nTmpCurSlot = 0 Form Function FindActor(Actor akActor) ActorBase CurActor = (akActor.GetBaseObject() as ActorBase) EndFunction Event OnWorkshopObjectPlaced(ObjectReference akReference) ;Debug.MessageBox("OnWorkshopObjectPlaced Fired") RegisterForPlayerSleep() FillRomanceableAry() ;Alias_BedPC.Clear() ;Alias_BedPC.ForceRefTo(Self) StartTimer(2.0, nTimerWorker) Debug.Trace("[CompJenny Bed OnWorkshopObjectPlaced]You have " + RomanceableAry.Length + " romanceable companions.") EndEvent Event OnWorkshopObjectDestroyed(ObjectReference akActionRef) UnregisterForPlayerSleep() UnregisterForRemoteEvent(SleepPartner01, "OnItemUnequipped") ;Player could enter workshop mode after sleep and before it's unregistered UnregisterForRemoteEvent(SleepPartner02, "OnItemUnequipped") Debug.Trace("[CompJenny Bed Destroyed]" + akActionRef + " a reference destroyed and added back into workshop.") EndEvent Event OnActivate(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() If RomanceableAry.Length == 0 FillRomanceableAry() If RomanceableAry.Length == 0 Return EndIf EndIf SetNotRomantic() ;Clears CA_IsRomantic on all but SleepPartner01 and 02 EndIf EndEvent Event OnExitFurniture(ObjectReference akActionRef) int nResult = 0 bool bNotRomantic = False if akActionRef == Game.GetPlayer() SetAllRomantic() ;Set CA_IsRomantic on all in the array Return EndIf If bPlayerSleeping If (akActionRef as Actor) == SleepPartner01 SleepPartner01.RemoveKeyword(CompJenny_SleepingWithPC) ElseIf (akActionRef as Actor) == SleepPartner02 SleepPartner02.RemoveKeyword(CompJenny_SleepingWithPC) EndIf Return EndIf FillRomanceableAry() If RomanceableAry.Length <= 0 Debug.Trace("[CompJenny Bed OnExitFurniture]RomanceableAry is empty.") EndIf bNotRomantic = False Actor ThisActor = (akActionRef as Actor) ;Keyword chk added to prevent messagebox when NPC hangs in bed too long. If ThisActor.HasKeyword(CompJenny_SleepingWithPC) ThisActor.RemoveKeyword(CompJenny_SleepingWithPC) Return EndIf If (ThisActor == SleepPartner01 || ThisActor == SleepPartner02) If ThisActor == SleepPartner01 CJStartUpScript.ShowSP1AssignedMsg(SleepPartner01) Else CJStartUpScript.ShowSP2AssignedMsg(SleepPartner02) EndIf Return EndIf If !IsActorInRomanticArray(akActionRef) ;This person is not romantic, do you want to assign them to this bed anyway? 0 = Yes, 1 = No if CompJennySleepCompNotRomantic.Show() == 1 Return EndIf bNotRomantic = True EndIf If SleepPartner01 == None SleepPartner01 = ThisActor If !bNotRomantic SleepPartner01.SetValue(CA_IsRomantic, 1) Debug.Trace("[CompJenny Bed ExitFurniture] SleepPartner01 CA_IsRomantic = True") Else bSP1NotRomantic = True Debug.Trace("[CompJenny Bed ExitFurniture] SleepPartner01 CA_IsRomantic = False") EndIf bBedAssignedToSP1 = False ;CJStartUpScript.SetSleepPartner1(SleepPartner01) If CJStartUpScript.AssingBedToSp1(SleepPartner01, Self) bBedAssignedToSP1 = True EndIf ElseIf SleepPartner02 == None SleepPartner02 = ThisActor If !bNotRomantic SleepPartner02.SetValue(CA_IsRomantic, 1) Debug.Trace("[CompJenny Bed ExitFurniture] SleepPartner02 CA_IsRomantic Set") Else bSP2NotRomantic = True Debug.Trace("[CompJenny Bed ExitFurniture] SleepPartner02 CA_IsRomantic = False") EndIf CJStartUpScript.SetSleepPartner2(SleepPartner02) If !bBedAssignedToSP1 CJStartUpScript.SetBedSP2(Self) EndIf ElseIf SleepPartner01 != None && SleepPartner02 != None CompJennyBedMessage_BothAlreadyAssigned.Show() Return EndIf bPlayerSleeping = false int nIdx = 0 Actor ACur = None if !RomanceableAry.Length Debug.Trace("[CompJenny Bed ExitFurniture] RomanceableAry is empty") Else Debug.Trace("[CompJenny Bed ExitFurniture] RomanceableAry.Length = " + RomanceableAry.Length as string) EndIf While nIdx < RomanceableAry.Length If RomanceableAry[nIdx] != SleepPartner01 && RomanceableAry[nIdx] != SleepPartner02 ACur = RomanceableAry[nIdx] ACur.SetValue(CA_IsRomantic, 0) EndIf nIdx += 1 EndWhile EndEvent Event OnPlayerSleepStart(float afSleepStartTime, float afDesiredSleepEndTime, ObjectReference akBed) if akBed == Self Debug.Trace("[CompJenny Bed OnPlayerSleepStart] OnPlayerSleepStart Fired") bPlayerSleeping = True bUndressCompleteSP1 = False bUndressCompleteSP2 = False If SleepPartner01 != None nTempCountArmorSP1 = 0 nTmpCountUEFiredSP1 = 0 WornSP1 = New Form[0] SleepPartner01.AddKeyword(CompJenny_SleepingWithPC) RegisterForRemoteEvent(SleepPartner01, "OnItemUnequipped") If bSP1NotRomantic NudeSuitSP1 = SkinNaked_AO Else NudeSuitSP1 = SkinNaked EndIf If SleepPartner01 == Jenny if bSP1NotRomantic NudeSuitSP1 = JennysSkinNaked_AO Else NudeSuitSP1 = JennysSkinNaked EndIf EndIf SleepPartner01.EquipItem(NudeSuitSP1 as Form, True, False) Utility.Wait(0.01) SleepPartner01.Unequipitem(NudeSuitSP1 as Form, False, False) ; Utility.Wait(0.01) ; SleepPartner01.SnapIntoInteraction(akBed) Else Debug.Trace("[CompJenny Bed PCSleepStart] SleepPartner01 = None") EndIf If SleepPartner02 != None nTempCountArmorSP2 = 0 nTmpCountUEFiredSP2 = 0 WornSP2 = New Form[0] SleepPartner02.AddKeyword(CompJenny_SleepingWithPC) RegisterForRemoteEvent(SleepPartner02, "OnItemUnequipped") If bSP2NotRomantic NudeSuitSP2 = SkinNaked_AO Else NudeSuitSP2 = SkinNaked EndIf If SleepPartner02 == Jenny if bSP2NotRomantic NudeSuitSP2 = JennysSkinNaked_AO Else NudeSuitSP2 = JennysSkinNaked EndIf EndIf SleepPartner02.EquipItem(NudeSuitSP2 as Form, True, False) Utility.Wait(0.01) SleepPartner02.Unequipitem(NudeSuitSP2 as Form, False, False) ; Utility.Wait(0.01) ; SleepPartner02.SnapIntoInteraction(akBed) Else Debug.Trace("[CompJenny Bed PCSleepStart] SleepPartner02 = None") EndIf EndIf endEvent Event Actor.OnItemUnequipped(Actor akSender, Form akBaseObject, ObjectReference akReference) If !(akBaseObject as Armor) Return EndIf IF akSender == SleepPartner01 nTmpCountUEFiredSP1 += 1 ElseIf akSender == SleepPartner02 nTmpCountUEFiredSP2 += 1 EndIf if bPlayerSleeping && akSender == SleepPartner01 nTempCountArmorSP1 += 1 If akReference != None Debug.Trace("[CompJenny Bed Unequip] Ref Item Added to WornSP1") WornSP1.Add(akReference) Else Debug.Trace("[CompJenny Bed Unequip] BaseObject Item Added to WornSP1") WornSP1.Add(akBaseObject) EndIf StartTimer(0.05, nSP1UndressComplete) ElseIf bPlayerSleeping && akSender == SleepPartner02 nTempCountArmorSP2 += 1 If akReference != None Debug.Trace("[CompJenny Bed Unequip] Ref Item Added to WornSP2") WornSP2.Add(akReference) Else Debug.Trace("[CompJenny Bed Unequip] BaseObject Item Added to WornSP2") WornSP2.Add(akBaseObject) EndIf StartTimer(0.05, nSP2UndressComplete) EndIf EndEvent Event OnPlayerSleepStop(bool abInterrupted, ObjectReference akBed) if akBed == Self ; UnregisterForPlayerSleep() If SleepPartner01 != None SleepPartner01.SnapIntoInteraction(akBed) Utility.Wait(0.01) if SleepPartner01.GetItemCount(NudeSuitSP1) > 0 SleepPartner01.RemoveItem(NudeSuitSP1, 1) EndIf If WornSP1.Length > 0 StartTimer(Utility.RandomInt(3, 6), nTimerSP1) EndIf Else Debug.Trace("[CompJenny Bed SleepStop] SleepPartner01 = None") EndIf If SleepPartner02 != None SleepPartner02.SnapIntoInteraction(akBed) Utility.Wait(0.01) if SleepPartner02.GetItemCount(NudeSuitSP2) > 0 SleepPartner02.RemoveItem(NudeSuitSP2, 1) EndIf If WornSP2.Length > 0 StartTimer(Utility.RandomInt(3, 6), nTimerSP2) EndIf Else Debug.Trace("[CompJenny Bed SleepStop] SleepPartner02 = None") EndIf SetAllRomantic() RomanceableAry.Clear() StartTimer(5, nTimerPC) EndIf endEvent Event OnTimer(int aiTimerID) If aiTimerID == nTimerPC bPlayerSleeping = False ElseIf aiTimerID == nSP1UndressComplete UnregisterForRemoteEvent(SleepPartner01, "OnItemUnequipped") bUndressCompleteSP1 = True ElseIf aiTimerID == nSP2UndressComplete UnregisterForRemoteEvent(SleepPartner02, "OnItemUnequipped") bUndressCompleteSP2 = True ElseIf aiTimerID == nTimerSP1 If SleepPartner01 != None && WornSP1.Length > 0 Int nIdx = 0 While nIdx < WornSP1.Length if WornSP1[nIdx] != NudeSuitSP1 SleepPartner01.Equipitem(WornSP1[nIdx] as Form, False, True) EndIf Utility.Wait(0.10) nIdx += 1 EndWhile Debug.Trace("[CompJenny Bed Wakeup] SP1 Armor Count = " + (nTempCountArmorSP1 as string) + ", OnUnequip fired count = " + (nTmpCountUEFiredSP1 as string) + ", SP1 Array Length = " + (WornSP1.Length as string), 0) WornSP1.Clear() EndIf ElseIf aiTimerID == nTimerSP2 If SleepPartner02 != None && WornSP2.Length > 0 Int nIdx = 0 While nIdx < WornSP2.Length if WornSP2[nIdx] != NudeSuitSP2 SleepPartner02.Equipitem(WornSP2[nIdx] as Form, False, True) EndIf Utility.Wait(0.10) nIdx += 1 EndWhile Debug.Trace("[CompJenny Bed Wakeup] SP2 Armor Count = " + (nTempCountArmorSP2 as string) + ", OnUnequip fired count = " + (nTmpCountUEFiredSP2 as string) + ", SP2 Array Length = " + (WornSP2.Length as string), 0) WornSP2.Clear() EndIf ElseIf aiTimerID == nTimerWorker If Self.GetActorOwner() == baSupplyLineWorker Self.SetActorOwner(NONE) ;Remove synth supply line worker as owner EndIf EndIf EndEvent Function SetThisNotRomantic(Actor akNotRomantic) If akNotRomantic == SleepPartner01 SleepPartner01 = SleepPartner02 SleepPartner02 = None ElseIf akNotRomantic == SleepPartner02 SleepPartner02 = None EndIf int nIdx = 0 While nIdx < RomanceableAry.Length If RomanceableAry[nIdx] == akNotRomantic RomanceableAry[nIdx].SetValue(CA_IsRomantic, 0) EndIf nIdx += 1 EndWhile EndFunction Function FillRomanceableAry() ;Builds RomanceableAry and fills it will all companions that have CA_IsRomantic set if RomanceableAry.Length > 0 SetAllRomantic() RomanceableAry.Clear() EndIf RomanceableAry = new Actor[0] ObjectReference[] CompAry = Game.GetPlayer().FindAllReferencesWithKeyword(playerCanStimpak, 5000.0) int nIdx = 0 Actor ACur = None While nIdx < CompAry.Length ;Get list of all Romantic companions ACur = (CompAry[nIdx] as Actor) If ACur.GetValue(CA_IsRomantic) > 0 RomanceableAry.Add(ACur) EndIf nIdx += 1 EndWhile EndFunction Function SetAllRomantic() ;Restores CA_IsRomantic on all NPCs in RomanceableAry if RomanceableAry.Length int nIdx = 0 While nIdx < RomanceableAry.Length RomanceableAry[nIdx].SetValue(CA_IsRomantic, 1) nIdx += 1 EndWhile EndIf EndFunction Function SetNotRomantic() ;Clears CA_IsRomantic on all but SleepPartner01 and 02 int nIdx = 0 Actor ACur = None if !RomanceableAry.Length Debug.MessageBox("RomanceableAry is empty") EndIf While nIdx < RomanceableAry.Length If RomanceableAry[nIdx] != SleepPartner01 && RomanceableAry[nIdx] != SleepPartner02 ACur = RomanceableAry[nIdx] ACur.SetValue(CA_IsRomantic, 0) EndIf nIdx += 1 EndWhile EndFunction bool Function IsActorInRomanticArray(ObjectReference akActorRef) ;If actor is in RomanceableAry, returns True, else returns False int nIdx = 0 If !RomanceableAry.Length Return false EndIf While nIdx < RomanceableAry.Length if RomanceableAry[nIdx] == (akActorRef as Actor) Return true EndIf nIdx += 1 EndWhile Return false EndFunction -
Can't get 3rdPUseStimpakOnSelfOnGround to play
Pelgar replied to Pelgar's topic in Fallout 4's Creation Kit and Modders
That is the whole script. It's a fragment script on a topic info in a scene. Below is all of it as viewed in external editor. ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment Scriptname Fragments:TopicInfos:TIF_CompJennyIntro_010185CE Extends TopicInfo Hidden Const ;BEGIN FRAGMENT Fragment_Begin Function Fragment_Begin(ObjectReference akSpeakerRef) Actor akSpeaker = akSpeakerRef as Actor ;BEGIN CODE Actor Jenny = Alias_Jenny.GetActorRef() Jenny.PlayIdle(_3rdPUseStimpakOnSelfOnGround) ;Debug.SendAnimationEvent(Jenny, "3rdPUseStimpakOnSelfOnGround") Jenny.AddKeyword(CompJennysRevengeKW) ;END CODE EndFunction ;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment Keyword Property CompJennysRevengeKW Auto Const ReferenceAlias Property Alias_Jenny Auto Const Idle Property _3rdPUseStimpakOnSelfOnGround Auto Const -
I've tried the following as a Topic Info fragment. It compiles fine as shown below. It won't even compile if I unrem the Debug.SendAnimationEvent line. Compiling "Fragments:TopicInfos:TIF_CompJennyIntro_010185CE"... C:\Users\HarpD\AppData\Local\Temp\PapyrusTemp\Fragments\TopicInfos\TIF_CompJennyIntro_010185CE.psc(10,6): SendAnimationEvent is not a function or does not exist C:\Users\HarpD\AppData\Local\Temp\PapyrusTemp\Fragments\TopicInfos\TIF_CompJennyIntro_010185CE.psc(10,6): cannot call the member function SendAnimationEvent alone or on a type, must call it on a variable No output generated for Fragments:TopicInfos:TIF_CompJennyIntro_010185CE, compilation failed. Following compiles but animation does not play. Keyword Property CompJennysRevengeKW Auto Const ReferenceAlias Property Alias_Jenny Auto Const Idle Property _3rdPUseStimpakOnSelfOnGround Auto Const Actor Jenny = Alias_Jenny.GetActorRef() Jenny.PlayIdle(_3rdPUseStimpakOnSelfOnGround) ;Debug.SendAnimationEvent(Jenny, "3rdPUseStimpakOnSelfOnGround") Jenny.AddKeyword(CompJennysRevengeKW) I've also tried to get it to play as the On Begin and as the On End Idle in a package. Oddly it is one of the idles that plays fine in the preview when adding to package.
-
Infirmary, sick people and beds
Pelgar replied to pepperman35's topic in Fallout 4's Creation Kit and Modders
#1, Yes I think it is doable #2, Yes, sort of anyway. The kid in Vault 81, I think it's 81, the vault where you recruit Curie #3, Yes, SnapIntoInteraction(akBed) i.e. SleepPartner02.SnapIntoInteraction(akBed). They are not flat on their back, just a sleeping position.