Jump to content

[FO4 CK] General Help Thread


Recommended Posts

Posted (edited)

There are rain occlusion planes. I don't remember why now but there was a reason why I never tried to use them.

 

A kind of common (but not super precise) method to determine shelter is to do proximity detection on the indoor audio muffler objects that bethesda uses. But it's bethesda and they don't always include them where they'd be appropriate. And you could be directly opposite a building/wall, in the open but still in range, where it's not what you want. Generally its an OK solution but there will be oddities.

 

My preferred option is to shoot invisible projectiles in a configurable pattern from my point of interest, where every projectile leaves a detectable temporary object (where/if it 'hits' something with collision). It has the added bonus that I can detect ceilings, walls, floors, holes in all of them. If you do it sensibly, it's very surprising how quickly and accurately you can paint the picture around you.

 

Keep in mind you have a lot of control over things like projectiles. How fast they will move and in tandem how far they will travel before they expire.

 

 

Edited by Carabosse
Posted (edited)

Frustrating issue... I posted about it some months back but still haven't found the cause nor any solution/workaround, so I'll restate it in greater detail in hopes someone else has some clue to point me in the right direction:

 

I have a custom interior cell. It's not a workshop or anything fancy, just a cave (I copied the Vault 88 caverns, cleaned out all the triggers and stuff, and trimmed out a lot of the space to get a basic medium-sized cave complex, then proceeded to add stuff). The mod starts out with the player using a placed activator in the Commonwealth worldspace which teleports them to that interior, and things generally work as designed.

 

Here's the problem though. If I visit that custom cell once (by using the mod's teleport activator or even just coc in the console), then load a save from before visiting that cell for the first time and visit it again, things are missing. Placed Havok objects are the most common loss, but also outfits on corpses, decals, sometimes furniture, occasionally even some of the unique NPCs. Exiting to the menu and then loading and visiting the cell doesn't fix anything, but exiting all the way to the desktop and then going back in does as long as I'm not loading a save made when things were missing from the cell.

 

This seems a lot like the never-fixed vanilla game bug with mines and floor traps disappearing if you load a save from before triggering them without exiting all the way out first, just on a much grander and far more annoying scale. I've also noticed that blood stain and paint spatter decals disappear frequently if I leave the cell and return to it, and attached scripts seem to sometimes stop being attached to objects in the cell as well (particularly the vanilla defaultdisablehavokonload I add to some loose items and movable statics). First, has anyone else ever observed this? But more importantly, any idea what I should do about it?

 

One thing that comes to mind is it's a large-ish cell with a lot of refs and I haven't built any precombines/previsualizations yet (though I plan to of course). Maybe the game just gives up trying to load everything sometimes, but that would be weird to only experience when loading and then repeating a first visit for that save.

 

Edit: Another thing I haven't done yet is to break the cell up with roombounds and portals, is that likely going to help?

Edited by vaultbait
Posted

First thing I'd say is that copy pasting/duplication from or of other cells is something I'd avoid entirely. I get why people do it but depending on your CK knowledge you might be causing extra issues for yourself and more importantly, other modders.

 

I think it's unlikely that its some kind of inherent bug with the CK. If you've just duplicated or copy pasted assets then the only person who can judge the state of lighting bounds, portaling etc is yourself.

 

I'd load up your mod in FO4Edit and look for conflicts with the cell/assets that you originally copied as a first port of call.

Posted
9 minutes ago, Carabosse said:

First thing I'd say is that copy pasting/duplication from or of other cells is something I'd avoid entirely. I get why people do it but depending on your CK knowledge you might be causing extra issues for yourself and more importantly, other modders.

 

I think it's unlikely that its some kind of inherent bug with the CK. If you've just duplicated or copy pasted assets then the only person who can judge the state of lighting bounds, portaling etc is yourself.

 

I'd load up your mod in FO4Edit and look for conflicts with the cell/assets that you originally copied as a first port of call.

 

Oh, absolutely, that's a great point. I pretty rigorously sanitized everything (basically just left cave corridors and some ambient effects like wind and rumble triggers, along with some moss and debris decals). I already scoured it in FO4Edit and the mod doesn't touch any vanilla entries at all, only adds new refs in a new cell. I made sure to remove all the keywords, add new location and encounter zone, replace the navmesh and so on. In fact, none of the things I copied seem to be exhibiting this problem, though I suppose I can't rule them out as a potential cause.

 

Are light bounding boxes likely to cause objects not to get loaded at random? I removed all the original roombounds and portals, with the expectation that I'd create more appropriate ones from scratch later.

Posted (edited)

I can use Skyrim's papyrus compiler, but I'm getting an error with Fallout 4's papyrus compiler.

 

As an example, when I try to compile a file named ThreePMSFScript.psc, I get the following error:

Quote

filename does not match script name: "threepmsf:threepmsfscript" expected: "ThreePMSFScript"

 

It will only compile if I change:

Quote

ScriptName ThreePMSF:ThreePMSFScript extends Quest

to:

Quote

ScriptName ThreePMSFScript extends Quest

 

 

I'm compiling outside of the CK via the command line with the following (where <dirs> is a long list of source folders):

Quote

.../steamapps/common/Fallout 4/Papyrus Compiler/PapyrusCompiler ThreePMSFScript.psc -op -f=S:\Data\SteamLibrary\steamapps\common\Fallout 4\\Data\Scripts\Source\Base\Institute_Papyrus_Flags.flg -release -final -i='<dirs>'

 

 

This approach works fine for Oldrim and SSE.   But I get the scriptname error for Fallout 4.

 

I'm guessing the changed shortened scriptname might be why the OnQuestInit doesn't run.

 

Is there some option to the PapyrusCompiler I should be using to make it happy with the two-part scriptname?

Edited by MikeWander
Posted
3 hours ago, MikeWander said:

I can use Skyrim's papyrus compiler, but I'm getting an error with Fallout 4's papyrus compiler.

 

As an example, when I try to compile a file named ThreePMSFScript.psc, I get the following error:

 

It will only compile if I change:

to:

 

 

I'm compiling outside of the CK via the command line with the following (where <dirs> is a long list of source folders):

 

This approach works fine for Oldrim and SSE.   But I get the scriptname error for Fallout 4.

 

I'm guessing the changed shortened scriptname might be why the OnQuestInit doesn't run.

 

Is there some option to the PapyrusCompiler I should be using to make it happy with the two-part scriptname?

 

Back when I was first getting started with understanding FO4's Papyrus, and after far too much trial and error trying to follow all the https://www.creationkit.com/fallout4/index.php?title=Papyrus_FAQs suggestions, I was finally able to work out recompile one of Violate's scripts from the command line. I use bindings in my editor instead these days, but according to my notes here's what my commands line looked like:

 

cd "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User"

"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler" "FPV_MCM_Script.psc" -i="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base;C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User" -o="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts" -f="Institute_Papyrus_Flags.flg"

 

More recently I've switched to https://www.creationkit.com/fallout4/index.php?title=Notepad%2B%2B so now it's just a drop-down menu option any time I want to recompile, without needing to pull up a separate command window.

Posted
4 hours ago, vaultbait said:

 

Back when I was first getting started with understanding FO4's Papyrus, and after far too much trial and error trying to follow all the https://www.creationkit.com/fallout4/index.php?title=Papyrus_FAQs suggestions, I was finally able to work out recompile one of Violate's scripts from the command line. I use bindings in my editor instead these days, but according to my notes here's what my commands line looked like:

 

cd "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User"

"C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Papyrus Compiler\PapyrusCompiler" "FPV_MCM_Script.psc" -i="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base;C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User" -o="C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts" -f="Institute_Papyrus_Flags.flg"

 

More recently I've switched to https://www.creationkit.com/fallout4/index.php?title=Notepad%2B%2B so now it's just a drop-down menu option any time I want to recompile, without needing to pull up a separate command window.

 

Thanks.   Looks pretty similar to what I'm doing.   Hmmm.   Given the paths you're using, I'm wondering if your command shell was launched via MO2 such that you were using MO2's virtual folders to pull all the sources from various mods into one folder?

Posted
9 hours ago, MikeWander said:

Thanks.   Looks pretty similar to what I'm doing.   Hmmm.   Given the paths you're using, I'm wondering if your command shell was launched via MO2 such that you were using MO2's virtual folders to pull all the sources from various mods into one folder?

 

Oh, you're one of those people. ?

 

Sadly I can't help with regard to MO2's virtual filesystem thingy. I'm just a Vortex user, so my sources unpack into the location the CK expects them to be by default.

Posted
12 hours ago, vaultbait said:

 

Oh, you're one of those people. ?

 

Sadly I can't help with regard to MO2's virtual filesystem thingy. I'm just a Vortex user, so my sources unpack into the location the CK expects them to be by default.

 

Compiling a file within the steam tree doesn't help issue.

 

Turns out the problem is that when colons are used for the ScriptName, you can compile in the CK but cannot easily compile via the command line.

It's documented briefly at https://www.creationkit.com/fallout4/index.php?title=Papyrus_FAQs#When_I_try_to_compile_namespaced_scripts_outside_the_Creation_Kit.2C_my_scripts_always_fail_to_compile._Help.21

Posted (edited)
15 hours ago, MikeWander said:

Compiling a file within the steam tree doesn't help issue.

 

Turns out the problem is that when colons are used for the ScriptName, you can compile in the CK but cannot easily compile via the command line.

It's documented briefly at https://www.creationkit.com/fallout4/index.php?title=Papyrus_FAQs#When_I_try_to_compile_namespaced_scripts_outside_the_Creation_Kit.2C_my_scripts_always_fail_to_compile._Help.21

 

Interesting! I had never spotted that tidbit. I wonder how people deal with it in Notepad++ integration, whether there are subtle tricks you can play in the command line it constructs or whether people working on namespaced scripts use something like Visual Studio instead and rebuild the whole set every time.

 

Edit: In retrospect it makes me glad I was lazy on the current mod I'm developing and didn't bother to namespace all my scripts. Maybe I unknowingly dodged a bullet there.

Edited by vaultbait
Posted
On 11/23/2022 at 11:39 AM, vaultbait said:

 

Interesting! I had never spotted that tidbit. I wonder how people deal with it in Notepad++ integration, whether there are subtle tricks you can play in the command line it constructs or whether people working on namespaced scripts use something like Visual Studio instead and rebuild the whole set every time.

 

Edit: In retrospect it makes me glad I was lazy on the current mod I'm developing and didn't bother to namespace all my scripts. Maybe I unknowingly dodged a bullet there.

 

Looks like using a "project file" might allow you to use namespaces outside of the CK, but I didn't dig into it.

Posted
9 hours ago, MikeWander said:

 

Looks like using a "project file" might allow you to use namespaces outside of the CK, but I didn't dig into it.

 

Just for the record, this week I started making a new mod (a trigger plugin for RMR v2) and based it on the script source for an existing mod. The script is namespaced because the one from the mod I based it on was too, and Notepad++ had no problems calling the compiler for it without any project file.

Posted

Hi, can you tell me why my character occasionally turns or changes position when talking to other characters?
It is definitely a mod.
Could it be some mod that changes the character's pose?
Can you fix the mod without uninstalling the mod that is causing this funny problem?

Posted (edited)
32 minutes ago, Balmung889 said:

Hi, can you tell me why my character occasionally turns or changes position when talking to other characters?
It is definitely a mod.
Could it be some mod that changes the character's pose?
Can you fix the mod without uninstalling the mod that is causing this funny problem?

 

That's a very vague description, and what's possible will depend a lot on how it's implemented. My first guess would be the popular Player Comments and Head Tracking mod, in which case that behavior is an integral feature of the mod itself. Is it just the head turning/changing position, or is the player character's entire body changing to a different pose?

 

Edit: Also this is a help topic for discussing the Creation Kit, not a general Fallout 4 help topic. I can't quite tell if you're asking about this so you can use the CK to make a mod to change the described behavior, or if you've inadvertently posted your question in the wrong place.

Edited by vaultbait
Posted
4 minutes ago, vaultbait said:

 

That's a very vague description, and what's possible will depend a lot on how it's implemented. My first guess would be the popular Player Comments and Head Tracking mod, in which case that behavior is an integral feature of the mod itself. Is it just the head turning/changing position, or is the player character's entire body changing to a different pose?

 

Edit: Also this is a help topic for discussing the Creation Kit, not a general Fallout 4 help topic. I can't quite tell if you're asking about this so you can use the CK to make a mod to change the described behavior, or if you've inadvertently posted your question in the wrong place.

I'm sorry, I don't speak English, I let the translators do the work.

 

Basically during the dialogues my character changes position, BUT without animation.
While he is positioned frontally, suddenly, a moment later he is on his back.

 

It's not a game-breaking thing. It's just ugly to look at and spoils the immersion.

Posted

I'm back with more modding questions... two this time, related to work in progress for the next version of Unhealthy Craving.

 

First, I'm trying to add soft integration to detect when someone is wearing high heels with HHS. I can see in the Papyrus stub for its F4SE plugin there are global native functions like HHS.GetFloatHeight_HHS() and HHS.HasHeight_HHS() but any time I try to call these with Utility.CallGlobalFunction() they return None regardless of whether my test character has heels on. Code for a basic reproducer looks like this (granted I'm doing much more complex things around it in reality):

 

var[] Parameters = new var[1]
Parameters[0] = Game.GetPlayer()
Debug.Notification("Heel height: " + Utility.CallGlobalFunction("HHS", "GetFloatHeight_HHS", Parameters))

 

This displays "Heel height: None" in game for me when called in a quest script. Same for HasHeight_HHS. I can't help but think that I'm overlooking something super simple.

 

The other challenge I have is that I'm trying to detect the player jumping. I gather there is a jumpUp animation event I can register for, but when I do it in my quest script it doesn't ever seem to fire. Code looks something like this:

 

Event Actor.OnPlayerLoadGame(Actor akSender)
    RegisterForAnimationEvent(Game.GetPlayer(), "jumpUp")
EndEvent

Event OnAnimationEvent(ObjectReference akSource, string asEventName)
    If asEventName == "onJump"
        Debug.Notification("Jumping jacks!")
    EndIf
EndEvent

 

Should that work? Also, is there a way to register for all animation events so I can debug more easily which events are being generated? I tried using an empty string for the event when registering, but my quest script never seems to fire OnAnimationEvent at all.

Posted (edited)
1 hour ago, vaultbait said:

First, I'm trying to add soft integration to detect when someone is wearing high heels with HHS. I can see in the Papyrus stub for its F4SE plugin there are global native functions like HHS.GetFloatHeight_HHS() and HHS.HasHeight_HHS() but any time I try to call these with Utility.CallGlobalFunction() they return None regardless of whether my test character has heels on. Code for a basic reproducer looks like this (granted I'm doing much more complex things around it in reality):

 

var[] Parameters = new var[1]
Parameters[0] = Game.GetPlayer()
Debug.Notification("Heel height: " + Utility.CallGlobalFunction("HHS", "GetFloatHeight_HHS", Parameters))

 

This displays "Heel height: None" in game for me when called in a quest script. Same for HasHeight_HHS. I can't help but think that I'm overlooking something super simple.

 

HHS functions expect parameters as ObjectReference not as Actor. Usually compiler would attempt to save you by doing the casting for you but for these 'callfunction' style

functions this is not the case (see notes in docs) so you gotta be careful and do it yourself. Also those functions returns a Var and you would cast that into a type you expect.

This piece of code in a quest script works on my machine (you should do some errorchecking since this is soft integration, might be able to check if return Var is None or something):

 

Var[] params = new Var[1]
params[0] = Game.GetPlayer() as ObjectReference
Bool hhs = Utility.CallGlobalFunction("HHS", "HasHeight_HHS", params) as Bool
Debug.MessageBox("Player is wearing some heels: "+hhs+"?")

 

There is a typo in your jumping detection code where you register for event 'jumpUp' but filter for 'onJump' when handling animation events.

This works on my machine and prints notification "onanimationevent: jumpUp" as expected when PC jumps:

 

Event Actor.OnPlayerLoadGame(Actor akSender)
    RegisterForAnimationEvent(Game.GetPlayer(), "jumpUp")
EndEvent

Event OnAnimationEvent(ObjectReference akSource, string asEventName)
    ; you'll want to filtering on AsEventName if your script is
    ; listening to multiple different events
    Debug.Notification("onanimationevent: "+asEventName)
EndEvent

 

There is no way to get wildcard animationevents that I know of with papyrus but here is a misc list of animation event names apparently extracted from behavior file

https://www.creationkit.com/fallout4/index.php?title=User:Scrivener07/Behaviors ].

Edited by requiredname65
Posted

i'm trying to edit a quest but i keep getting "failed to load code for fragment" errors for everything in the mod, but i have the sources extracted and if i press edit script, the fragment still opens up in notepad. Also if i open up another mod, the fragments load up fine

Posted
2 hours ago, requiredname65 said:

HHS functions expect parameters as ObjectReference not as Actor.

 

Thanks! That seems to be the bit I was overlooking. I've generally been careful about CallFunction* needing precise casting, but for some reason assumed the HHS functions expected Actor type rather than ObjectReference.

 

2 hours ago, requiredname65 said:

There is a typo in your jumping detection code where you register for event 'jumpUp' but filter for 'onJump' when handling animation events.

 

Ouch, that's embarrassing. ? In real life I'm far too dependent on peer review and automated tests for my code. Lesson learned!

 

2 hours ago, requiredname65 said:

here is a misc list of animation event names apparently extracted from behavior file

https://www.creationkit.com/fallout4/index.php?title=User:Scrivener07/Behaviors ].

 

Amazing! I searched high and low and only found a smattering of them documented in another page on that wiki. Bookmarked in triplicate now. Also looks like my unasked question about events for ending swimming is probably answered, I'll have to go with a magic effect and the IsSwimming condition in CK, then catch the effect starting and finishing.

Posted (edited)
9 minutes ago, g0hahi said:

i'm trying to edit a quest but i keep getting "failed to load code for fragment" errors for everything in the mod, but i have the sources extracted and if i press edit script, the fragment still opens up in notepad. Also if i open up another mod, the fragments load up fine

 

Does the compile button for one of the stages with a fragment work, or does it report an error? Wondering if maybe there's a syntactic problem in the script fragment which is blocking recompilation.

 

Also, do the fragments possibly use functions from some other mod you don't have the script sources installed for?

 

Edit: Oh, also, if they're using extended functions provided by F4SE, keep in mind that the latest version of it has the script sources in the wrong directory and you need to add them to Data\Script\Source\User instead.

Edited by vaultbait
Posted
17 minutes ago, vaultbait said:

 

Does the compile button for one of the stages with a fragment work, or does it report an error? Wondering if maybe there's a syntactic problem in the script fragment which is blocking recompilation.

 

Also, do the fragments possibly use functions from some other mod you don't have the script sources installed for?

 

Edit: Oh, also, if they're using extended functions provided by F4SE, keep in mind that the latest version of it has the script sources in the wrong directory and you need to add them to Data\Script\Source\User instead.

there are no outside functions, or f4se ones, and the compile button is greyed out. i'll check for errors in the source, thanks for the help

Posted
14 minutes ago, g0hahi said:

the compile button is greyed out

 

Oh. you may need to make a minor edit in the fragment text box like adding an extra space anywhere or something similarly innocuous. I don't think it will let you click the compile button unless if thinks you've changed the fragment in some way first.

Posted
21 minutes ago, vaultbait said:

 

Oh. you may need to make a minor edit in the fragment text box like adding an extra space anywhere or something similarly innocuous. I don't think it will let you click the compile button unless if thinks you've changed the fragment in some way first.

well i extracted every source file, edited the syntax and it still throws the error. the fragment box doesnt let me edit it btw

Posted
48 minutes ago, g0hahi said:

well i extracted every source file, edited the syntax and it still throws the error. the fragment box doesnt let me edit it btw

 

Does the source files contain comment markers like these:

    ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment

    ;BEGIN FRAGMENT Fragment_Stage_0010_Item_00

    ;BEGIN CODE

and corresponding end markers? If these are missing then CK won't load that script in editor.

If not then those markers can be manually added with external text editor after the fact

(may need a CK reboot, or to be safe exit it before editing) and it will work.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...