Last active
July 10, 2018 11:11
-
-
Save Knetic/142ca671fca93d1c325c77987ce3ab19 to your computer and use it in GitHub Desktop.
Recompiles and hot-reloads the game module for a ue4 project from commandline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# No arguments - run in the same directory as your "*.uproject" file. | |
UNR_PATH="<PATH_TO_YOUR_UNREALENGINE>/UnrealEngine" | |
RANDNUM=$(( ( RANDOM % 1000 ) + 1000 )) | |
CURR_DIR=$(pwd) | |
PROJECT_PATH=$(find ${CURR_DIR} -maxdepth 1 -name "*.uproject") | |
PROJECT_FILE=$(basename ${PROJECT_PATH}) | |
PROJECT_NAME=${PROJECT_FILE%.*} | |
${UNR_PATH}/Engine/Build/BatchFiles/Linux/RunMono.sh \ | |
${UNR_PATH}/Engine/Binaries/DotNET/UnrealBuildTool.exe \ | |
"$PROJECT_NAME" \ | |
-ModuleWithSuffix \ | |
"${PROJECT_NAME}" \ | |
${RANDNUM} \ | |
Linux \ | |
Development \ | |
-editorrecompile \ | |
-canskiplink \ | |
"$PROJECT_PATH" \ | |
-progress | |
# Note that UE >4.18 seems to break the ${RANDNUM} strategy - the syntax seems to have changed to "-Module=<name>,<suffix>, but this seems to fail with the RANDNUM strategy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This one works for me. I have added the following function in my bashrc file.
function unrealbuild4.19 {
UNR_PATH=opt/UnrealEngine4.19.1/UnrealEngine;
RANDNUM=$(( ( RANDOM % 1000 ) + 1000 ));
CURR_DIR=
pwd
;PROJ_NAME=$(basename ${1%.uproject});
${UNR_PATH}/Engine/Build/BatchFiles/Linux/Build.sh $PROJ_NAME -ModuleWithSuffix=$PROJ_NAME,$RANDNUM Linux Development -editorrecompile -canskiplink "${CURR_DIR}/${PROJ_NAME}.uproject" -progress
}
Most probably you need to modify this line -ModuleWithSuffix ${PROJECT_NAME} ${RANDNUM} in your code.
I have got the reference from here
https://github.com/EpicGames/UnrealEngine/blob/08ee319f80ef47dbf0988e14b546b65214838ec4/Engine/Source/Programs/UnrealBuildTool/Configuration/UEBuildTarget.cs#L443