Jump to content

[FO4 CK] General Help Thread


Recommended Posts

3 hours ago, Gourmetos said:

Hi Everyboy,

 

I'm pretty new to working with papyrus and modding Bethesda games, after creating some very simple mods not worth uploading anywhere I decided to try myself on an extension for the "Beta: Bad Ends Furniture 0.1 beta 2 Mod" made by Kharos.

 

The goal is to include the additional Bad End Furnitures as well.

So far everything worked well end I was able to edit and compile all scripts of the original mod except for one: the library script.

The following compiling errors are given to me:

"

GetTemplate is not a function or does not exist

type mismatch while assigning to a actorbase (cast missing or types unrelated)

GetDisplayName is not a function or does not exist

type mismatch while assigning to a string (cast missing or types unrelated)

GetWornItem is not a function or does not exist

void is not a known user-defined script type

GetWornItemMods is not a function or does not exist

type mismatch while assigning to a objectmod[] (cast missing or types unrelated)

GetInventoryItems is not a function or does not exist

type mismatch while assigning to a form[] (cast missing or types unrelated)

"

 

Most solutions I could find online are related to F4SE and it's additional scripts, e.g. "GetWornItem & GetWornItemMods" are functions added by F4SE.

However, after checking multiple times and following guides online, all F4SE srcipts seem to be placed correctly inside my game folders under ...Data/Scripts and ...Data/Scripts/Source.

Currently, I'm running CK through MO2 since I installed all my mods over MO2. Could this lead to problems?

 

I attached the original library sript, which I'm also not able to compile (same errors).

I'm convinced I'm overlooking/missing something simple here and beeing dumb due to my inexperience.

 

Any help and tips are greatly appreciated ☺️

Library.psc 9.69 kB · 0 downloads

 

 

The current version of F4SE has its script sources packed in the wrong directory. When you unpack it, move all the PSC files into the Data\Scripts\Source\User folder. Hopefully some day the maintainer will fix that.

Link to comment
1 hour ago, vaultbait said:

 

The current version of F4SE has its script sources packed in the wrong directory. When you unpack it, move all the PSC files into the Data\Scripts\Source\User folder. Hopefully some day the maintainer will fix that.

Thank you! 

Holy moly I feel stupid now, but that did it.

 

Sorry to follow up with another question immediately, but for some reason ck doesn't let me pick the according actor actions for the script.

 

image.png.cc8e8504de6ca4c5c48f925f54c3b637.png

 

I need to add "ActionBleedOutStart" and "ActionBleedOutStop" as values for properties by the same name.

However, in the PickObject dropdown window only a fraction of actor action are shown, not the ones I need.

 

If I click "Auto-Fill", CK even finds the right actor actions an puts them in as values, but clears them as soon as I hit "OK".

 

Could this be related to the script?

 

If I figure this out, I should finally be able to start testing ingame.

Again, thanks in advance!

 

Link to comment
1 hour ago, Gourmetos said:

Thank you! 

Holy moly I feel stupid now, but that did it.

 

Sorry to follow up with another question immediately, but for some reason ck doesn't let me pick the according actor actions for the script.

 

image.png.cc8e8504de6ca4c5c48f925f54c3b637.png

 

I need to add "ActionBleedOutStart" and "ActionBleedOutStop" as values for properties by the same name.

However, in the PickObject dropdown window only a fraction of actor action are shown, not the ones I need.

 

If I click "Auto-Fill", CK even finds the right actor actions an puts them in as values, but clears them as soon as I hit "OK".

 

Could this be related to the script?

 

If I figure this out, I should finally be able to start testing ingame.

Again, thanks in advance!

 

 

Sadly, Bethesda didn't plumb Action object support in the CK's script property manager. Do something miserably ugly like this:

 

Action Property ActionInteractionExit Auto Hidden ; Can't be filled from the CK

Event SomeStartupEvent()
    ActionInteractionExit = Game.GetForm(0x2248D) as Action ; sigh... Bethesda
EndEvent

Function ExitFurniture(Actor akActor)
    akActor.PlayIdleAction(ActionInteractionExit)
EndFunction

 

Link to comment
1 hour ago, vaultbait said:

 

Sadly, Bethesda didn't plumb Action object support in the CK's script property manager. Do something miserably ugly like this:

 

Action Property ActionInteractionExit Auto Hidden ; Can't be filled from the CK

Event SomeStartupEvent()
    ActionInteractionExit = Game.GetForm(0x2248D) as Action ; sigh... Bethesda
EndEvent

Function ExitFurniture(Actor akActor)
    akActor.PlayIdleAction(ActionInteractionExit)
EndFunction

 

Thanks for responding so quick!

 

Here's what I came up with:

image.png.4adbcd97693df84c7828769b264b476c.png

 

OnLoad seems to be the most logical choise, however I'm getting the following message:

"new event onload cannot be defined because the script is not flagged as native"

 

The rest seems to be good.

Is there a way to bypass the error?

All good things come in threes, so this is hopefully the last time I need your help with this.

 

 

Link to comment
4 minutes ago, Gourmetos said:

OnLoad seems to be the most logical choise, however I'm getting the following message:

"new event onload cannot be defined because the script is not flagged as native"

 

What object type does your script extend? If it's a Quest script, for example, you probably want to use the OnQuestInit event, for example. I've only ever used OnLoad events in ObjectReference scripts, but your best bet is to use the CK Wiki to find what events are relevant for whatever you've attached the script to.

Link to comment
58 minutes ago, vaultbait said:

 

What object type does your script extend? If it's a Quest script, for example, you probably want to use the OnQuestInit event, for example. I've only ever used OnLoad events in ObjectReference scripts, but your best bet is to use the CK Wiki to find what events are relevant for whatever you've attached the script to.

 

You we're right again, had to make some tweaks and finally managed to compile the script.

 

For everybody who might have similar issues in the future regarding the actor actions, here's the version that's working:

image.png.41140929d8e59dd343996fdcd3af8fcc.png

 

If everything works out, maybe I'll finally be able to share a somewhat usefull mod on LL.

 

@Breeding Sow

Thanks for helping me and being patient with my questions!

 

Link to comment
46 minutes ago, Gourmetos said:

@Breeding Sow

Thanks for helping me and being patient with my questions!

 

It's my pleasure. I too ask questions in here too, in hopes people who know more than I do will offer useful hints. so I answer what I can in return. This shit is complicated, and there's only so much documented (or documentable for that matter).

 

Now if somebody with background on the Shockwave/Flash file format restrictions for perk icons will just chime in, maybe I can turn some of my custom art into usable images in my mods.

Link to comment
On 9/27/2023 at 1:55 PM, vaultbait said:

Does anyone happen to know what the requirements are for an SWF image to be displayable on perk details in the Pip-Boy? I can set arbitrary perk SWF files from the base game on my mods' custom perks and they display fine. When I create an SWF of my own and point the perk record to that, I just see a blank space in the Pip-Boy where it should be displayed.

 

The SWF files are generally valid since I can view them just fine in JPEXS Flash Decompiler or Eolsoft Flash Movie Player. They're each a single-frame of vector art, nothing complicated. They were converted from SVG format using the Windows build of the svg2swf command-line utility. I'm attaching one for inspection in case anyone can spot the problem...

SizeQueenPerk00.swf 26.1 kB · 7 downloads

 

Edit: Obviously I'll need to convert them to monochrome. Some side-by-side comparison with decompiled SWF files from the game suggests that they have uniform dimensions, framerate, background color... I guess I should try to conform mine to those parameters and see if any of that is the problem.

 

Moar edit: I've about run out of threads to pull. I adjusted the dimensions, framerate, compression, signature type, version, background color, etc to match an existing perk image that works, to no avail. I removed the embedded background shape that svg2swf seems to have added as well, but that didn't seem to help either. Short of buying Adobe Animator (assuming they haven't discontinued it entirely), I'm not sure what else to try.

 

What are other creators using to make their perk images? I suppose I should ask them directly...

 

Yay! After much asking around and hounding other mod authors, I've discovered that a separate SVG to SWF conversion utility is unnecessary. Apparently, JPEXS includes the ability to import shapes directly from SVG (and similar vector formats).

 

The short answer is to extract one of Bethesda's perk clip vaultboy SWFs from a vanilla game BA2 (pick the simplest one you can find, I used Gage's companion perk from Nuka World since it only had a few shapes to start with), open it in JPEXS, select a shape and click the "replace" button over toward the bottom right which will then bring up a file selection dialogue, choose the SVG you want to import, and repeat for replacing any other shapes as necessary. Once done, delete any left over shapes and their corresponding frames, then save the file to whatever name you're going to reference in the CK. Quick and easy.

 

...just wish I hadn't spent so much time banging my head against the problem. ?

Link to comment
52 minutes ago, vaultbait said:

 

Yay! After much asking around and hounding other mod authors, I've discovered that a separate SVG to SWF conversion utility is unnecessary. Apparently, JPEXS includes the ability to import shapes directly from SVG (and similar vector formats).

 

The short answer is to extract one of Bethesda's perk clip vaultboy SWFs from a vanilla game BA2 (pick the simplest one you can find, I used Gage's companion perk from Nuka World since it only had a few shapes to start with), open it in JPEXS, select a shape and click the "replace" button over toward the bottom right which will then bring up a file selection dialogue, choose the SVG you want to import, and repeat for replacing any other shapes as necessary. Once done, delete any left over shapes and their corresponding frames, then save the file to whatever name you're going to reference in the CK. Quick and easy.

 

...just wish I hadn't spent so much time banging my head against the problem. ?

I am glad you figured out the problem and it is a good solution...

 

Now my head hurts with all the tech comments... LOL :P

 

Keep up the great work and expanding your understanding.

Link to comment
  • 1 month later...
1 hour ago, truman1990 said:

Question regarding performance for Perk Effects. What is better?
- To add one ability to perk with multiple effects or

- To have multiple abilities in perk with simple effect

 

Can you try to rephrase this? It's not clear what the difference is between the two options you presented.

 

As for performance hits from perks and effects, my understanding is that it mostly boils down to the aggregate complexity of the condition statements being checked for them. A few effects with many condition rules or many perks with comparatively few conditions probably perform about the same. If you're worried about performance, reducing the total number of condition rules helps.

 

Also, effects which have scripts attached have a very significant performance impact, so try to minimize the number of times the scripting engine is triggered for an effect starting or stopping.

Link to comment
2 hours ago, vaultbait said:

 

Can you try to rephrase this? It's not clear what the difference is between the two options you presented.

 

As for performance hits from perks and effects, my understanding is that it mostly boils down to the aggregate complexity of the condition statements being checked for them. A few effects with many condition rules or many perks with comparatively few conditions probably perform about the same. If you're worried about performance, reducing the total number of condition rules helps.

 

Also, effects which have scripts attached have a very significant performance impact, so try to minimize the number of times the scripting engine is triggered for an effect starting or stopping.

I am trying to understand how each "SPELL" works and how does it affect a perk. (not that fluent in this yet)

 

- What does Perk Condition do for a spell in a perk?
i.e. If SAKR lower body value 60 - 80 then add 30 DR, if above 80 then add 50 DR (so should I set up two abilities that have condition BETWEEN 60-80 and then 80+ or one ability that has those both conditions in Effect Condition.

"effects which have scripts" - which are those?

Link to comment
16 minutes ago, truman1990 said:

- What does Perk Condition do for a spell in a perk?
i.e. If SAKR lower body value 60 - 80 then add 30 DR, if above 80 then add 50 DR (so should I set up two abilities that have condition BETWEEN 60-80 and then 80+ or one ability that has those both conditions in Effect Condition.

 

If you're talking about perk entrypoint conditions, the set of conditions you include has to be satisfied for the entrypoint to take effect.

 

18 minutes ago, truman1990 said:

"effects which have scripts" - which are those?

 

Any effect which has a script attached to it, in the scripts list you'll see for the effect details when looking at one in the CK. If the scripts box is empty, there is no script set for that effect. Most vanilla game effects don't have scripts associated with them. Many mod-added effects do though, because the things you can accomplish entirely within the game engine is limited, so mod authors often have to fall back on scripts to create more complex interactions.

Link to comment
13 hours ago, vaultbait said:

 

If you're talking about perk entrypoint conditions, the set of conditions you include has to be satisfied for the entrypoint to take effect.

 

 

Any effect which has a script attached to it, in the scripts list you'll see for the effect details when looking at one in the CK. If the scripts box is empty, there is no script set for that effect. Most vanilla game effects don't have scripts associated with them. Many mod-added effects do though, because the things you can accomplish entirely within the game engine is limited, so mod authors often have to fall back on scripts to create more complex interactions.

Thank you for clarification! I am a dummy with not that much of time, and do some personal fixes mostly through FO4Edit. Still, Thank You.

Link to comment
2 hours ago, truman1990 said:

Thank you for clarification! I am a dummy with not that much of time, and do some personal fixes mostly through FO4Edit. Still, Thank You.

 

In that case, when you're in FO4Edit the VMAD tree inside the magic effect record should have a node for a list of scripts. In there you'll see subtrees for the individual scripts (if any) as well as their respective properties.

Link to comment
  • 3 weeks later...

Hello everyone

 

Is there a good explanation of Biped Slots somewhere?

There is a list for Biped slots both for Armor and Armor Addon.

 

I have created a very skimpified version of the Skyrim Conversions and would like to allocate the slots for the clothiong there sensibly.

Only Bodyslot 33 probably doesn't make much sense because of the outfits, some also have meshes for feet, hands and head too.

 
 
 
Link to comment
11 minutes ago, Kanlaon said:

Is there a good explanation of Biped Slots somewhere?

There is a list for Biped slots both for Armor and Armor Addon.

 

I have created a very skimpified version of the Skyrim Conversions and would like to allocate the slots for the clothiong there sensibly.

Only Bodyslot 33 probably doesn't make much sense because of the outfits, some also have meshes for feet, hands and head too.

 

I'm not sure what kind of explanation you're looking for, but here goes...

 

Basically, make sure whatever biped slots you add to an armor (ARMO) record are identical to the ones you add to the corresponding armor addon (ARMA) record.

 

A wearable item can have multiple biped slots, in which case you're saying the item occupies those locations on the actor. For example, a shirt may occupy the torso and arms but not the legs, while pants may occupy the legs but not the torso and arms, in which case you can wear that shirt with those pants because they don't conflict. An actor can only equip items together when they don't have conflicting biped slots.

 

There are basically 3 "layers" of an outfit from the vanilla game's perspective, which correspond to groups of biped slots. The outermost is the armor slots, below those the underarmor slots, and below those are the body. Armor meshes get automatically distorted by the game if the corresponding underarmor slots are occupied, and this can be controlled with "underarmor scaling" values in the records of individual items.

 

The body slot is special, intended for full-body outfits which include a body/skin mesh or completely cover the body. Many of the vanilla game one-piece outfits and underarmors also occupy the body slot, for example. When the player is wearing nothing, a default body gets "worn" that occupies only the body slot, in the vanilla game this has undergarments (briefs and possibly a bra depending on the gender) but with body replacer mods it may have a nude texture instead.

 

Head and hair slots are also somewhat special, as the mesh files for e.g. hats can include instructions to automatically hide hair when worn even though they use separate biped slots.

 

Many slots are marked as "unused/unknown" and are frequently co-opted by mods for accessories or separates.

 

Weapons use biped slots too, but these have higher index numbers and can't be occupied by normal clothing and armor.

 

What else are you wanting to know?

Link to comment
31 minutes ago, vaultbait said:

 

I'm not sure what kind of explanation you're looking for, but here goes...

 

Basically, make sure whatever biped slots you add to an armor (ARMO) record are identical to the ones you add to the corresponding armor addon (ARMA) record.

 

A wearable item can have multiple biped slots, in which case you're saying the item occupies those locations on the actor. For example, a shirt may occupy the torso and arms but not the legs, while pants may occupy the legs but not the torso and arms, in which case you can wear that shirt with those pants because they don't conflict. An actor can only equip items together when they don't have conflicting biped slots.

 

There are basically 3 "layers" of an outfit from the vanilla game's perspective, which correspond to groups of biped slots. The outermost is the armor slots, below those the underarmor slots, and below those are the body. Armor meshes get automatically distorted by the game if the corresponding underarmor slots are occupied, and this can be controlled with "underarmor scaling" values in the records of individual items.

 

The body slot is special, intended for full-body outfits which include a body/skin mesh or completely cover the body. Many of the vanilla game one-piece outfits and underarmors also occupy the body slot, for example. When the player is wearing nothing, a default body gets "worn" that occupies only the body slot, in the vanilla game this has undergarments (briefs and possibly a bra depending on the gender) but with body replacer mods it may have a nude texture instead.

 

Head and hair slots are also somewhat special, as the mesh files for e.g. hats can include instructions to automatically hide hair when worn even though they use separate biped slots.

 

Many slots are marked as "unused/unknown" and are frequently co-opted by mods for accessories or separates.

 

Weapons use biped slots too, but these have higher index numbers and can't be occupied by normal clothing and armor.

 

What else are you wanting to know?

 

Basically I don't understand anything :(.
It feels like trying to explain  a fish how to fly.

 

I can make some screenshots and send them with private message if you want to help me more.

Link to comment
22 minutes ago, Kanlaon said:

 

Basically I don't understand anything :(.
It feels like trying to explain  a fish how to fly.

 

I can make some screenshots and send them with private message if you want to help me more.

 

I try not to provide support in private. Keeping questions and answers on the public forum helps others who come along later find those answers without having to bother somebody else to repeat them.

Link to comment
25 minutes ago, vaultbait said:

 

I try not to provide support in private. Keeping questions and answers on the public forum helps others who come along later find those answers without having to bother somebody else to repeat them.

 

Well, I won't bother you anymore in the future

Link to comment
2 hours ago, Kanlaon said:

Is there a good explanation of Biped Slots somewhere?

 

There is a list for Biped slots both for Armor and Armor Addon.

 

Here is the list of biped slots.

 

Wearable items (ARMO records) have a set of slots, as do Armor Addon (ARMA records).  An Armor record points to one or more Armor Addon records.  The Armor Addons define the meshes that make up the outfit.

 

Armor Addons define a piece of an Armor.  For example you might have an Armor that consists of a body suit and a helmet.  There would be two Armor Addons - one for the Helmet, with slot 32, and one for the suit, with Slot 33.  The Armor record occupies all of the Biped Slots that its component Armor Addons occupy - so in our example, the Armor record would have slots 32 and 33.

Link to comment
On 1/13/2024 at 1:02 PM, JB. said:

@vaultbait  Didn't you have a script to know/detect if the player is in sneak position?

 

I'm in need of an event like "OnSneak", which doesn't seem to exist.

 

It's a bit of a mess. There is an Actor.OnEnterSneaking event you can register for, but no corresponding one for exits. There is, however, an AnimationEvent called "sneakState" which fires when the actor's sneak state changes (starts or stops) but can also end up firing duplicates or not getting emitted under certain circumstances. Further, there's an Actor.IsSneaking() function which you can check to find the actor's sneak state (true if they're currently sneaking or false if they aren't). The upshot of all this is a rather nasty bit of spaghetti code I'm not at all proud of, but looks something like this in an ObjectReference or Actor script attached to another ref (for a Quest script or an ActorAlias filled by the player you'd want to tweak the example obviously):

Spoiler


Event OnLoad()
    RegisterForRemoteEvent(Player, "OnEnterSneaking")
    If Player.IsSneaking()
        ; player was already sneaking when we first loaded in
        StartTimer(2.0)
    EndIf
EndEvent

Event Actor.OnEnterSneaking(Actor akActor)
    If akActor == Player
        ; player started sneaking

        ; Don't start looking for the state change event right away
        ; since one corresponding to the start may arrive soon after
        ; this point
        StartTimer(2.0, 0)
    EndIf
EndEvent

Event OnAnimationEvent(ObjectReference akSource, string asEventName)
    If akSource == Player && asEventName == "sneakState"
        UnRegisterForAnimationEvent(Player, "sneakState")
        If Player.IsSneaking()
            ; Poll in a tight loop since the state change event may race
            ; actually stopping
            StartTimer(0.5, 1)
        Else
            ; player stopped sneaking
        EndIf
    EndIf
EndEvent

Event OnTimer(int aiTimerID)
    If Player.IsSneaking()
        If aiTimerID == 0
            ; Now it should have been long enough that any new state
            ; that a new state change is likely sneak stopping
            RegisterForAnimationEvent(Player, "sneakState")
        Else
            StartTimer(0.5, 1)
        EndIf
    Else
        ; player stopped sneaking
    EndIf
EndEvent

Event OnUnload()
    CancelTimer(0)
    CancelTimer(1)
    UnregisterForAnimationEvent(Player, "sneakState")
    UnregisterForRemoteEvent(Player, "OnEnterSneaking")
EndEvent

 

Edited by vaultbait
Link to comment
  • 1 month later...
14 hours ago, Riot445 said:

My game crashes when I attempt to start a new game, was working ok until I added some graphics mods, but even after disabling them it crashes. https://pastebin.com/dze6qrEN

 

This topic is for help with the Fallout 4 Creation Kit (hence the "CK" in the title), basically development of new mods. You're better off starting a new forum topic looking for help with your game problem. Also, consider using CLASSIC to interpret your Buffout 4 crashlogs, since it may turn up some useful suggestions for you.

Link to comment

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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use