Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Commit

Permalink
Lets simplify our lives with ACS Libraries!
Browse files Browse the repository at this point in the history
I changed my mind; this should be much more efficient than individual
imports and re-compiling the map scripts every time there's a change
within the included scripts.
Note: We're using ZDoom's ACC version 1.55 from [
http://zdoom.org/Download ]
  • Loading branch information
SibTiger committed Mar 25, 2016
1 parent 9a9a3fd commit 1af6a03
Show file tree
Hide file tree
Showing 10 changed files with 1,604 additions and 40 deletions.
37 changes: 35 additions & 2 deletions Compiler_Map.bat
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ REM Create the standard archive filesystem
CALL :Make_ArchiveResourceFilesystem "%~1" || EXIT /B 1
REM Copy data from the SVN Project to the local directory
CALL :Make_DuplicateResourceAssets "%~1" || EXIT /B 1
REM Generate the ACS Library
CALL :Make_GenerateLibrary "%~1" || EXIT /B 1
EXIT /B 0


Expand All @@ -91,6 +93,8 @@ REM Revise the map name to the standard MAP scheme
CALL :Make_UpdateMapNames "%~1" || EXIT /B 1
REM Remove rubbish from Map directory
CALL :Make_ThrashSuperfluousMapData "%~1" || EXIT /B 1
REM Generate the ACS Library
CALL :Make_GenerateLibrary "%~1" || EXIT /B 1
REM IF: WYSIWYG patch alteration
EXIT /B 0

Expand All @@ -104,9 +108,12 @@ REM # ==========================================================================
REM This variable is used to describe the drivers main purpose and present the value in the log files.
CALL :CompileProject_Display_IncomingTaskSubLevel "Creating archive filesystem"
REM ----
REM ACS
REM ACS
SET "TaskCaller_CallLong=MKDIR %~1ACS"
CALL :CompileProject_TaskOperation || EXIT /B 1
REM Source
SET "TaskCaller_CallLong=MKDIR %~1Source"
CALL :CompileProject_TaskOperation || EXIT /B 1
REM Decorate
SET "TaskCaller_CallLong=MKDIR %~1Decorate"
CALL :CompileProject_TaskOperation || EXIT /B 1
Expand Down Expand Up @@ -149,9 +156,12 @@ REM # ==========================================================================
REM This variable is used to describe the drivers main purpose and present the value in the log files.
CALL :CompileProject_Display_IncomingTaskSubLevel "Creating resource archive filesystem"
REM ----
REM ACS
REM ACS
SET "TaskCaller_CallLong=MKDIR %~1ACS"
CALL :CompileProject_TaskOperation || EXIT /B 1
REM Source
SET "TaskCaller_CallLong=MKDIR %~1Source"
CALL :CompileProject_TaskOperation || EXIT /B 1
REM Decorate
SET "TaskCaller_CallLong=MKDIR %~1Decorate"
CALL :CompileProject_TaskOperation || EXIT /B 1
Expand Down Expand Up @@ -279,6 +289,9 @@ REM Music
REM Graphics
SET TaskCaller_CallLong=COPY %CopyIntCMDArg% "%UserConfig.DirProjectWorkingCopy%\Graphics\Fonts\*.*" "%~1Graphics\"
CALL :CompileProject_TaskOperation
REM Script Sources
SET TaskCaller_CallLong=COPY %CopyIntCMDArg% "%UserConfig.DirProjectWorkingCopy%\Scripts\*.*" "%~1Source\"
CALL :CompileProject_TaskOperation
EXIT /B 0


Expand Down Expand Up @@ -372,6 +385,9 @@ REM Music
REM Graphics
SET TaskCaller_CallLong=COPY %CopyIntCMDArg% "%UserConfig.DirProjectWorkingCopy%\Graphics\Fonts\*.*" "%~1Graphics\"
CALL :CompileProject_TaskOperation
REM Script Sources
SET TaskCaller_CallLong=COPY %CopyIntCMDArg% "%UserConfig.DirProjectWorkingCopy%\Scripts\*.*" "%~1Source\"
CALL :CompileProject_TaskOperation
EXIT /B 0


Expand Down Expand Up @@ -530,6 +546,23 @@ EXIT /B 0



REM # =============================================================================================
REM # Documentation: This function will create the library needed for the project as some maps depend on it.
REM # Parameters: [{String} Project Build Path]
REM # =============================================================================================
:Make_GenerateLibrary
REM This variable is used to describe the drivers main purpose and present the value in the log files.
CALL :CompileProject_Display_IncomingTaskSubLevel "Generating ACS Library"
REM ----
REM Thrash: DBS files [DB2 configuration for the individual map\wad]
SET TaskCaller_CallLong="%UserConfig.DirProjectWorkingCopy%\Tools\ZDoom ACC\acc.exe" -i "%~1Source" "%~1Source\StandardLibrary.acs" "%~1ACS\StandardLib.o" || EXIT /B 1
CALL :CompileProject_TaskOperation
REM =========================================================
EXIT /B 0







Expand Down
23 changes: 23 additions & 0 deletions Scripts/3DTeleport.acs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 3D Teleport
// Specialized script to teleport the player while on a 3D plain
// ----
// Description
// This will allow teleports that are either above, below, or inbetween 3D Floors to behave exactly like
// the standard teleporters; the player will be able to walk on to and above the LineDef to activate it.
// This is the only way I can figure out how to make teleporters that are above, below, or in-between 3D floors to behave EXACTLY
// like the regular teleporters that we all know in Doom ;)
// ----
// Parameters
// heightCeiling <int>
// The real value of the nearest ceiling
// heightFloor <int>
// The real value of the nearest floor
// mapSpotTarget <int>
// Teleport destination
SCRIPT "3DTeleport" (int heightCeiling, int heightFloor, int mapSpotTarget)
{
// Check the player's 2D vector
if ( ((GetActorCeilingZ(0) >> 16) == heightCeiling) && ( (GetActorFloorZ(0) >> 16) == heightFloor) )
// If the player is between the heightCeiling and heightFloor of the 3D Plain, teleport the player
Teleport(mapSpotTarget, 0, 0);
} // 3DTeleport()
13 changes: 13 additions & 0 deletions Scripts/JumpPadSounds.acs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Jumping Pad Sound
// This is a very tiny script that simply plays the jumping pad sound once activated
// ----
// Description
// This script will only play the default jumping pad sound as defined in the SNDINFO lump.
// ----
// Parameters
// Host THING tag <int>
// Plays the jump pad sound at the tag source
SCRIPT "JumpPadSound" (int tagTarget)
{
PlaySound(tagTarget, "World/JumpPad", CHAN_AUTO, 1.0, false, ATTN_NORM);
} // JumpPadSound()
46 changes: 10 additions & 36 deletions Scripts/StandardLibrary.acs
Original file line number Diff line number Diff line change
@@ -1,40 +1,14 @@
// 3D Teleport
// Specialized script to teleport the player while on a 3D plain
// ----
// Description
// This will allow teleports that are either above, below, or inbetween 3D Floors to behave exactly like
// the standard teleporters; the player will be able to walk on to and above the LineDef to activate it.
// This is the only way I can figure out how to make teleporters that are above, below, or in-between 3D floors to behave EXACTLY
// like the regular teleporters that we all know in Doom ;)
// ----
// Parameters
// heightCeiling <int>
// The real value of the nearest ceiling
// heightFloor <int>
// The real value of the nearest floor
// mapSpotTarget <int>
// Teleport destination
SCRIPT "3DTeleport" (int heightCeiling, int heightFloor, int mapSpotTarget)
{
// Check the player's 2D vector
if ( ((GetActorCeilingZ(0) >> 16) == heightCeiling) && ( (GetActorFloorZ(0) >> 16) == heightFloor) )
// If the player is between the heightCeiling and heightFloor of the 3D Plain, teleport the player
Teleport(mapSpotTarget, 0, 0);
} // 3DTeleport()
// Library name
#library "StandardLib"

// ZDoom stuff
#include "zcommon.acs"

// 3D Teleport algorithm
#include "3DTeleport.acs"

// Jumping Pad sounds
#include "JumpPadSounds.acs"

// Jumping Pad Sound
// This is a very tiny script that simply plays the jumping pad sound once activated
// ----
// Description
// This script will only play the default jumping pad sound as defined in the SNDINFO lump.
// ----
// Parameters
// Host THING tag <int>
// Plays the jump pad sound at the tag source
SCRIPT "JumpPadSound" (int tagTarget)
{
PlaySound(tagTarget, "World/JumpPad", CHAN_AUTO, 1.0, false, ATTN_NORM);
} // JumpPadSound()
// Lighting Fallback algorithm
#include "LightFallback.acs"
37 changes: 35 additions & 2 deletions Tools/Compiler [Bootless Star]/Compiler_Map.bat
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ REM Create the standard archive filesystem
CALL :Make_ArchiveResourceFilesystem "%~1" || EXIT /B 1
REM Copy data from the SVN Project to the local directory
CALL :Make_DuplicateResourceAssets "%~1" || EXIT /B 1
REM Generate the ACS Library
CALL :Make_GenerateLibrary "%~1" || EXIT /B 1
EXIT /B 0


Expand All @@ -91,6 +93,8 @@ REM Revise the map name to the standard MAP scheme
CALL :Make_UpdateMapNames "%~1" || EXIT /B 1
REM Remove rubbish from Map directory
CALL :Make_ThrashSuperfluousMapData "%~1" || EXIT /B 1
REM Generate the ACS Library
CALL :Make_GenerateLibrary "%~1" || EXIT /B 1
REM IF: WYSIWYG patch alteration
EXIT /B 0

Expand All @@ -104,9 +108,12 @@ REM # ==========================================================================
REM This variable is used to describe the drivers main purpose and present the value in the log files.
CALL :CompileProject_Display_IncomingTaskSubLevel "Creating archive filesystem"
REM ----
REM ACS
REM ACS
SET "TaskCaller_CallLong=MKDIR %~1ACS"
CALL :CompileProject_TaskOperation || EXIT /B 1
REM Source
SET "TaskCaller_CallLong=MKDIR %~1Source"
CALL :CompileProject_TaskOperation || EXIT /B 1
REM Decorate
SET "TaskCaller_CallLong=MKDIR %~1Decorate"
CALL :CompileProject_TaskOperation || EXIT /B 1
Expand Down Expand Up @@ -149,9 +156,12 @@ REM # ==========================================================================
REM This variable is used to describe the drivers main purpose and present the value in the log files.
CALL :CompileProject_Display_IncomingTaskSubLevel "Creating resource archive filesystem"
REM ----
REM ACS
REM ACS
SET "TaskCaller_CallLong=MKDIR %~1ACS"
CALL :CompileProject_TaskOperation || EXIT /B 1
REM Source
SET "TaskCaller_CallLong=MKDIR %~1Source"
CALL :CompileProject_TaskOperation || EXIT /B 1
REM Decorate
SET "TaskCaller_CallLong=MKDIR %~1Decorate"
CALL :CompileProject_TaskOperation || EXIT /B 1
Expand Down Expand Up @@ -279,6 +289,9 @@ REM Music
REM Graphics
SET TaskCaller_CallLong=COPY %CopyIntCMDArg% "%UserConfig.DirProjectWorkingCopy%\Graphics\Fonts\*.*" "%~1Graphics\"
CALL :CompileProject_TaskOperation
REM Script Sources
SET TaskCaller_CallLong=COPY %CopyIntCMDArg% "%UserConfig.DirProjectWorkingCopy%\Scripts\*.*" "%~1Source\"
CALL :CompileProject_TaskOperation
EXIT /B 0


Expand Down Expand Up @@ -372,6 +385,9 @@ REM Music
REM Graphics
SET TaskCaller_CallLong=COPY %CopyIntCMDArg% "%UserConfig.DirProjectWorkingCopy%\Graphics\Fonts\*.*" "%~1Graphics\"
CALL :CompileProject_TaskOperation
REM Script Sources
SET TaskCaller_CallLong=COPY %CopyIntCMDArg% "%UserConfig.DirProjectWorkingCopy%\Scripts\*.*" "%~1Source\"
CALL :CompileProject_TaskOperation
EXIT /B 0


Expand Down Expand Up @@ -530,6 +546,23 @@ EXIT /B 0



REM # =============================================================================================
REM # Documentation: This function will create the library needed for the project as some maps depend on it.
REM # Parameters: [{String} Project Build Path]
REM # =============================================================================================
:Make_GenerateLibrary
REM This variable is used to describe the drivers main purpose and present the value in the log files.
CALL :CompileProject_Display_IncomingTaskSubLevel "Generating ACS Library"
REM ----
REM Thrash: DBS files [DB2 configuration for the individual map\wad]
SET TaskCaller_CallLong="%UserConfig.DirProjectWorkingCopy%\Tools\ZDoom ACC\acc.exe" -i "%~1Source" "%~1Source\StandardLibrary.acs" "%~1ACS\StandardLib.o" || EXIT /B 1
CALL :CompileProject_TaskOperation
REM =========================================================
EXIT /B 0







Expand Down
Binary file added Tools/ZDoom ACC/acc.exe
Binary file not shown.
15 changes: 15 additions & 0 deletions Tools/ZDoom ACC/zcommon.acs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

//**************************************************************************
//**
//** zcommon.acs
//**
//**************************************************************************

// If you are not using the -h command line switch and do not want to use
// WadAuthor's error checker, you can uncomment the following line to shave
// a few bytes off the size of compiled scripts.
//#nowadauthor

#include "zspecial.acs"
#include "zdefs.acs"
#include "zwvars.acs"
Loading

0 comments on commit 1af6a03

Please sign in to comment.