Jump to content

Creation Kit Crash Course


phazer11

Recommended Posts

Hehe. Well I suggested it because it was brilliant for a educational project I made years ago in UT3; I did a whole brand new level in 3 days with scripting and everything while colded up. Not a brag, just that I heartily recommend it for fast turnarounds on such projects. You can also export it and send it to your tutor as a EXE.

 

Tech, don't you need to edit the CK INI so it accepts multiple master loading first? I wouldn't do that anyway, I'd just import the assets as new statics in this case. Keep the file directory and make new statics forms. Import them basically.

Link to comment
Share on other sites

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

Tech, don't you need to edit the CK INI so it accepts multiple master loading first? I wouldn't do that anyway, I'd just import the assets as new statics in this case. Keep the file directory and make new statics forms. Import them basically.

Yes, but he already said the CK was set up correctly. You can also load BSAs by adding them to the list in the INIs, but I wouldn't recommend that when you can just extract the BSA.

Link to comment
Share on other sites

Yes, but he already said the CK was set up correctly. You can also load BSAs by adding them to the list in the INIs, but I wouldn't recommend that when you can just extract the BSA.

Oh righty. Fair enough. Yeah, usually mods don't contain a sizable chunk of assets to make NOT extracting them actually worth it. Not to mention that you can easily make texture path edits in the NIFs when extracted - as to keep everything more organised if you wish.

 

I may need to ask you about NavMesh one day Tech. I have not really had to use it yet to be honest, but the thought of conflicts would surely keep me away anyway. Editing and finalising a vanilla cell just sounds so dangerous; like one little nudge in the wrong direction would make evrrything explode. Haha.

Link to comment
Share on other sites

Being that phazer is MIA at the moment, I might as well use this as an actual crash course thread.

 

I'm planning to do some scripting when I can this week/weekend. It will be a simple set ownership mod for Fallout 4 using Papyrus. I'm guessing it's virtually the same as Skyrim, so if anyone wants to join in or help out, feel free. I'm guessing you will be too busy Tech? Basically it would have been this prior to Papyrus:

scn OwnScript
 
short guykilled
 
begin gamemode
 
if NPC.getdead == 1 && guykilled == 0
  set guykilled to 1
  setcellownership INTERIOR
  stopquest QUEST
endif
end

That would have been the gist of it. Now with Papyrus, I'm going to struggle. It's something that my mind will get bored with and I'll probably end up getting distracted.

Edited by Guest
Link to comment
Share on other sites

I have yet to jump into papyrus. I actually don't care for programing. JavaScript was okay. C# in college was terrible. Actually, I dropped that class as it was suppose to have been Java programing and they changed it to C# without telling any of the students. This was due to the main programing teacher being ill and replaced with a substitute that only knew C#. I was upset about it not being the class I signed up for so I dropped it. C# would have have been helpful to my planned career at that point. The extent of most of my programing skills is XHTML and CSS which I taught myself. Papyrus is something that I will probably need to dabble in for my house mod (most likely), but it's not something I'm looking forward to.

Link to comment
Share on other sites

Being that phazer is MIA at the moment, I might as well use this as an actual crash course thread.

 

I'm planning to do some scripting when I can this week/weekend. It will be a simple set ownership mod for Fallout 4 using Papyrus. I'm guessing it's virtually the same as Skyrim, so if anyone wants to join in or help out, feel free. I'm guessing you will be too busy Tech? Basically it would have been this prior to Papyrus:

scn OwnScript
 
short guykilled
 
begin gamemode
 
if NPC.getdead == 1 && guykilled == 0
  set guykilled to 1
  setcellownership INTERIOR
  stopquest QUEST
endif
end
That would have been the gist of it. Now with Papyrus, I'm going to struggle. It's something that my mind will get bored with and I'll probably end up getting distracted.

 

 

You won't be able to just change a few syntax stuffs to port this to papyrus, or you'd need to pool every X second to check if you're actor actually is dead. Instead you'll need to make an alias for your quest and fill it with the said NPC ref, then use the OnDeath event (or whatever it is called, maybe OnActorDeath or something along those lines) to actually perform your actions. Associating the script directly to the alias instead of putting it in the quest should ease the whole thing.

 

Something like this shouldn't be too far from the final result (still skyrim based, I haven't checked FO4's scripting changes in depth):

scriptname ownScript extends ReferenceAlias

int guykilled = 0

Cell Property cellref Auto

Event OnDeath(Actor akKiller)
  if (guykilled == 0)
    guykilled = 1
    cellref.SetActorOwner(Game.GetPlayer())
  endIf
endEvent

Thougn I'm not sure why you'd want to check for guykilled ?

Edited by Kesta
Link to comment
Share on other sites

Oh wow Kesta. I actually PM'd Chesko about an error and he gave me a quick noob guiding. I should have just asked you but I had no idea you were into this. So basically, I was trying to utilize the old method of attaching it to a quest - but an NPC is an object, so it can't extend from a quest. I'll seemingly have to attach it to the actor, but I won't have to do a new script for each one I assume? I'm guessing I could do one script and reference each NPC and make them do stuff based on their ID?

 

No, I didn't need to check for "guykilled" really did I? I was thinking of if I'd need to reference his death on something else I could use that. Honestly though, I could just have solely referenced his death. ::P:

 

Edit: This compiled!

Scriptname SP_OwnedScript extends Actor

Cell Property SP_AbbotCell Auto
ObjectReference Property SP_AbbotBed Auto

Event OnDeath(Actor akKiller)
if (akKiller == Game.GetPlayer())
   SP_AbbotCell.SetActorOwner(Game.GetPlayer().GetActorBase())
   SP_AbbotBed.SetActorOwner(Game.GetPlayer().GetActorBase())
   Debug.MessageBox("I'm deaded!")
endif
endEvent

Now I need to reference some containers. I need to set them to not respawn if there is a function for that. Am I best putting separate scripts on each NPC or can I use one somehow on multiple NPCs? I'm guessing I'd have to change the "if" to check for certain NPCs?

 

Edit 2:

 

Did not see Tech's posts until now; I swear my browser wasn't displaying them earlier. Yes you will probably need it for your mod. Honestly this isn't for me, my mind doesn't work well with this sort of stuff. I find it... REALLY boring. I mean I did that little bit of code with Kesta's help and I have already had enough.

Edited by Guest
Link to comment
Share on other sites

Rather than creating a new thread for this, I thought it'd be best to ask this here, especially considering SparrowPrince's question.

 

I'm remaking one of my Fallout 4 mods now that the Creation Kit is out, and I found out that I need to add one of the records to a formlist. Can someone explain how to do this with a script (preferably with a script example)? I haven't been able to found anything on Google that explains it clearly.

Link to comment
Share on other sites

Rather than creating a new thread for this, I thought it'd be best to ask this here, especially considering SparrowPrince's question.

 

I'm remaking one of my Fallout 4 mods now that the Creation Kit is out, and I found out that I need to add one of the records to a formlist. Can someone explain how to do this with a script (preferably with a script example)? I haven't been able to found anything on Google that explains it clearly.

Just use this function : https://www.creationkit.com/fallout4/index.php?title=AddForm_-_FormList

 

And btw, don't bother with google for scripting :

Just open the original .psc files from bethesda, they contains the exhaustive list of available functions, with rather clear name and parameter name that should in most case be enough to understand what they're used for. If you need additional documentation, check the CK wiki, especially those two :

ScriptObjects : https://www.creationkit.com/fallout4/index.php?title=Category:Script_Objects

Events : https://www.creationkit.com/fallout4/index.php?title=Category:Events

 

 

@PidgeyKing (yes, you evolved since you learned papyrus :P ): This compile and work, but will lead to several compatibility issues in this state if you attach it directly to the abbot NPC (like, every mod editing abbot for whatever reason will need a goddamn patch).

Edited by Kesta
Link to comment
Share on other sites

Edit: Hmm might just be better to create an activator and make stuff purchasable. Yeah, I'll have a bash at that when I get back.

 

Edit 2: Damn, it created a new post.

Edited by Guest
Link to comment
Share on other sites

Okay, just spent an hour getting everything set up. I have a ledger that checks if the guy is dead and allows you to then buy the property and clean it up.

 

A few questions though:

 

1.) Is it safe to untick "Respawn" from all the clutter? I'm guessing this is a no-brainer.

2.) If I disable this clutter and the player has already picked up an instance of it, it shouldn't cause any problems right? Everything basically gets disabled and a new instance is added to your inventory correct?

3.) I noticed there are a lot of respawning containers. Shall I Ctrl+F replace them with my non-respawing ones or shall I disable the originals and position mine manually? What is the best practice here?

 

Thanks!

Edited by Guest
Link to comment
Share on other sites

When working with vanilla content, I've been told it's best to disable and replace it with your own, rather than deleting it and replacing it. If the originals are in your way, just move them outside the area for interiors or below the terrain in exteriors.

Link to comment
Share on other sites

Yeah, that's what I heard. I think the Search and Replace function (Ctrl+F) actually keeps the form ID intact though; I can't remember. I'll have to check later, because I have done for tonight.

 

It's basically this:

 

Pn_searchAndReplacePrompt.jpg

 

 

 

Also Tech, I accidentally found that if you select multiple objects, you can press the underscore key and do various actions for all of them. It means you don't have to go through every one individually.

Edited by Guest
Link to comment
Share on other sites

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

By using this site, you agree to our Guidelines, Privacy Policy, and Terms of Use.