Jump to content

Is it possible to compile very simple scripts for FO4?


ShinraStrife

Recommended Posts

I know there must be lots of new functions and whatnot, and that the compiler for fo4 isn't out yet but if I wanted to make a simple magic effect script that adds one item to the players inventory, could I theoretically compile it in skyrim CK and add it in as a magic effect in FO4Edit?

Link to comment
Share on other sites

The binary formats for .pex files are different, and you may need to compile against different internal base classes. That said, it would be technically possible to fix the first problem via the .pex tools I set up for Skyrim and Fallout 4, and it'd be possible to make a set of base scripts from the .pex files.

 

Whether or not it is worth the time to do so is left as an exercise for the reader.

Link to comment
Share on other sites

The binary formats for .pex files are different, and you may need to compile against different internal base classes. That said, it would be technically possible to fix the first problem via the .pex tools I set up for Skyrim and Fallout 4, and it'd be possible to make a set of base scripts from the .pex files.

 

Whether or not it is worth the time to do so is left as an exercise for the reader.

 

The tools you mention, they are the same ones in F4SE download page? And if it's going to be a while before an updated compiler is released then I think it is worth the time. I have decompiled NukaColaBottleCapAdderSCRIPT; the NukaCola script that adds a bottlecap to the players inventory on consumption (this script is almost exactly what I need, instead of a bottlecap, I need an empty wine bottle instead) but the decompiled files only give me some information on what the scripts source might be like.

 

EDIT: It seems that the only thing I'd need to change in the script is the property for what item is added:

 

properties:
			name: Caps001
			type: miscobject
			user flags: 00000000
			flags: 07
			auto var name: ::Caps001_var

EDIT 2: Okay I think I understand what Ianpatt meant. I think I'm supposed to remake MiscObject.psc, and any other base scripts that NukaColaBottleCapAdderSCRIPT has references to, then remake NukaColaBottleCapAdderSCRIPT and compile with skyrim's compiler.... is that right?

Edited by ShinraStrife
Link to comment
Share on other sites

I've been trying to jump-start scripting in the Pre-CK Fallout 4 modding community. I made this tool:

 

http://www.nexusmods.com/fallout4/mods/1813/?

 

It converts compiled Skyrim scripts to Fallout 4 ones. I was hoping it would catch on more...

Nice, that's the first half of what I was suggesting someone do. With stub .psc files for the base classes, people could start compiling scripts and then converting them over.
Link to comment
Share on other sites

I've been trying to jump-start scripting in the Pre-CK Fallout 4 modding community. I made this tool:

 

http://www.nexusmods.com/fallout4/mods/1813/?

 

It converts compiled Skyrim scripts to Fallout 4 ones. I was hoping it would catch on more...

 

You are a god. A digital god.

 

EDIT: I compiled, converted, and checked this script in the translator:

ScriptName NukaColaBottleCapAdderSCRIPT Extends ActiveMagicEffect


MiscObject Property Caps001_var Auto


Event OnEffectStart(Actor AkTarget, Actor akCaster)
    akCaster.Additem(Caps001_var, 2000)
endEvent

This should give the player 2000 caps upon drinking a nuka cola (I'm just testing stuff ATM)

However, it doesn't and only applies the effects of the drink. I used the same variable for bottlecap (Caps001_var) as the original script (NukaColaBottleCapAdderSCRIPT) and didn't edit the magiceffect record in fo4edit. I'm confused why its not working.

 

EDIT 2: removing _var at the end of the property, creating an empty MiscObject record in the CK with the editorID "Caps001", and setting the script properties to AutoFill in the CK worked!

 

http://s27.postimg.org/l0l7fx5sx/enb2015_11_23_15_43_35.png

 

Now that scripting is a reality I can begin making some neat updates for my mod :D

Edited by ShinraStrife
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...