by Eisen » Fri Dec 29, 2017 7:29 am
This is a simple tutorial on how to use SublimeText 3 build systems and command line scripts to make your life easier if you're trying out Zscript and if you dislike SLADE3 (my case in particular).
First of all, download SublimeText 3 and your sourceport of choice. In this tutorial I'll be using GZDoom.
Spoiler: Folder structureEverything on this section of the tutorial will affect the command line and Build Systems scripts later on, so if you wish to do something differently here you'll have to alter the scripts.
Create a folder with the project name of your choice.
Extract your sourceport inside it.
Move your iwads to the sourceport folder.
Create a folder to store your mod files, in my case I named it "src".
Spoiler: Windows scriptsHere's the dirty part, if you use Linux, this'll be a lot cleaner with a bash script.
Inside your project main folder, create a file with the following name and extension: "make.cmd".
Edit it and paste the following code:
Code: Select all
SETLOCAL
SET projectName=Test
SET projectFolderName=src
SET extension=.pk3
SET iwad=hexen.wad
SET winrar=C:\Program Files\WinRAR\WinRar.exe
IF EXIST "%cd%\%projectName%%extension%" (
DEL "%cd%\%projectName%%extension%"
"%winrar%" a -r -ep1 -afzip "%projectName%%extension%" "%cd%\%projectFolderName%\"
gzdoom\gzdoom.exe -iwad "%iwad%" -file "%projectName%%extension%" -skill 4 -warp 1
) else (
"%winrar%" a -r -ep1 -afzip "%projectName%%extension%" "%cd%\%projectFolderName%\"
gzdoom\gzdoom.exe -iwad "%iwad%" -file "%wad%" "%projectName%%extension%" -skill 4 -warp 1
)
This script does the following:
If there's no file named "Test.pk3" on nthe main project folder, it compresses the "scr" folder into a a .zip with a .pk3 extension and then runs gzdoom with the chosen iwad on ultraviolence on the first map.
Otherwise it first removes the existing "Test.pk3" file and does the same.
In this case I'm using the hexen.wad as my iwad, my WinRar is located at "C:\Program Files\WinRAR\WinRar.exe" and my project file will be named "Test.pk3". If you wish to alter any of these options, just edit them out in the script variables (everything with "SET" at the start of the code).
If you're using Linux, the commands should be mostly the same, except you won't have to deal with Window's bullshit scripting language.
Spoiler: SublimeText project and Build SystemsOpen Sublimetext 3, go to Project -> Add Folder to Project, add your main project folder.
Save your project somewhere. In my case I saved it inside the main project folder.
Go to Project -> Edit project
Paste the following codeCode: Select all
{
"folders":
[
{
"path": "."
}
],
"build_systems":
[
{
"name": "build gzdoom",
"shell":true,
"working_dir": "${project_path}",
"windows":
{
"cmd":["make.cmd"]
},
}
]
}
Now go to Tools -> Build System
Select "build gzdoom"
Press crtl+b
If you've done everything right, the .cmd file should run and gzdoom should open.
Attachments
Final folder structure
This is a simple tutorial on how to use SublimeText 3 build systems and command line scripts to make your life easier if you're trying out Zscript and if you dislike SLADE3 (my case in particular). First of all, download SublimeText 3 and your sourceport of choice. In this tutorial I'll be using GZDoom. [spoiler=Folder structure]Everything on this section of the tutorial will affect the command line and Build Systems scripts later on, so if you wish to do something differently here you'll have to alter the scripts. [list] Create a folder with the project name of your choice. Extract your sourceport inside it. Move your iwads to the sourceport folder. Create a folder to store your mod files, in my case I named it "src". [/list][/spoiler] [spoiler=Windows scripts]Here's the dirty part, if you use Linux, this'll be a lot cleaner with a bash script. Inside your project main folder, create a file with the following name and extension: "make.cmd". Edit it and paste the following code: [code]SETLOCAL SET projectName=Test SET projectFolderName=src SET extension=.pk3 SET iwad=hexen.wad SET winrar=C:\Program Files\WinRAR\WinRar.exe IF EXIST "%cd%\%projectName%%extension%" ( DEL "%cd%\%projectName%%extension%" "%winrar%" a -r -ep1 -afzip "%projectName%%extension%" "%cd%\%projectFolderName%\" gzdoom\gzdoom.exe -iwad "%iwad%" -file "%projectName%%extension%" -skill 4 -warp 1 ) else ( "%winrar%" a -r -ep1 -afzip "%projectName%%extension%" "%cd%\%projectFolderName%\" gzdoom\gzdoom.exe -iwad "%iwad%" -file "%wad%" "%projectName%%extension%" -skill 4 -warp 1 )[/code] This script does the following: [list] If there's no file named "Test.pk3" on nthe main project folder, it compresses the "scr" folder into a a .zip with a .pk3 extension and then runs gzdoom with the chosen iwad on ultraviolence on the first map. Otherwise it first removes the existing "Test.pk3" file and does the same.[/list] In this case I'm using the hexen.wad as my iwad, my WinRar is located at "C:\Program Files\WinRAR\WinRar.exe" and my project file will be named "Test.pk3". If you wish to alter any of these options, just edit them out in the script variables (everything with "SET" at the start of the code). If you're using Linux, the commands should be mostly the same, except you won't have to deal with Window's bullshit scripting language.[/spoiler] [spoiler=SublimeText project and Build Systems][list]Open Sublimetext 3, go to Project -> Add Folder to Project, add your main project folder. Save your project somewhere. In my case I saved it inside the main project folder. Go to Project -> Edit project Paste the following code[code]{ "folders": [ { "path": "." } ], "build_systems": [ { "name": "build gzdoom", "shell":true, "working_dir": "${project_path}", "windows": { "cmd":["make.cmd"] }, } ] } [/code] Now go to Tools -> Build System Select "build gzdoom" Press crtl+b If you've done everything right, the .cmd file should run and gzdoom should open. [/list][/spoiler]