"Fallout4Path" macro causing build issues
Closed this issue · 3 comments
If you see any build errors like "The command copy ... exited with code 1", then visual studio needs help understanding the "Fallout4Path" macro in the copy command. One way to do this is to define this as a new "dist" folder next to the sln file as described below:
-
From the property manager, add a new property sheet for the "f4se" project. Open the property pages for your new property sheet and set user macro
"Fallout4Path: $(SolutionDir)dist"
and pre-build event"Command Line: if not exist $(Fallout4Path) mkdir $(Fallout4Path)"
. -
From the property manager, add the same property sheet to the "f4se_loader" and "f4se_steam_loader" projects.
-
Now, run "Rebuild solution" to confirm the build errors have gone away.
-
Also, add the new "dist" folder to your gitignore file if you have one..
This is intended to point to your Fallout 4 installation folder. If I recall correctly, it doesn't fail the build if not defined.
This is intended to point to your Fallout 4 installation folder. If I recall correctly, it doesn't fail the build if not defined.
Thanks for reading my issue. Although it could be helpful to copy the f4se build outputs directly into the Fallout4 game directory, unfortunately the post-build step fails if the macro is not defined because it will try to copy into the "/" directory which is not allowed. This causes the "Build solution" and "Build project" commands to fail in the post-build step. Note it does not affect the build step and the build outputs are indeed created as expected.
If you are using the old unsupported project files, it is assumed that you have this environment variable set. The cmake build has more detailed options.