-
Posts
1415 -
Joined
-
Last visited
Nexus Mods Profile
About LarannKiar

Profile Fields
-
Country
United States
Recent Profile Visitors
127838 profile views
LarannKiar's Achievements
Mentor (12/14)
98
Reputation
-
[Script] Remove Misc Items
LarannKiar replied to Zorkaz's topic in Fallout 4's Creation Kit and Modders
I haven't tested this code but something like this should work in vanilla: Container Property TempContainerBase Auto Const Function RemoveAllMiscItems(ObjectReference theRef) If !theRef Return None EndIf ; create a temporary container ObjectReference tempContainerRef = theRef.PlaceAtMe(TempContainerBase) If !tempContainerRef Return None EndIf ; transfer all items from theRef to the temp container theRef.RemoveAllItems(tempContainerRef) If tempContainerRef.GetItemCount() == 0 Return None EndIf Int iMaxRunCount = 1000 Int Index = 0 ; drop and check each object reference of the items While Index < iMaxRunCount && Index < tempContainerRef.GetItemCount() ObjectReference DroppedRef = tempContainerRef.DropFirstObject() ; presumably, tempContainerRef is now empty If !DroppedRef Index = iMaxRunCount Else Form ItemBase = DroppedRef.GetBaseObject() If ItemBase ; add the items which are not Misc Items back to the inventory of theRef If !(ItemBase as MiscObject) theRef.AddItem(DroppedRef) ; otherwise, remove DroppedRef.Delete() EndIf EndIf EndIf Index = Index + 1 EndWhile ; optional, move everything back to theRef's inventory that happens to be in the temp container, just in case tempContainerRef.RemoveAllItems(theRef) ; delete the temp container tempContainerRef.Delete() EndFunction -
Forcing NPC to sit in wounded position
LarannKiar replied to Zorkaz's topic in Fallout 4's Creation Kit and Modders
Perhaps this works too. theActorRef.MoveTo(theFurnitureRef) theActorRef.SnapIntoInteraction(theFurnitureRef) -
[Condition] Check if player has companion
LarannKiar replied to Zorkaz's topic in Fallout 4's Creation Kit and Modders
You can try GetPlayerTeammateCount() > 0 as well. -
If you have SF1Edit, you can try opening your mods and check their Projectile, Weapon and Object Modification records. This effect is likely from a mod.
-
Question on Player Knockdown / Getup
LarannKiar replied to RbtRvltin's topic in Starfield's Creation Kit and Modders
PushActorAway() doesn't work with the player. Someone reported this to me it earlier, I looked into it and I made a quick fix that instantly restores the player's original standing position but considering it'd probably be more useful for mods, I'd like to release it after the get up animation is fixed too. BGS intentionally chose a different design for the Gravity Wave when casted by Starborn NPCs (they cast Stagger instead of Knockdown effect) so there's chance they are aware of this issue. -
Have you tried generating LOD? Does stuttering go away if you disable a few buildings or the NPCs? AI Package target references are often persistent to ensure the package can be evaluated when the reference is unloaded. Certain combination of AI procedures that can be used for AI packages can cause stuttering but it is unlikely if it's a simple vendor package.
-
First Time Scripting Help
LarannKiar replied to SonAnima's topic in Fallout 4's Creation Kit and Modders
You could try this code: Scriptname CoolShotRifleScript extends ObjectReference Const ; if it extends ObjectReference, you either need to attach this script to the reference (since PlayerRef 0x14 is hardcoded it's not really an option) or the reference's base form (in which case all object references of this base would inherit this script) Event OnInit() ; sent when this script is initialized ; RegisterForAnimationEvent is a native function so it looks like "bool Function RegisterForAnimationEvent(ObjectReference akSender, string asEventName) native" in ScriptObject.psc; it doesn't have "EndFunction" as it's native: it's only declared in ScriptObject.psc while being defined in the native code ; "Self" is technically this script instance, so an instance of CoolShotRifleScript bound to the object the script is attached to: in this case it is an ObjectReference; the vanilla code automatically casts it to ObjectReference, that's why you don't need to type "Self as ObjectReference" (the first parameter of RegisterForAnimationEvent is ObjectReference) RegisterForAnimationEvent(Self, "weaponFire") EndEvent Function AttachModFunction() ; you could call it "user defined function" Debug.Notification("AttachModFunction called.") EndFunction Event OnAnimationEvent(ObjectReference akSource, string asEventName) ; parameters don't contain the value like Game.GetPlayer() but the type and name, e.g. ObjectReference akSource If akSource == Game.GetPlayer() && asEventName == "weaponFire" ; the anim event is called "weaponFire" as far as I remember AttachModFunction() EndIf EndEvent The notes above the native functions and events in the vanilla .psc (Papyrus script source) files aren't always in depth descriptions so you should take a look at the Creation Kit wiki. -
Reference 3D and textures aren't kept in the memory when the persistent ref is not in the loaded area regardless of persistence (by Fallout 4, I don't know whether the Creation Kit does but I doubt it). Having too many loose files can increase the loading time of the Creation Kit. I think if you remove the Persistent flag in FO4Edit and it should automatically move the ref to the non persistent Worldspace record.
-
There seem to be several conditions of the "excess dead" cleanup but I can't see anything related to their Encounter Zone. The cleanup code looks for Quest Alias data which ApplyToRef() adds to the reference. I don't know if it gets removed OnDeath() so maybe this is the why they can't be removed. I'll look into this later.