Jump to content

[FO4 CK] General Help Thread


Recommended Posts

Is there any functions or set of functions that can emulate GetCrosshairRef() that was used in NV?  I want to receive the actor reference under the cross hair when a keystroke is registered within talking distance of an npc or creature.  I know that Dagobaking was talking about finding a way for AAF but I'm not sure where an example of the way he did it is found.

Link to comment
  • 3 weeks later...
On 9/30/2018 at 12:57 PM, Cliffe said:

Guys anyone can show me a tutorial how to create an esp ? Im trying to convert armors from skyrim for fallout 4 I have the mesh done but I dunno how to actually get it in game.

It's pretty easy, but I suggest what you do is go on Youtube and look at Creation kit beginner tutorials, preferrably Fallout 4 CK specific. Any good one will teach you that pretty quick

 

Specific to your needs you need info on Armor Addons (AA) as that's the aspect that's most confusing about post Skyrim bethesda armor. Each clothing item has 2 parts The Armor Addon, and the Armor itself. The AA is where you will tell it what model to point at, the Armor itself then needs to point at the AA and it's what holds the info about the armors stats (weight etc...)

 

Good luck. And in general the best way to learn this stuff is to just experiment and be INCREDIBLY patient.

Link to comment
6 hours ago, Halstrom said:

-snip-

You tried making one as a property? I've had a script compile with the following:

 

Float[] Property PropertyName Auto

 

You could then define the size of the array by filling out blank default values in the CK.

 

Just a suggestion, I don't know if you want to do it an a specific way.

Link to comment
2 hours ago, Evan555alpha said:

You tried making one as a property? I've had a script compile with the following:

 

Float[] Property PropertyName Auto

 

You could then define the size of the array by filling out blank default values in the CK.

 

Just a suggestion, I don't know if you want to do it an a specific way.

That may be the next thing to try as apparently you have to define array's in functions, they don't seem to work in Events or being defined from the top like normal global variables. The wiki doesn't tell you that either :/

Link to comment

 If you’re just after an empty array to start, here’s one method I’ve seen

 

Float[] fArray = new Float [0]

fArray.clear()

 

now it’s empty and you can use the add() command on it to add whatever you want. 

 

If you want to have your array as a script global, just declare it in the header

 

float[] fArray

 

then in the code, where you expect it to be used the first time, perform a check for none

 

if(fArray==none)

fArray = nee float[0]

fArray.clear(0)

endif

 

fArray.add(SomeFloat)

 

to remove

Find the index

int i = 0

while(i < fArray.length())

if(fArray == floatToSearch)

iIndex = i

endif

i+=1

endwhile

fArray.remove(iIndex)

 

 

I use these methods with data structs a lot.

 

i don’t know if the setting the array to a 0 length is required and then clearing, but it’s how I’ve seen it handled and I started doing the same. It just works

Link to comment

Small issue ive run into while mapping...

 

ive searched some places and found one thing but either im not interpreting it right or it doesn't seem to work, im trying to move the "red workbench" in sanctuary and while i might be able to do that in the Creation kit it fails to locate there during game play itself - it just hovers midair where it would have gone previously.

 

https://bethesda.net/community/topic/36201/trouble-moving-workbench/2

 

ive tried using the above method but it doesn't seem to work, perhaps im doing something wrong?

Link to comment
1 hour ago, Pacman0188 said:

Small issue ive run into while mapping...

 

ive searched some places and found one thing but either im not interpreting it right or it doesn't seem to work, im trying to move the "red workbench" in sanctuary and while i might be able to do that in the Creation kit it fails to locate there during game play itself - it just hovers midair where it would have gone previously.

 

https://bethesda.net/community/topic/36201/trouble-moving-workbench/2

 

ive tried using the above method but it doesn't seem to work, perhaps im doing something wrong?

 

I tried the above linked method (for giggles) and it worked for me.  I was able to move the Workshop across the street, to next to the player's house with this.

 

image.png.a8e7ae7fac261be04cdc5f6dac9eb3a7.png

 

 

 

Here's what I did:

 

1. Place an xMaker in the location desired (alternative method for this below) -see yellow box here

    image.png.09d4efd7c28c5c86c629a95078f1a8fb.png

 

2. Open the properties of the xMarker, go to LinkedRef tab and add the SacntuaryWorkshopREF as a linked reference

   image.png.8fbc93c7f2b7c775349916ef3da6ef53.png

 

3. Still in the xMarker properties, tab over to Scripts tab and add a NEW script to the xMarker (I called mine MoveSanctuaryWorkshop)

   image.png.c959fd6aee6f1a1b4c2c7acfa7b60e11.png

 

3a.  Script body:

 

Scriptname MoveSanctuaryWorkshop extends ObjectReference

Event OnLoad ()
   GetLinkedRef (). MoveTo ( ( Self as ObjectReference ), 0.0, 0.0, 0.0, true )
   GotoState ( "Done" )
endEvent

State Done
   Event OnBeginState ( String akOldState )
      SetLinkedRef ( None )
      Delete ()
   endEvent
endState

 

4. Save, enable the plugin and test.

 

In my testing, I noted that if I loaded a save game directly to SanctuaryExt cell, then the workshop did not move - as the script is using OnLoad().  In this case, you'll have to go somehwere else and come back to see the move happen.  From that point on, the Workshop will be in the new location.  Root cellar is a quick place to run to, just enter it and go back outside and the workshop will have moved.

 

 

On placing the workshop EXACTLY where you want it....  During step 1 above where you are placing an xMarker - do not place, the xMarker.  Instead, select the wokrshop from the reference window and duplicate it in place.  Then place that duplicated workshop exactly where you want it.  When you are happy with the location, rotation, elevation, etc.  Select the duplicate workshop and press CNTRL + F on the keyboard.  A find/replace dialogue will open.  The duplicate workshop should already be selected in "Search for".  Untick the "same base object type only" tickbox and in the "Replace with" drop down, select xMarker and press OK.  The workshop will be replaced in the Render Window with an xMarker in the same orientation/position your workshop was.   Proceed with from steps 2 on.

 

image.png.c8c4e901d3bed31df495a1c4732cc5fd.png

 

 

A side note on this whole thing - if you are doing this for yourself, and the plugin will load last in your LO, or at least after any other mods altering Sanctuary - then you're fine.  However, any mods altering sanctuary will overwrite this change, if they load later.  A more compatible way to do this would be to not have a cell edit at all, and move the workshop to specific coordinates and rotation with the script itself.  This is more advanced, but will also be universally compatible - as scripted quest events do not care about load order and run last at runtime.

 

 

Link to comment
44 minutes ago, AWP3RATOR said:

 

A side note on this whole thing - if you are doing this for yourself, and the plugin will load last in your LO, or at least after any other mods altering Sanctuary - then you're fine.  However, any mods altering sanctuary will overwrite this change, if they load later.  A more compatible way to do this would be to not have a cell edit at all, and move the workshop to specific coordinates and rotation with the script itself.  This is more advanced, but will also be universally compatible - as scripted quest events do not care about load order and run last at runtime.

 

 

so assuming that i would prefer the "advanced method"...

 

i would have to add a script to the workbench to tell it to move to a certain coordinates...

would i have to alter the previously mentioned script or is there somewhere i might look to be able to reference one? im not sure it has the functionality to rotate just looking at it.

 

Edit: i re-read this and i think i should mention i know very little about scripting so if i sound like an idiot your probably right :P

Link to comment
3 minutes ago, Pacman0188 said:

so assuming that i would prefer the "advanced method"...

 

i would have to add a script to the workbench to tell it to move to a certain coordinates...

would i have to alter the previously mentioned script or is there somewhere i might look to be able to reference one? im not sure it has the functionality to rotate just looking at it.

 

Edit: i re-read this and i think i should mention i know very little about scripting so if i sound like an idiot your probably right :P

Sim Settlements uses the "advanced method" to place objects via script in the Museum of Freedom.  That would be a good place to start.  

 

In doing the "advanced method" - you would not be altering any vanilla items.  Instead, you'd use a script with a property referencing the world cell workshop in Sanctuary hills.  The Sim Settlements quest that does this is called kgSIM_WorldObjectStaging.  It does uses the same method MANY times over to insert all the objects - but as a base proof of concept, this works.

 

I'll take a look a writing something up that will do what you are asking, as the Sim Settlements scripts are generally customized and very advanced.

Link to comment

@Pacman0188  This time, I was able to move the wokrkshop to the location of my choosing with a quest script - and no world cell edits :)  The location is just outside the player's house kitchen door on the car park.

 

To do this...

 

Get the world cell location information:

1. Open the CK and the cell you want to make the edit in

2. Duplicate the object you want to move and move it to the location you want it.  Inspect the object and note the values for position, rotation on the 3D Data tab

 

   image.png.bb22fd7d54dcf2262cae8530b1c87b6c.png

 

3. Reload CK, do not save a new plugin or any changes - we only need the XYZ coordinates and rotation

 

Once CK is reloaded...

 

4. Immediately save a new plugin (I called mine MoveSanctuaryWorkshop.esp)

5. Create a new Quest (I called mine WorldObjectPlace_SanctuaryWorkshop)

6. On the quest data tab, tick the Start Game Enabled (if not) and "Run Once) boxes, Priority = 45

7. On the Quest Stages tab, add two stages 0, and some other number (I used 1000), on the stage zero to the "run on start" box (this will make the stage 0 run immediately when the quest starts, which is on game load).

8. On the Quest Stages tab, before we can add the script to stage zero, we need to create a property and fill it with the object we want to move.  Hit the Properties button

8a. On Properties tab, select Add Property, then in the pop-up the type should be ObjectReference and the name should be SanctuaryWorkshopREF  (this will default auto-fill the workshop if you have the cell loaded - because the property has the same name as a unique object)

   image.png.94da809a907b041681b34f7424d3606a.png

 

9. Now that the property has been created, we can use it in the script.  On the stage zero Papyrus fragment add the following script:

 

SanctuaryWorkshopREF.SetPosition(-80104.4766, 91777.6016, 7846.0000)
SanctuaryWorkshopREF.SetAngle(0, 0, -130.1625)

;Shutdown quest
SetStage(1000)

      Note:  SetPosition and SetAngle both accept float integer values in as (X, Y, Z) - change them to the values in the 3D data tab you collected at the beginning.

 

10. On the stage 1000 (or your other stage number), tick the "Complete Quest" box

 

 

And in game, the workshop will have moved to the exact location you specified

 

Here also is the working version with script, if you would like to see and/or just modify this for your needs.

 

Sanctuary Move Workshop Example.7z

 

 

image.png.2032cb857e5e64f86e08dd585bd7ceb4.png

Link to comment

Does anyone know how/if I can return a plugin string id for a particular form via papyrus?

 

Kind of like GetFormFromFile but in reverse. So instead of asking for a form from a specified plugin, asking for the plugin from which a particular form originates.

 

For example being in the Dugout Inn and being able to find out that cell was from "Fallout4.esm".

Link to comment
On 10/12/2018 at 2:05 PM, AWP3RATOR said:

 

8. On the Quest Stages tab, before we can add the script to stage zero, we need to create a property and fill it with the object we want to move.  Hit the Properties button

8a. On Properties tab, select Add Property, then in the pop-up the type should be ObjectReference and the name should be SanctuaryWorkshopREF  (this will default auto-fill the workshop if you have the cell loaded - because the property has the same name as a unique object)

   image.png.94da809a907b041681b34f7424d3606a.png

 

 

the only properties button im seeing seems to be grayed out >.>?

Capture2.PNG

Link to comment

@Pacman0188

 

The script file hasn't been generated yet. Where it says LogEntry, right click underneath and select new (it creates a entry for whichever stage you have selected on the left). Then to the middle right the papyrus fragment will become editable. Just stick a semi-colon in it and hit compile for now to generate the script file.

 

You may then need to select OK at the bottom to close the Quest window and then save your plugin. When you then re-open that quest, you'll be able to use the property manager.

Link to comment
On 10/12/2018 at 2:05 PM, AWP3RATOR said:

 

9. Now that the property has been created, we can use it in the script.  On the stage zero Papyrus fragment add the following script:

 


SanctuaryWorkshopREF.SetPosition(-80104.4766, 91777.6016, 7846.0000)
SanctuaryWorkshopREF.SetAngle(0, 0, -130.1625)

;Shutdown quest
SetStage(1000)

      Note:  SetPosition and SetAngle both accept float integer values in as (X, Y, Z) - change them to the values in the 3D data tab you collected at the beginning.

 

10. On the stage 1000 (or your other stage number), tick the "Complete Quest" box

 

 

And in game, the workshop will have moved to the exact location you specified

 

Here also is the working version with script, if you would like to see and/or just modify this for your needs.

 

Sanctuary Move Workshop Example.7z

 

 

image.png.2032cb857e5e64f86e08dd585bd7ceb4.png

 

2 hours ago, Merope said:

@Pacman0188

 

The script file hasn't been generated yet. Where it says LogEntry, right click underneath and select new (it creates a entry for whichever stage you have selected on the left). Then to the middle right the papyrus fragment will become editable. Just stick a semi-colon in it and hit compile for now to generate the script file.

 

You may then need to select OK at the bottom to close the Quest window and then save your plugin. When you then re-open that quest, you'll be able to use the property manager.

i got it to work somewhat, while it appears to be in the X Y Z coordinates i wanted, no matter what way i tried with the angle it seems fixed in position...

 

 

Link to comment

@Pacman0188  Sorry about that, I assumed you might have known how to get the quest stage components working.  Apologies!  When you add a stage, you also need to "initialize" it by adding a new blank log entry (right-click new).  You don't need to fill this out, it just has to exist - to get the script components part to enable itself.  This is one of those little creation kit idiosyncrasies which is not very obvious or well documented.

 

Can you post the script you entered?

Link to comment

Is there some kind of trick to Forcegreet packages in this game that I'm missing? I have it set up in my mod where raiders don't attack you if you have your weapon holstered, but when you are near one (1000 units) he/she is put into a ref alias that contains a forcegreet package. So fine, that works. when the alias fills the raider runs up to the player AND...

 

More than half the time they just stand there like a moron and don't actually greet. If I click on them I get the dialogue. And sometimes it works as it should but it's gonna kinda suck if the player has to choose to talk to the raider and be menaced/harassed. I had similar problems with my other mod on the Nexus (Mercs and safe passage) but in that case it was less immersion breaking so I didn't sweat it much.

 

Is Force greet in this game just that much more unreliable than skyrim or is there some key ingredient that I'm missing?

 

I have the package topic set to Greeting, I have force greet Hello ticked in the topic? Anybody have any ideas? 

 

EDIT: I also have the greet dialogue set to NOT be random as that SEEMS to be a requirement... This shit is so poorly documented. Oh and because someone will ask I have GetRefAlias set as a dialogue condition.

 

 

Link to comment
2 hours ago, Carreau said:

You have to set the conditions of the forcegreet and then make the NPC re-evaluate it’s package stack. 

Well, I added a script to the alias with an oninit event to re-evaluate the package but that didn't seem to do anything.. Like I said before the package is firing. The raider runs up, they just rarely actually trigger my dialogue... this is driving me nuts. 

Link to comment
56 minutes ago, Tentacus said:

Well, I added a script to the alias with an oninit event to re-evaluate the package but that didn't seem to do anything.. Like I said before the package is firing. The raider runs up, they just rarely actually trigger my dialogue... this is driving me nuts. 

 

I feel your pain with forcegreets, especially coming from Skyrim before. The oninit event won't be useful I don't think, to force re-evaluation of the alias package stack. It's generally only called on game load or the first time a reference comes into existence (or when the alias is populated).

 

Any way, I don't personally think that trying to continually force re-evaluation of packages is the correct approach. Bethesda doesn't do this.

 

In my experience it just needs good setup of the wait location, trigger location and greet distance variables in the forcegreet package and there's never a one size fits all.

 

So if you're triggering a forcegreet after your char sits at the bar or as they cross a bridge etc, will all need tweaking to suit.

 

In a mod I'm making atm the forcegreets (there are many) are rarely fixed around a persistent object. It's mostly a newly spawned NPC pathing to the player wherever they may be to trigger the greet. For those I use the wait location centred on the player at 200 units, trigger location on the player at 1000 units and a greet distance again on the player at 200 units. It works all of the time, most of the time.

 

But I put a player talkback option (not choice based, a forced line) alongside the greet because there will always be times when the player forcibly breaks out of the dialogue by moving or turning the camera. These are generally along the lines of "huh?", "what?", "hey!" etc. Just to very quickly get back into the dialogue branch. 

Link to comment
30 minutes ago, Merope said:

 

I feel your pain with forcegreets, especially coming from Skyrim before. The oninit event won't be useful I don't think, to force re-evaluation of the alias package stack. It's generally only called on game load or the first time a reference comes into existence (or when the alias is populated).

 

Any way, I don't personally think that trying to continually force re-evaluation of packages is the correct approach. Bethesda doesn't do this.

 

In my experience it just needs good setup of the wait location, trigger location and greet distance variables in the forcegreet package and there's never a one size fits all.

 

So if you're triggering a forcegreet after your char sits at the bar or as they cross a bridge etc, will all need tweaking to suit.

 

In a mod I'm making atm the forcegreets (there are many) are rarely fixed around a persistent object. It's mostly a newly spawned NPC pathing to the player wherever they may be to trigger the greet. For those I use the wait location centred on the player at 200 units, trigger location on the player at 1000 units and a greet distance again on the player at 200 units. It works all of the time, most of the time.

 

But I put a player talkback option (not choice based, a forced line) alongside the greet because there will always be times when the player forcibly breaks out of the dialogue by moving or turning the camera. These are generally along the lines of "huh?", "what?", "hey!" etc. Just to very quickly get back into the dialogue branch. 

You are correct that at the beginning of forcegreet, Bethesda doesn't typically re-evaluate the stack.  Given he was having issues, I figured maybe it would help.

 

Looking at some of the other forcegreet packages, like Brandis, his conditions are if a stage in quest BoSM01 hasn't been completed, and whether the player has LoS on him.  After the stage is set, his package is re-evaluated to force his forcegreet to exit.  That is almost very much consistent in Bethesda's approach.  Evaluate the stack to kill the forcegreet after it's done.

Link to comment
5 minutes ago, Carreau said:

You are correct that at the beginning of forcegreet, Bethesda doesn't typically re-evaluate the stack.  Given he was having issues, I figured maybe it would help.

 

Looking at some of the other forcegreet packages, like Brandis, his conditions are if a stage in quest BoSM01 hasn't been completed, and whether the player has LoS on him.  After the stage is set, his package is re-evaluated to force his forcegreet to exit.  That is almost very much consistent in Bethesda's approach.  Evaluate the stack to kill the forcegreet after it's done.

 

I think confusion is over the forcing re-evaluation, that's a very specific action. Not relying on package evaluation inbuilt in the engine. Of course there's going to be conditions that need to be met before a package is invalidated. I would think that was obvious.

Link to comment
12 hours ago, Carabosse said:

Does anyone know how/if I can return a plugin string id for a particular form via papyrus?

 

Kind of like GetFormFromFile but in reverse. So instead of asking for a form from a specified plugin, asking for the plugin from which a particular form originates.

 

For example being in the Dugout Inn and being able to find out that cell was from "Fallout4.esm".

I'm not aware of an easy way to do this, aside from inspecting the plugins.txt, but I don't think that is referable in the runtime engine. In checking F4SE script extender functions, there appear to be a few which might work - though I'm not a papyrus expert....  From a purely coding standpoint, it *MIGHT* be possible to:

 

1. evaluate a form and parse the left 2 characters to get the loaded index

2. evaluate that parsed value against F4SE's function GetInstalledLightPlugins() list

 

I assume GetInstalledPlugins() returns a list, but unsure if it will return plugin name with index values or not.

 

 

Why do you need this?  Just curious.

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