Jump to content

[FO4 CK] General Help Thread


Recommended Posts

9 minutes ago, requiredname65 said:

 

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.

bruh i didnt add them because i thought since its a comment it doesnt matter. will try it out, thanks

Link to comment

Latest challenge... I have a script-equipped Potion which applies a very long-lived MagicEffect to the player ref that adds a Perk enabling an ability-type Spell. This seems to be a fairly typical arrangement not only in mods but also in the base game.

 

I have a complex set of conditions for which I want to cancel/dispel that in a script. What's the best way to go about it? Do I need a script attached to the MagicEffect so I can call the ActiveMagicEffect.Dispel() method from it, or is there a simple external call I can make from, say, a Quest script?

 

Edit: Thinking about alternative approaches, probably the easiest way forward is to add a GlobalValue and set it as a condition in the potion, and then flip that in my script rather than actually cancelling the effect directly somehow (and flip the global back again if the script is reapplying the potion to restore the effect for it). But if anybody has other suggestions for something simpler, I'm keen to hear them anyway.

Edited by vaultbait
Link to comment

More questions! First is about ways to break a mod. Because I'm the sort of fool who likes to make software as foolproof as possible, I discovered the following: In a mod where I have persistent formlists as quest properties, if I uninstall the mod after using it and save, then reinstall the mod with a different load ordering, the FormLists end up corrupt somehow and become inaccessible to their quest script (I'm sure this behavior is not just limited to FormLists, that's just where I ended up noticing it). Aside from the ages old wisdom to not uninstall scripted mods mid-playthrough, are there any countermeasures the mod itself can take? Like, if I give the user an MCM option to stop the quest with those properties, then does doing that before uninstalling help?

 

Completely unrelated question: I have some conditions under which I want to block the player from accessing power armor. I know how detect if they're wearing or try to enter it, and how to force them out of it, so could in theory just kick them out any time they try to put it on. Is there a better solution? I see the base game has a NoUsePowerArmor keyword, can that be safely added to the player ref? If so, that raises another question... Is there a preferred way to make sure that keywords my mod adds to the player are removed if it's disabled/uninstalled? Like is there a way to temporarily apply a keyword through a custom MagicEffect, or do I need to do this with a quest alias for the player?

Link to comment

Hi.

 

Anyone have idea how to rename misc object by script with renameanything? it works with furnitures and npcs, but when I try to call it on a misc item(like a  holotape) it just not happening.

I need it, because I have markers to mark target containers for job stations, and it would be less confusing, if the markers have the name and id of the station.

My script is simple here:

	Objectreference linker = self as Objectreference
	RenameAnything.SetRefName(linker, "Targetlinker("+parentstationname  +")" )

 

Edited by innocentinner
Link to comment
On 12/10/2022 at 11:35 PM, vaultbait said:

I have some conditions under which I want to block the player from accessing power armor. I know how detect if they're wearing or try to enter it, and how to force them out of it, so could in theory just kick them out any time they try to put it on. Is there a better solution? I see the base game has a NoUsePowerArmor keyword, can that be safely added to the player ref? If so, that raises another question... Is there a preferred way to make sure that keywords my mod adds to the player are removed if it's disabled/uninstalled? Like is there a way to temporarily apply a keyword through a custom MagicEffect, or do I need to do this with a quest alias for the player?

 

After looking at how the Classic Power Armor Training mod does it, and seeing it's using the same ugly hack I was avoiding, I caved and basically just did it that way on the assumption that if they couldn't find a better alternative then it's highly unlikely I will. In  the next version of Unhealthy Craving, it notices when you equip a power armor chassis or are already wearing one when you get too fat, and forces you to exit the suit if so. Simple enough, if not all that elegant.

Link to comment
  • 2 weeks later...

I want to safely add a keyword to the player reference in a way that it will be removed automatically if my mod goes away. It looks like I should be able to do that with a ReferenceAlias for the player, since it will go away if the plugin providing the parent quest does? Unfortunately, I'm still a bit new to this and have done very little with quest aliases, so am neither sure what is involved in doing that nor what problems I need to be wary of (for example I know that quests can "lock" references when they fill aliases, causing other quests to then be unable to fill similar aliases). Any tips or basic instruction would be appreciated, the relevant docs aren't all that clear on this subject.

 

Edit: I should clarify, the keyword I want to apply to the player is from the base game. Obviously if it were a keyword my mod's plugin provided, this wouldn't pose a problem.

Edited by vaultbait
Link to comment

I am creating some new levelled list to distribute clothing (rather than crafting). As there are a lot of them, rather than choosing "New" for each item then laboriously changing it to the correct item one by one, is there a way to bulk populate the list. As it's a drop down Shift+LMB doesn't work.

 

Here's hoping, but I suspect I'm going to have to do this the hard way

Link to comment
33 minutes ago, Slorm said:

I am creating some new levelled list to distribute clothing (rather than crafting). As there are a lot of them, rather than choosing "New" for each item then laboriously changing it to the correct item one by one, is there a way to bulk populate the list. As it's a drop down Shift+LMB doesn't work.

 

Here's hoping, but I suspect I'm going to have to do this the hard way

 

I haven't tried, but maybe you can drag a multi-selection into it from the object window like you can to fill formlists? Alternatively, FO4Edit supports scripted batch operations.

Link to comment
33 minutes ago, vaultbait said:

 

I haven't tried, but maybe you can drag a multi-selection into it from the object window like you can to fill formlists? Alternatively, FO4Edit supports scripted batch operations.

 

That works :classic_smile:

 

 You are a genius. Thank you. that'll save me a heap of time ?

Edited by Slorm
Link to comment

@louisthird: I know this is a couple years old, but do you have an example you can point to of where you implemented the more performant sub-quest alternative for this? I'm trying to do something similar which finds objects matching formlist contents or keywords (which I have working fine already), but also want to search inside nearby containers and the CK looks like it has way better options for matching them than Papyrus does. Unfortunately, my experience with using quest aliases for more than rudimentary purposes is very thin, so hoping to find another mod I can look at which does the same sort of thing.

Link to comment
On 10/25/2022 at 9:09 AM, vaultbait said:

 

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.

 

I haven't found any such tools - I suspect that historic problems have evolved into a full-blown allergy to the shockwave label.

 

I wish I could find documentation on the file format. That would be a necessary first step in building replacement tools.

 

Edit: http://justsolve.archiveteam.org/wiki/SWF and https://github.com/jindrapetrik/jpexs-decompiler and http://www.swftools.org/ look promising though it's also apparent that anything coming from adobe on this issue is rapidly decaying.

 

Also, using swftools - raster formats look easier than vector formats. I guess if you want something which scales up nicely, while being compact, building an ("obsolete") pdf flipbook and converting that to swf looks like it would work. Otherwise you're getting into the equivalent of large textures and relying on compression and hoping you're not overloading the player's system.

 

Edited by sen4mi
Link to comment
15 hours ago, sen4mi said:

Also, using swftools - raster formats look easier than vector formats. I guess if you want something which scales up nicely, while being compact, building an ("obsolete") pdf flipbook and converting that to swf looks like it would work. Otherwise you're getting into the equivalent of large textures and relying on compression and hoping you're not overloading the player's system.

 

Oh, I completely agree. If it were me (and it likely will be eventually because I have a need for some custom icons/images for perks and such), I'd prefer to use something like The Gimp to make the images or animations and then "compile" them to SWF (possibly by exporting to multi-page PDF and then converting that, or whatever the least lossy path ends up being).

Link to comment
10 hours ago, vaultbait said:

 

Oh, I completely agree. If it were me (and it likely will be eventually because I have a need for some custom icons/images for perks and such), I'd prefer to use something like The Gimp to make the images or animations and then "compile" them to SWF (possibly by exporting to multi-page PDF and then converting that, or whatever the least lossy path ends up being).

 

Inkscape might work here?

Link to comment
11 hours ago, vaultbait said:

 

For doing vector art, yes. Still need to convert it to SWF somehow of course, and hope that FO4's engine doesn't choke on the result too.

 

Oh, yes.... I was thinking: compose in inkscape, export pdf, use pdf2swf.exe from swftools to build the swf.

 

I have not tried this, I am currently uninstalling and reinstalling some other stuff to try to get pyffi working, but it seems like this should work.

Link to comment
  • 2 weeks later...

I installed a small mod that uses loose files. This provides an empty bottle after drinking water and other beverages. I would like to transfer this to BA2 in order to eliminate the last small stutters (hopefully). I've looked at a guide for this, but it's beyond my humble means.
My request would be if a knowledgeable member would take the 5 minutes to do the conversion to a working BA2 (Vortex Compatible) for me?
Concerns the mod https://www.nexusmods.com/fallout4/mods/12674?tab=description.

Link to comment
20 minutes ago, g0hahi said:

In skyrim i would use onupdate if i wanted to monitor my quest, etc but the function does not exist in f4, should i use ontimer instead?

 

I'm unfamiliar with SkyRim's Papyrus flavor, so not sure what onUpdate is used for but it looks like it's a general event fired for any change to a Form. Fallout 4 has only fine-grained events so you'll need to register for all the ones you want to trigger on. For Quests specifically, you can find the list of supported events here.

Link to comment
53 minutes ago, g0hahi said:

In skyrim i would use onupdate if i wanted to monitor my quest, etc but the function does not exist in f4, should i use ontimer instead?

 

Always read the docs.

https://www.creationkit.com/fallout4/index.php?title=Differences_from_Skyrim_to_Fallout_4#OnUpdate_Replaced

 

Quote

OnUpdate and its various versions have been completely replaced with a new timer system in Institute. A timer operates like the old RegisterForSingleUpdate except that you can register for multiple timers at once using different ID numbers and different durations, and the registrations are per-script. Other scripts on the same form won't get your timer events, and vice-versa.

 

See Also:

  • CancelTimer - ScriptObject
  • CancelTimerGameTime - ScriptObject
  • StartTimer - ScriptObject
  • StartTimerGameTime - ScriptObject
  • OnTimer - ScriptObject
  • OnTimerGameTime - ScriptObject

 

Link to comment

Brainstorming time...

 

I want to alter the dispenser logic in vanilla game Port-A-Diners in order to vary the chances of getting pie. I can see a few obvious ways to go about it, none of which I'm entirely happy with:

  1. Overwrite PortaDinerScript.psx in the base game with my own altered version. Pros: Simple. Cons: Conflicts with anything that might rely on the vanilla version of that script or which also replaces it.
  2. Include a new script and use a plugin to override the script binding for the PortADiner01 and PortADiner01Dirty forms to use it instead. Pros: Not overwriting game assets. Cons: Conflicts with any other mods which might alter the same forms, probably invalidates property edits from custom ObjectReferences of the Port-A-Diner placed in the game.
  3. Periodically scan for nearby Port-A-Diners and temporarily increase the player's LuckAV with a temporary MagicEffect when in range of one. Pros: Not prone to conflicts with anything else. Cons: Possibility of other side effects from increased luck.

I'm currently leaning toward option #3 above, but it's likely there are better approaches I simply haven't thought of. For example, is it possible to somehow register for an event which will fire when the player uses an activator instantiated from a particular form? Or use the scanning idea from #3 but call ScriptObject.SetPropertyValue() to temporarily override one of the other auto properties on that script rather than diddling around with LuckAV? Something else even better still? Suggestions welcome!

Link to comment
4 hours ago, vaultbait said:

I'm currently leaning toward option #3

Option #4:

Make a new record (Vaultbait_PortADiner01) with the ForcePieSuccess flagged as true.

Then replace all world objects with the new record.

Or edit the base object and call it good.

Conflicts... who cares.. fuckem! LOL No really, it's the port a diner with a terribly bad script, just fix it and the world will love ya long time.

 

BTW, editing vanilla assets is normally a no no, but in this case it's perfectly acceptable. :)

 

Edited by izzyknows
Link to comment
34 minutes ago, izzyknows said:

Option #4:

Make a new record (Vaultbait_PortADiner01) with the ForcePieSuccess flagged as true.

Then replace all world objects with the new record.

Or edit the base object and call it good.

Conflicts... who cares.. fuckem! LOL No really, it's the port a diner with a terribly bad script, just fix it and the world will love ya long time.

 

BTW, editing vanilla assets is normally a no no, but in this case it's perfectly acceptable. :)

 

Yeah, tempting. Worst case, I guess I put the form override a separate ESL-flagged ESP and have it as a default enabled addition in the FOMOD installer, then let users deselect it if they're really not okay with the conflict and would rather forego the associated feature? That seems reasonably straightforward.

Link to comment
5 hours ago, vaultbait said:

 

Yeah, tempting. Worst case, I guess I put the form override a separate ESL-flagged ESP and have it as a default enabled addition in the FOMOD installer, then let users deselect it if they're really not okay with the conflict and would rather forego the associated feature? That seems reasonably straightforward.

Something like the pie, is just stupid simple. It's literally a single flag edit, I did it several years ago. IF it conflicts with some other mod they need to get rid of the other sub par mod, cause it's doing the same damn thing, and use the far better one.

The only mod I know of that edit the porta diner ups the chance to get the pie....  I wouldn't even mention it and see how long it takes for someone to say something. My guess it'd be a long time as nobody cares about that garbage item. (cause Bugthesda ruined it with their insane probability)

 

It'd be different if you made every load  door hot pink that killed the player when using them. But this is the Port a Diner... edit that sucker & ship it! :P

 

 

Link to comment

I have a potion which is placed in some locations for the player to pick up, but the same potion can also be force-equipped by an activator via a script. When the player picks up the placed potion I want it to be featured (like picking up a perk mag or legendary item), but not when it's equipped from the dispenser. I'm able to make it work by having two different forms which are nearly identical except that one has the FeaturedItem keyword while the other does not, but this makes it possible for the player to end up with the effects of two running concurrently because they're technically different potions.

 

Is it possible to make them cancel one another, or is there a way to do it with only one form? I tried attaching an ObjectReference script that does AddKeyword() inside an OnLoad event, and while I'm able to confirm that the keyword got added successfully it doesn't seem to actually feature the item on pickup. Ideas?

 

Edit: After sleeping on it, another idea that came to mind was to have a miscitem for the placed ones and set the featureditem keyword on that, but attach a script so that when the player picks it up the miscitem is silently replaced by the potion instead. The main down-side I can see to that is it would interfere with mods that let you drink items directly from the world via an additional activate option. Oh, or sort of the reverse, place the normal potion but attach an onactivate script which silently adds a featureditem miscitem to the players inventory and then silently removes it again and renders the script instance inoperable after that. Other than being a little convoluted, that probably has the fewest negatives I can think of aside from a little additional complexity.

Edited by vaultbait
Link to comment
On 1/24/2023 at 6:40 AM, vaultbait said:

I have a potion which is placed in some locations for the player to pick up, but the same potion can also be force-equipped by an activator via a script. When the player picks up the placed potion I want it to be featured (like picking up a perk mag or legendary item), but not when it's equipped from the dispenser. I'm able to make it work by having two different forms which are nearly identical except that one has the FeaturedItem keyword while the other does not, but this makes it possible for the player to end up with the effects of two running concurrently because they're technically different potions.

 

Is it possible to make them cancel one another, or is there a way to do it with only one form? I tried attaching an ObjectReference script that does AddKeyword() inside an OnLoad event, and while I'm able to confirm that the keyword got added successfully it doesn't seem to actually feature the item on pickup. Ideas?

 

Edit: After sleeping on it, another idea that came to mind was to have a miscitem for the placed ones and set the featureditem keyword on that, but attach a script so that when the player picks it up the miscitem is silently replaced by the potion instead. The main down-side I can see to that is it would interfere with mods that let you drink items directly from the world via an additional activate option. Oh, or sort of the reverse, place the normal potion but attach an onactivate script which silently adds a featureditem miscitem to the players inventory and then silently removes it again and renders the script instance inoperable after that. Other than being a little convoluted, that probably has the fewest negatives I can think of aside from a little additional complexity.

If there's just few magiceffects in your potions then you could (make copies as needed) set 'no recast' flag on each effect and just keep two versions of the potions. Canceling could be done with keywords (of type dispell effect) on effects and 'dispell with keywords' flag. See how vanilla beers and their effects.

Edited by requiredname65
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