Jump to content

[FO4 CK] General Help Thread


Recommended Posts

1 hour ago, Kanlaon said:

Anyway had somebody experience with perk entry's ?

I do not know if my game is messed up with a mod that i does not have identified yet or if I am making a mistake in general.

 

Perk entrypoints seem generally half-baked. I struggled similarly setting conditions based on globals and they seemed to get ignored. I have a feeling the global values are evaluated early and cached or otherwise ignored. In my case I was able to work around the things I had to do in perks by using actorvalues as multipliers instead of relying on conditions, but for things like sleeping and waking up you're probably better off registering for the relevant events rather than trying to do it with a perk.

 

I don't know if what you're attempting to build is similar, but I can share an ObjectReference script outline which registers for a wakeup event when the player activates the bed (and unregisters if the player cancels instead of choosing to sleep).

Link to comment
9 hours ago, vaultbait said:

 

Perk entrypoints seem generally half-baked. I struggled similarly setting conditions based on globals and they seemed to get ignored. I have a feeling the global values are evaluated early and cached or otherwise ignored. In my case I was able to work around the things I had to do in perks by using actorvalues as multipliers instead of relying on conditions, but for things like sleeping and waking up you're probably better off registering for the relevant events rather than trying to do it with a perk.

 

I don't know if what you're attempting to build is similar, but I can share an ObjectReference script outline which registers for a wakeup event when the player activates the bed (and unregisters if the player cancels instead of choosing to sleep).

 

Actually I wanted to have 2 visible buttons when the mouse pointer is moved on the bed because this solution seemed to make the most sense to me.

The 2nd button is not really necessary. "getting up" works in principle the same way as in the "See you sleep" mod. Simply click on  a place where no "activation" is possible.

 

At the moment I actually always use my "emergency solution" which works with a hotkey and a pop-up message box which offers the desired function as a selection.

 

What a shame, a lot of what I'm trying to do in Fallout 4 doesn't seem possible. (For example calling the sleep function when the player is already lyingin bed)

 

Hmm, if you want to try it in your own game I can send you my current development status as a PM.

My mod has even some more places where I'm just quite at a loss.

However, from my personal experience I know that often someone else has a very helpful idea for solving a problem.

 

Regards

:)

 

Link to comment
10 hours ago, vaultbait said:

Perk entrypoints seem generally half-baked. I struggled similarly setting conditions based on globals and they seemed to get ignored. I have a feeling the global values are evaluated early and cached or otherwise ignored.

 

This has been my experience as well.  It seems that once a perk entry point has checked for a condition on a reference, the result is cached and never changes, at least until the next save load.  I have tried this with keywords and formlists and the result is the same.  I imagine they implemented it this way for performance reasons, but it makes perks a lot less flexible and useful.

Link to comment

On the subject of perk entries: I noticed that Add Activate Choice perks stop working during dialogue scenes.  To make sure it wasn't just something I did wrong in my own mod, I tried this with Real Handcuffs: if you put on handcuffs and try to use the workbench next to Arturo's shop in DC, you should get "Can't Use", but if Arturo starts his sales pitch you'll get the default activation until you answer him and end the scene.

 

Has anyone ever found a fix for this?

Link to comment
13 hours ago, EgoBallistic said:

On the subject of perk entries: I noticed that Add Activate Choice perks stop working during dialogue scenes.  To make sure it wasn't just something I did wrong in my own mod, I tried this with Real Handcuffs: if you put on handcuffs and try to use the workbench next to Arturo's shop in DC, you should get "Can't Use", but if Arturo starts his sales pitch you'll get the default activation until you answer him and end the scene.

 

Has anyone ever found a fix for this?

 

For very specific cases I've used the ObjectReference.SetActivateTextOverride() Papyrus function instead, but I'm not sure how you'd make that work more generally for all nearby references.

Link to comment
On 10/21/2022 at 10:09 AM, EgoBallistic said:

 

This has been my experience as well.  It seems that once a perk entry point has checked for a condition on a reference, the result is cached and never changes, at least until the next save load.  I have tried this with keywords and formlists and the result is the same.  I imagine they implemented it this way for performance reasons, but it makes perks a lot less flexible and useful.

 

Ok, that might be possible. But for my case I could not find any problem with the condition based on the global. I used the global to switch the functionality for the perk on or off.

Switching the functionality for the perk on or off with the global works without problems for now.

 

Maybe it makes a difference if the global is defined as a const in creation kit or not. In my mod it is  NOT a const.

 

However I was aware that disabling the functionality of the perk is also possible by removing the perk from the player, but for some (forgotten) reason I decided against it.

Maybe it is just easier to handle it with MCM (No additional script code required)

 

However, I make an additional test without the global to see if it has influence  on my problem.

Edited by Kanlaon
Link to comment
On 10/21/2022 at 11:42 PM, vaultbait said:

 

For very specific cases I've used the ObjectReference.SetActivateTextOverride() Papyrus function instead, but I'm not sure how you'd make that work more generally for all nearby references.

 

In principle this idea is not bad. For my mod I require the objectreference of the bed also in some other places and that was also the reason to use a perk as it seems the easiest way to get the objectreference of the object the player wants to activate. (It is part of the fragment)

 

Lol. Use a second perk to find the objectreference for the SetActivteTextOverride function, so that the first perk has a different default activation text ?

That sounds really crazy. Also it would require the perkentry for the additional second perk to have the run immediate flag set. And this flag needs to have either 2 states or at least a semaphore to prevent it from running in every frame. Additionally since the objectreference it was used for is not deleted save game bloating could happen.

 

I have already seen some other solutions to find the objectreferences, but when I remember correct these solutions had permanent running scripts every ... seconds.

No good idea. Some events like "Oncellchange" would be handy. Oncellchange is always done with a tricky workaround (found somewhere in the skyrim creation kit)

Link to comment

Removing the condition with the global does not have any effect.

Finally I found one thing causing trouble: In my Game the mod FallSouls exists with all menues set to ON.

I changed the setting for the Message-Box Menu, than the Get-Up Button behave as expected. First shows the Messagebox, after clicking Ok the standup animation plays.

Nevertheless the first button "Sleep" still does not work.

Therefore I simply decided to swap these 2 buttons. Now with "Sleep" as the second button the script in the fragment is executed.

The first button is now "Get up" and it plays the standup animation (without usage of the script fragment containing the message box)

Anyway the messagebox was there for testing purposes.

Even the problem / bug  is not really solved I am satisfied with the result in my mod now. :)

Link to comment
4 hours ago, DSHV said:

Hello. I am making Problems of Survivor. There I have perks, for example Pornomancer. And here is the art of a cut perk from Fallout 2 - Virgin of the Wastes. Question: Is there an EASY way for me to add this art to my perk?
Also other interesting perks for me (I'll post here so as not to forget): Sex Appeal, Gigolo, Virgin of the WastesKama Sutra Master, SexpertMarried.

 

I've not tried to do that yet (though started looking into it for some custom perks in a mod I'm working on), and it seems you'll need tools capable of converting the imagery to an Adobe Shockwave Flash animation (SWF) file. This is complicated by the fact that, due to security risks posed by use of Flash content in web browsers and the progress of modern standards which supersede its features, Adobe has declared the format unsupported and ceased providing any tools for working with that format.

 

I expect there's some open source graphics tools which have reverse-engineered the format enough to implement support for it, or at least dubious abandonware copies of Adobe's old tools floating around (I got as far as installing some sufficient for a SWF viewer), but I don't have more info at this stage. Hopefully others in here have some experience in that area, since I'm curious to know what's available too.

Link to comment
16 hours ago, DSHV said:

Thank you. As I thought. So while my mod will be without new art.

 

I wouldn't give up entirely. I looked around and saw mention of an swftools plugin for The Gimp which can supposedly enable exporting to that format. Now as to whether the result is something which won't crash FO4, I can't say as I haven't tried it:

 

Link to comment
On 10/27/2022 at 3:26 AM, vaultbait said:

I wouldn't give up entirely.

I tried this site. CK does not accept it, swearing at a directory, although the directory is the same as the rest of the swf. It looks like a certain format, size or duration is needed. The animation itself can be made from three identical frames (like in your video).

Link to comment

Does anyone have experience with the sleep/wait menu?

In my experience the game opens the sleep/wait menu in sleep mode when the player is not sitting in furniture and openes in wait mode when the player is sitting in a furniture.

But what I need is a way to set the sleep/wait menu to open in sleep mode when the player is in a bed.

I tried this code snippet in a papyrus script.

 

UI.OpenMenu("SleepWaitMenu"); TEST always opens the wait menu

Var[] args = new Var[1]

args[0] = True

UI.Invoke("SleepWaitMenu", "root1.SetSleeping", args)

 

The sleep/wait menu contains this function

image.png.80cdbb819d410a21ba45c485ff542e31.png

 

Unfortunately I didn't get it to work that way (probably another path is needed).

 

Therefore instead I implemented a horrible workaround. The workaround simply starts a black phase earlier than usual and temporarily kicks the player out of bed.

After expiration of the sleep time the player is put back into bed.

Unfortunately, this has 2 disadvantages

- a) the moveto causes a reload and takes some time to do

-b) if the game automatically performs a game save,the generated Thumbnail is always black and therefore makes the save unusable.

 

OK in normal gameplay (no survival) it is possible to turn off the autosavefeature and let my mod perform an autosave at a suitable point.

The problem is usage of survival mode, usually there is no choice for the player.

 

In the file Fallout4Prefs.ini I have found a few "Settings" that probably have an impact on Fallout's autosave feature:

bSaveOnRest etc in the Section Main.

 

In my "Go to sleep" mod, one problem leads to another.

Link to comment

Hello. I am having trouble compiling any F4SE script I believe. Help is appreciated. ?

I tried looking for guides for if there are extra setup steps but I cannot find anything I have not done. Overall I cannot find much information on working with papyrus.

Am I missing something? Can I not just have the sources and then compile a single script?

 

I try to recompile the TimerScript from High Heel Training. I compile by opening Creation Kit through steam, then going to Gameplay->Papyrus Script Manager->Filter with *timer*->Right Click fish:HHT:TimerScript->Compile.
However, I get the following error. From what I understand, GetDisplayName is F4SE function and somehow is not found. I also tried changing it to GetName, but that did not work either and produced same error.

Papyrus Compiler Version 2.8.0.4 for Fallout 4
Copyright (C) ZeniMax Media. All rights reserved.
Starting 1 compile threads for 1 files...
Compiling "fish0\HHT\TimerScript.psc"...
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\fish0\HHT\TimerScript.psc(77,51): GetDisplayName is not a function or does not exist
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\fish0\HHT\TimerScript.psc(0,0): Error while trying to typecheck script fish0:hht:timerscript: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
No output generated for fish0\HHT\TimerScript.psc, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on fish0\HHT\TimerScript.psc


I did install F4SE with the scripts sources and I have let creation kit to extract its own scripts.
Things I tried so far after first attempt did not work: 1) use GetName instead of GetDisplayName, 2) reinstall F4se scripts, 3) copy F4se scripts into a folder and edit CreationKit.ini to point to it with the following:

sAdditionalImports = "$(source);.\Data\Scripts\Source\Base;.\Data\Scripts\Source\F4SE"

 

Here is the part of the code that produces the error, you can copy paste this and it produces same error for me (except with different line number of course):

Scriptname fish0:HHT:TimerScript extends activemagiceffect
; Removed bunch of variables and constants from here...
Actor akActor
; Removed bunch of variables and constants from here...
Event OnEffectStart(Actor akTarget, Actor akCaster)
	akActor = akTarget
	Debug.Notification("HHT: Now tracking " + akActor.GetDisplayName())
	; Removed the rest of the code from the function...
EndEvent


Here are some screenshots for how I have things set up at the moment.
image.png.19d3788c9fff0d8a15b20d34260d504a.pngimage.png.0dec44c139df53e6d71d2d38205ecbf2.png

Edited by Hermangk
Link to comment
1 hour ago, Hermangk said:

Hello. I am having trouble compiling any F4SE script I believe. Help is appreciated. ?

I tried looking for guides for if there are extra setup steps but I cannot find anything I have not done. Overall I cannot find much information on working with papyrus.

Am I missing something? Can I not just have the sources and then compile a single script?

 

The most recent F4SE release has the script sources packed incorrectly, so if you install them you need to make sure you install them into Data\Scripts\Source\User rather than merely Data\Scripts\Source.

Link to comment
40 minutes ago, vaultbait said:

The most recent F4SE release has the script sources packed incorrectly, so if you install them you need to make sure you install them into Data\Scripts\Source\User rather than merely Data\Scripts\Source.

Thanks a lot for the quick response, it worked. ??‍♂️ I have been struggling to make anything work in Creation Kit since 2019.
I still had errors about BodyGen not found. But a bit of googling led me to it being BodyGen.psc that I needed in my Scripts\Source\User.
Google had exactly one result which instructed to use "BSA" to extract it from "LooksMenu - Main.ba2". That contained the compiled pex and the source psc. I then took the psc and made a mod out of it that installs the source files to Scripts\Source\User. I now got my first script to compile successfully in CK. ?

Here are the errors for further reference in case others have same issues:
 

Papyrus Compiler Version 2.8.0.4 for Fallout 4
Copyright (C) ZeniMax Media. All rights reserved.
Starting 1 compile threads for 1 files...
Compiling "fish0\HHT\TimerScript.psc"...
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\fish0\HHT\TimerScript.psc(263,4): variable BodyGen is undefined
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\fish0\HHT\TimerScript.psc(263,12): none is not a known user-defined script type
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\fish0\HHT\TimerScript.psc(265,4): variable BodyGen is undefined
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\fish0\HHT\TimerScript.psc(265,12): none is not a known user-defined script type
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\fish0\HHT\TimerScript.psc(267,3): variable BodyGen is undefined
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\fish0\HHT\TimerScript.psc(267,11): none is not a known user-defined script type
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\fish0\HHT\TimerScript.psc(273,3): variable BodyGen is undefined
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\fish0\HHT\TimerScript.psc(273,11): none is not a known user-defined script type
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\fish0\HHT\TimerScript.psc(274,3): variable BodyGen is undefined
C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\User\fish0\HHT\TimerScript.psc(274,11): none is not a known user-defined script type
No output generated for fish0\HHT\TimerScript.psc, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on fish0\HHT\TimerScript.psc

 

Link to comment
On 11/7/2022 at 5:58 PM, burak81s said:

I use Fusion body and there is no sliders.Also Pregnant belly and morph mods doesnt work.Which mods are missing?

 

First, this is the Creation Kit help topic, for people making mods with the CK to ask questions about using it. This is not a general help thread for Fallout 4. There is a support thread for Fusion Girl linked from its file page, if you need somewhere appropriate to ask questions about that.

 

However, since I happen to know the likely reason for your problem, I'll tell you... make sure to read the requirements listed on the FG page, you almost certainly missed installing the ZeX-ZBG mod, which is what provides LooksMenu integration for FG (including in-game morphing support).

Link to comment
54 minutes ago, vaultbait said:

 

First, this is the Creation Kit help topic, for people making mods with the CK to ask questions about using it. This is not a general help thread for Fallout 4. There is a support thread for Fusion Girl linked from its file page, if you need somewhere appropriate to ask questions about that.

 

However, since I happen to know the likely reason for your problem, I'll tell you... make sure to read the requirements listed on the FG page, you almost certainly missed installing the ZeX-ZBG mod, which is what provides LooksMenu integration for FG (including in-game morphing support).

sorry about that.I deleted my topic and thank you

Link to comment

 

I've been scratching my head and pulling my hair out for days trying to grasp papyrus. Nothing I've found online explains this. The FO4 wiki examples don't work.

How can ONE script not be able to see properties or variables defined in the SAME script? Take this snippet:

 

Scriptname BP:PPilloryQuestScript extends Quest


Actor akVic 
Actor Property akPillory auto
Actor[] Property DoQue Auto
float Property akPosX=0.0 Auto
float Property akPosY=0.0 Auto
float Property akPosZ=0.0 Auto

float Property fSearchRadius = 2048.0 Auto
float Property ScanFreq = 30.0 Auto
int iFuckChance =50

;=======================
;start up
;=======================
Function StartUpPillaryStuff(Actor vicInPillory) global
    akVic = vicInPillory ;says akVic is unknown
    ;get our vic position one time
    akPosX = akVic.GetPositionX() ;the rest are unknown too
    akPosY = akVic.GetPositionY()
    akPosZ = akVic.GetPositionZ()
	DoQue = new Actor[64]
EndFunction

 

How do you use/pass properties to functions when nothing outside of a function is known inside of a function? Even non-property variables are unknown inside of a function in the same script. Do I seriously have to make each script one huge function? If so, how do you get/pass stuff to/from other scripts. Always says cannot use property must be called on a variable even if I extend the script. What is it I'm missing/overlooking?
 

 

Link to comment
6 hours ago, murf said:

 

I've been scratching my head and pulling my hair out for days trying to grasp papyrus. Nothing I've found online explains this. The FO4 wiki examples don't work.

How can ONE script not be able to see properties or variables defined in the SAME script? Take this snippet:

 

Scriptname BP:PPilloryQuestScript extends Quest


Actor akVic 
Actor Property akPillory auto
Actor[] Property DoQue Auto
float Property akPosX=0.0 Auto
float Property akPosY=0.0 Auto
float Property akPosZ=0.0 Auto

float Property fSearchRadius = 2048.0 Auto
float Property ScanFreq = 30.0 Auto
int iFuckChance =50

;=======================
;start up
;=======================
Function StartUpPillaryStuff(Actor vicInPillory) global
    akVic = vicInPillory ;says akVic is unknown
    ;get our vic position one time
    akPosX = akVic.GetPositionX() ;the rest are unknown too
    akPosY = akVic.GetPositionY()
    akPosZ = akVic.GetPositionZ()
	DoQue = new Actor[64]
EndFunction

 

How do you use/pass properties to functions when nothing outside of a function is known inside of a function? Even non-property variables are unknown inside of a function in the same script. Do I seriously have to make each script one huge function? If so, how do you get/pass stuff to/from other scripts. Always says cannot use property must be called on a variable even if I extend the script. What is it I'm missing/overlooking?

 

It's not quite clear what you're trying to accomplish by pre-declaring akVic outside the function, nor why vicInPillory is a required function parameter, nor what's expected to call that StartUpPillaryStuff function and why it's marked global, nor whether it's intentional that this script extends a Quest, unless that was all done as a matter of copy/paste throwing spaghetti at the wall to see if it would stick. Unfortunately the example seems to be full of a lot of incorrect assumptions, like trying to use script properties and variables from a global function scope, unnecessary reassignments, setting values which aren't used by the function but then not returning anything from the function...

 

I recommend starting with a smaller, simpler example which does compile successfully, and then explain what you want to do which you can't accomplish with it. There are a number of different ways I could alter your example to get them to compile, but I have no idea which way will preserve the behaviors you require.

Link to comment
2 hours ago, vaultbait said:

 

It's not quite clear what you're trying to accomplish by pre-declaring akVic outside the function, nor why vicInPillory is a required function parameter, nor what's expected to call that StartUpPillaryStuff function and why it's marked global, nor whether it's intentional that this script extends a Quest, unless that was all done as a matter of copy/paste throwing spaghetti at the wall to see if it would stick. Unfortunately the example seems to be full of a lot of incorrect assumptions, like trying to use script properties and variables from a global function scope, unnecessary reassignments, setting values which aren't used by the function but then not returning anything from the function...

 

I recommend starting with a smaller, simpler example which does compile successfully, and then explain what you want to do which you can't accomplish with it. There are a number of different ways I could alter your example to get them to compile, but I have no idea which way will preserve the behaviors you require.

I am trying to have the quest BPillaryQuestScript sit idle in the background until I call StartUpPilloryStuff globally from another script with a new actor in a pillory I want to put to the que. akVic will take the vicInPillory passed to it, create some saved info based on the actor passed to it, add akVic to the doQue... then run code on every actor held inside of doQue periodically, removing said actor from the doQue when actor is no longer needed.

 

In every programming language I've ever used you declare "known only to this file" variables at the top of the file or temp ones inside of a function known only inside of the function...inside of the function you had to use something like a "this->akVic" to use the semi-public variables declared at top of the file. If I use "namespace:filename.variable" I get the can't use property must be called on a variable error.

 

The wiki says that akVic should be known inside functions in the same script but it isn't. I need to know the proper syntax to make "local" properties and variables known inside of local functions. What am I not grasping?

 

Thanks for responding.

 

 

Link to comment
10 minutes ago, murf said:

The wiki says that akVic should be known inside functions in the same script but it isn't. I need to know the proper syntax to make "local" properties and variables known inside of local functions. What am I not grasping?

 

Taking just this mistake first, since it may further inform your overall design, what you're missing is that the function you've defined is not a local function (due to the global attribute you added). It sounds like what you want is for it to be a quest function setting akVic as a quest variable, and then you intend to call that quest function from another script. Drop the "global" from the function definition, and then when you call it from your other script, do it on the quest object that script corresponds to. Without knowing what the "another script" is, the most compatible approach is to do it with a ScriptObject returned by Quest.CastAs() and then use ScriptObject.CallFunction() passing the quest function name and a var array of its parameters (being mindful to set the parameters to the exact type declared in the function).

 

Link to comment
9 minutes ago, vaultbait said:

 

Taking just this mistake first, since it may further inform your overall design, what you're missing is that the function you've defined is not a local function (due to the global attribute you added). It sounds like what you want is for it to be a quest function setting akVic as a quest variable, and then you intend to call that quest function from another script. Drop the "global" from the function definition, and then when you call it from your other script, do it on the quest object that script corresponds to. Without knowing what the "another script" is, the most compatible approach is to do it with a ScriptObject returned by Quest.CastAs() and then use ScriptObject.CallFunction() passing the quest function name and a var array of its parameters (being mindful to set the parameters to the exact type declared in the function).

 

Ok so global makes the function a self contained entity. I'll rethink and try again. Thanks.

Link to comment

Is there a papyrus function to determine if the player is under a roof when it's raining? In any case, the game itself seems to know the difference.

I didn't find it myself either, so I thought about using this idea. The script will place a small static object (without Havok) a few meters direct vertically above the player and then uses the HasDirectLos function to determine whether it is visible or not.

No idea if that works, but additional handling for the small obect is necessary.

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