├── .github
└── workflows
│ └── msbuild.yml
├── .gitignore
├── Deploy-SS2.cmd
├── Deploy-T1.cmd
├── Deploy-T2.cmd
├── NVDebug.vcproj
├── NVDebug.vcxproj
├── NVDebug.vcxproj.filters
├── NVScript ToDo.txt
├── NVScript.sln
├── NVScript.vcproj
├── NVScript.vcxproj
├── NVScript.vcxproj.filters
├── NVScript
├── Citadel.cpp
├── Citadel.h
├── Citadel.rc
├── CitadelChangeLog.txt
├── Make-Citadel.cmd
├── Make-DEBUG.cmd
├── Make-NVDebug.cmd
├── Make-SS2.cmd
├── Make-T1.cmd
├── Make.cmd
├── MakeCitadel.ccd
├── MakeNVDebug.ccd
├── MakeNVScript.ccd
├── MakeNVScriptDebug.ccd
├── MakeNVScriptSS2.ccd
├── MakeNVScriptT1.ccd
├── MakeNone.ccd
├── Makefile
├── NVChangelog.txt
├── NVDebug.cpp
├── NVDebug.h
├── NVDebug.rc
├── NVGenericScript.cpp
├── NVGenericScript.h
├── NVGenericTrigger.cpp
├── NVGenericTrigger.h
├── NVMaths.h
├── NVScript-CoSaS.cpp
├── NVScript-CoSaS.h
├── NVScript-Defunct.cpp
├── NVScript-Defunct.h
├── NVScript-Flames.cpp
├── NVScript-Flames.h
├── NVScript-SS2.cpp
├── NVScript-SS2.h
├── NVScript-ThiefShock.cpp
├── NVScript-ThiefShock.h
├── NVScript.cpp
├── NVScript.h
├── NVScript.html
├── NVScript.rc
├── NVScriptLib.cpp
├── NVScriptLib.h
├── ParamCache.h
├── ScrInstance.cpp
├── ScrInstance.h
├── Script.cpp
├── Script.h
├── ScriptLib.h
├── ScriptLib
│ ├── AddMetaProperty.cpp
│ ├── AddSingleMetaProperty.cpp
│ ├── CDSend.cpp
│ ├── CalcTextTime.cpp
│ ├── DebugPrintf.cpp
│ ├── DeleteAllLinks.cpp
│ ├── DeleteAllLinksByData.cpp
│ ├── DisplayPrintf.cpp
│ ├── FixupPlayerLinks.cpp
│ ├── GetAnyLink.cpp
│ ├── GetAnyLinkByData.cpp
│ ├── GetAnyLinkByDataDest.cpp
│ ├── GetAnyLinkByDataInheritedSrc.cpp
│ ├── GetAnyLinkDest.cpp
│ ├── GetAnyLinkInheritedSrc.cpp
│ ├── GetObjectParamBool.cpp
│ ├── GetObjectParamFloat.cpp
│ ├── GetObjectParamInt.cpp
│ ├── GetObjectParamObject.cpp
│ ├── GetObjectParamString.cpp
│ ├── GetObjectParamTime.cpp
│ ├── GetObjectParams.cpp
│ ├── GetObjectParamsNoInherit.cpp
│ ├── GetOneLink.cpp
│ ├── GetOneLinkByData.cpp
│ ├── GetOneLinkByDataDest.cpp
│ ├── GetOneLinkByDataInheritedSrc.cpp
│ ├── GetOneLinkDest.cpp
│ ├── GetOneLinkInheritedSrc.cpp
│ ├── GetParamBool.cpp
│ ├── GetParamFloat.cpp
│ ├── GetParamInt.cpp
│ ├── GetParamObject.cpp
│ ├── GetParamString.cpp
│ ├── GetParamTime.cpp
│ ├── GlobalParamCache.cpp
│ ├── HexTable.cpp
│ ├── IterateLinks.cpp
│ ├── IterateLinksByData.cpp
│ ├── MultiParmAssignFloat.cpp
│ ├── MultiParmAssignInt.cpp
│ ├── MultiParmAssignString.cpp
│ ├── MultiParmAssignVector.cpp
│ ├── ParamCache.cpp
│ ├── ParamExists.cpp
│ ├── ParamExistsDirect.cpp
│ ├── ParamGetBool.cpp
│ ├── ParamGetFloat.cpp
│ ├── ParamGetInt.cpp
│ ├── ParamGetObject.cpp
│ ├── ParamGetString.cpp
│ ├── ParamGetTime.cpp
│ ├── ParamRemove.cpp
│ ├── ParamSetBool.cpp
│ ├── ParamSetFloat.cpp
│ ├── ParamSetInt.cpp
│ ├── ParamSetString.cpp
│ ├── RemoveMetaProperty.cpp
│ ├── RemoveObjectParam.cpp
│ ├── RemoveSingleMetaProperty.cpp
│ ├── ScriptLib.cpp
│ ├── SetObjectParamBool.cpp
│ ├── SetObjectParamFloat.cpp
│ ├── SetObjectParamInt.cpp
│ ├── SetObjectParamString.cpp
│ ├── SetObjectParams.cpp
│ ├── SetParamBool.cpp
│ ├── SetParamFloat.cpp
│ ├── SetParamInt.cpp
│ ├── SetParamString.cpp
│ ├── ShowBook.cpp
│ ├── ShowString.cpp
│ ├── SimplePost.cpp
│ ├── SimpleSend.cpp
│ ├── StrToObject.cpp
│ ├── strqsep.cpp
│ ├── strsep.cpp
│ ├── strtocolor.cpp
│ └── strtotime.cpp
├── ScriptModule.cpp
├── ScriptModule.h
├── ScriptNV.cpp
├── ScriptNV.h
├── copyright.txt
├── genosm.pl
├── script.def
├── scriptvars.cpp
├── scriptvars.h
├── strless_nocase.h
└── version.rc
├── PackageSource.cmd
├── README.md
├── ScriptLib.vcproj
├── ScriptLib.vcxproj
├── ScriptLib.vcxproj.filters
├── buildconfig.h
├── building.txt
├── lg.vcproj
├── lg.vcxproj
├── lg.vcxproj.filters
└── lg
├── Makefile
├── Makefile-b32
├── Makefile-vc
├── iids.cpp
├── lg.cpp
├── lg
├── actreact.h
├── ai.h
├── config.h
├── convict.h
├── defs.h
├── dlgs.h
├── dynarray.h
├── dynarray.hpp
├── editor.h
├── gen.h
├── graphics.h
├── iiddef.h
├── iids.h
├── input.h
├── interface.h
├── links.h
├── malloc.h
├── miss16.h
├── objects.h
├── objstd.h
├── propdefs.h
├── properties.h
├── quest.h
├── res.h
├── script.h
├── scrmanagers.h
├── scrmsgs.h
├── scrservices.h
├── sound.h
├── stamp-20090113
├── tools.h
├── types.h
└── win.h
├── lg2007-changes.txt
├── scrmsgs.cpp
└── timestamp.sh
/.github/workflows/msbuild.yml:
--------------------------------------------------------------------------------
1 | name: MSBuild
2 |
3 | on:
4 | push:
5 | branches: [ "master" ]
6 | pull_request:
7 | branches: [ "master" ]
8 |
9 | env:
10 | # Path to the solution file relative to the root of the project.
11 | SOLUTION_FILE_PATH: NVScript.sln
12 |
13 | permissions:
14 | contents: write
15 |
16 | jobs:
17 | check_version:
18 | runs-on: windows-latest
19 |
20 | steps:
21 | - name: Checkout (with tags)
22 | uses: actions/checkout@v4
23 | with:
24 | fetch-depth: 0
25 |
26 | - name: Generate version number for release
27 | if: ${{ github.ref == 'refs/heads/master' }}
28 | run: |
29 | $CurrentVersion = git describe --tags --abbrev=0
30 | $NewVersion = ($CurrentVersion -replace "(v[0-9]+\.[0-9]+\.)([0-9])+", "`${1}") + (1 + ($CurrentVersion -replace "(v[0-9]+\.[0-9]+\.)([0-9])+", "`${2}"))
31 | echo "Old version was $CurrentVersion"
32 | echo "New version is $NewVersion"
33 | $NewVersion | Out-File -FilePath github.version
34 |
35 | - name: Generate version number for non-release build (with datestamp)
36 | if: ${{ github.ref != 'refs/heads/master' }}
37 | run: |
38 | $CurrentVersion = git describe --tags --abbrev=0
39 | $NewVersion = $(date "+v%Y.%m.%d")
40 | echo "Old version was $CurrentVersion"
41 | echo "New version is $NewVersion"
42 | $NewVersion | Out-File -FilePath github.version
43 |
44 | - name: Upload version number as artefact
45 | uses: actions/upload-artifact@v4
46 | with:
47 | name: github.version
48 | path: |
49 | github.version
50 |
51 | build:
52 | runs-on: windows-2019
53 | needs: check_version
54 |
55 | strategy:
56 | matrix:
57 | include:
58 | - BUILD_NAME: NVScript-T2
59 | BUILD_CONFIGURATION: Release
60 | - BUILD_NAME: NVScript-T1
61 | BUILD_CONFIGURATION: ReleaseT1
62 | - BUILD_NAME: NVScript-SS2
63 | BUILD_CONFIGURATION: ReleaseSS2
64 |
65 | steps:
66 | - name: Checkout code
67 | uses: actions/checkout@v4
68 |
69 | # - name: Install Windows XP-compatible toolset
70 | # uses: thepwrtank18/install-vs-components@v1.0.0
71 | # with:
72 | # components: Microsoft.VisualStudio.Component.WinXP
73 |
74 | - name: Add MSBuild to PATH
75 | uses: microsoft/setup-msbuild@v2
76 |
77 | - name: Restore NuGet packages
78 | working-directory: ${{env.GITHUB_WORKSPACE}}
79 | run: nuget restore ${{env.SOLUTION_FILE_PATH}}
80 |
81 | - name: Fetch version number artefact
82 | uses: actions/download-artifact@v4
83 | with:
84 | name: github.version
85 |
86 | - name: Generate version number
87 | run: |
88 | $VersionNumber=$(cat .\github.version)
89 | echo "Version number is $VersionNumber"
90 | $VersionMajor = ($VersionNumber -replace "v([0-9]+).([0-9]+).([0-9]+)", '${1}')
91 | $VersionMinor = ($VersionNumber -replace "v([0-9]+).([0-9]+).([0-9]+)", '${2}')
92 | $VersionBuild = ($VersionNumber -replace "v([0-9]+).([0-9]+).([0-9]+)", '${3}')
93 | (Get-Content .\buildconfig.h) -replace '(#define\W+NVSCRIPT_VERSION_MAJOR\W+)[0-9]+', "`${1}$VersionMajor" | Set-Content .\buildconfig.h
94 | (Get-Content .\buildconfig.h) -replace '(#define\W+NVSCRIPT_VERSION_MINOR\W+)[0-9]+', "`${1}$VersionMinor" | Set-Content .\buildconfig.h
95 | (Get-Content .\buildconfig.h) -replace '(#define\W+NVSCRIPT_VERSION_BUILD\W+)[0-9]+', "`${1}$VersionBuild" | Set-Content .\buildconfig.h
96 |
97 | - name: Read build config
98 | run: echo "$(Get-Content .\buildconfig.h)"
99 |
100 | - name: Build
101 | working-directory: ${{env.GITHUB_WORKSPACE}}
102 | # Add additional options to the MSBuild command line here (like platform or verbosity level).
103 | # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
104 | run: msbuild /m /p:Configuration=${{matrix.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
105 |
106 | - uses: actions/upload-artifact@v4
107 | with:
108 | name: ${{matrix.BUILD_NAME}}
109 | path: |
110 | D:\a\NVScript\NVScript\${{matrix.BUILD_CONFIGURATION}}\NVScript\NVScript.osm
111 | D:\a\NVScript\NVScript\${{matrix.BUILD_CONFIGURATION}}\NVScript\NVScript.html
112 |
113 | release:
114 | runs-on: windows-latest
115 | needs: build
116 | if: ${{ github.ref == 'refs/heads/master' }}
117 |
118 | steps:
119 | - name: Download artefacts
120 | uses: dawidd6/action-download-artifact@v6
121 | with:
122 | run_id: ${{ github.run_id }}
123 | path: outputs/
124 | skip_unpack: true
125 |
126 | - name: Fetch version number artefact
127 | uses: actions/download-artifact@v4
128 | with:
129 | name: github.version
130 |
131 | - name: Generate release tag
132 | id: tag
133 | run: |
134 | echo "release_tag=$(cat .\github.version)" >> $env:GITHUB_OUTPUT
135 |
136 | - name: File listing
137 | run: ls -r
138 |
139 | - name: Create release
140 | uses: softprops/action-gh-release@v2
141 | with:
142 | Name: NVScript-${{ steps.tag.outputs.release_tag }}
143 | tag_name: ${{ steps.tag.outputs.release_tag }}
144 | body: Automatic build on ${{ steps.tag.outputs.release_tag }}
145 | files: outputs/NVScript*.zip
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | #Ignore thumbnails created by Windows
3 | Thumbs.db
4 | #Ignore files built by Visual Studio
5 | *.obj
6 | *.exe
7 | *.pdb
8 | *.user
9 | *.aps
10 | *.pch
11 | *.vspscc
12 | *_i.c
13 | *_p.c
14 | *.ncb
15 | *.suo
16 | *.tlb
17 | *.tlh
18 | *.bak
19 | *.cache
20 | *.ilk
21 | *.log
22 | [Bb]in
23 | [Dd]ebug*/
24 | *.lib
25 | *.sbr
26 | *.VC.db
27 | obj/
28 | [Rr]elease*/
29 | _ReSharper*/
30 | [Tt]est[Rr]esult*
31 | .vs/
32 | #Nuget packages folder
33 | packages/
34 | /output/
35 | /NVScript-source
36 | /NVScript-source.zip
37 |
38 | *.o
39 | *.a
40 | *.osm
--------------------------------------------------------------------------------
/Deploy-SS2.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | REM This script packages the source code and builds a zip locally, moving OSM files into place as needed
3 | REM Note that you need 7-zip installed and in the path to build the archive, and git-bash with rsync to package the source
4 | REM (see comments in PackageSource.cmd for more details)
5 |
6 | REM Set EnableDeploy to true to enable
7 | set EnableDeploy=false
8 |
9 | rem The path to output build artefacts (osm/html/zip)
10 | set OutPath=output\shock2
11 |
12 |
13 | REM Script follows
14 | REM ========================
15 | set release=ReleaseSS2\NVScript
16 |
17 | if "%EnableDeploy%" == "false" exit
18 |
19 | call PackageSource.cmd
20 |
21 | echo Creating archive
22 | "7z.exe" a "output\NVScript.zip" ".\%release%\NVScript.osm" ".\%release%\NVScript.html" ".\output\source" -tzip -mx9 >NUL
23 |
24 | REM Copy build output to output path
25 | mkdir %OutPath%
26 | if exist %release%\NVScript.osm copy %release%\NVScript.osm "%OutPath%"
27 | if exist %release%\NVScript.html copy %release%\NVScript.html "%OutPath%"
28 | if exist output\NVScript.zip copy output\NVScript.zip "%OutPath%\NVScript-SS2.zip"
29 |
30 | REM Copy .osm to game dirs
31 | if exist %release%\NVScript.osm copy %release%\NVScript.osm "X:\Games\ShockEd"
32 |
--------------------------------------------------------------------------------
/Deploy-T1.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | REM This script packages the source code and builds a zip locally, moving OSM files into place as needed
3 | REM Note that you need 7-zip installed and in the path to build the archive, and git-bash with rsync to package the source
4 | REM (see comments in PackageSource.cmd for more details)
5 |
6 | REM Note that deployment is disabled by default.
7 |
8 | REM Set EnableDeploy to true to enable
9 | set EnableDeploy=false
10 |
11 | rem The path to output build artefacts (osm/html/zip)
12 | set OutPath=output\thief1
13 |
14 |
15 | REM Script follows
16 | REM ========================
17 | set release=ReleaseT1\NVScript
18 |
19 | if "%EnableDeploy%" == "false" exit
20 |
21 | call PackageSource.cmd
22 |
23 | echo Creating archive
24 | "7z.exe" a "output\NVScript.zip" ".\%release%\NVScript.osm" ".\%release%\NVScript.html" ".\output\source" -tzip -mx9 >NUL
25 |
26 | REM Copy build output to output path
27 | mkdir %OutPath%
28 | if exist %release%\NVScript.osm copy %release%\NVScript.osm "%OutPath%"
29 | if exist %release%\NVScript.html copy %release%\NVScript.html "%OutPath%"
30 | if exist output\NVScript.zip copy output\NVScript.zip "%OutPath%\NVScript-T1.zip"
31 |
32 | REM Copy .osm to game dirs
33 | if exist %release%\NVScript.osm copy %release%\NVScript.osm X:\Games\DromEd1
--------------------------------------------------------------------------------
/Deploy-T2.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | REM This script packages the source code and builds a zip locally, moving OSM files into place as needed
3 | REM Note that you need 7-zip installed and in the path to build the archive, and git-bash with rsync to package the source
4 | REM (see comments in PackageSource.cmd for more details)
5 |
6 | REM Set EnableDeploy to true to enable
7 | set EnableDeploy=false
8 |
9 | rem The path to output build artefacts (osm/html/zip)
10 | set OutPath=output\thief2
11 |
12 |
13 | REM Script follows
14 | REM ========================
15 | set release=Release\NVScript
16 |
17 | if "%EnableDeploy%" == "false" exit
18 |
19 | call PackageSource.cmd
20 |
21 | echo Creating archive
22 | "7z.exe" a "output\NVScript.zip" ".\%release%\NVScript.osm" ".\%release%\NVScript.html" ".\output\source" -tzip -mx9 >NUL
23 |
24 | REM Copy build output to output path
25 | mkdir %OutPath%
26 | if exist %release%\NVScript.osm copy %release%\NVScript.osm "%OutPath%"
27 | if exist %release%\NVScript.html copy %release%\NVScript.html "%OutPath%"
28 | if exist output\NVScript.zip copy output\NVScript.zip "%OutPath%"
29 |
30 | REM Copy .osm to game dirs
31 | if exist %release%\NVScript.osm copy %release%\NVScript.osm X:\Games\DromEd
32 | if exist %release%\NVScript.osm copy %release%\NVScript.osm X:\Games\DromEd\Mayan.osm
--------------------------------------------------------------------------------
/NVDebug.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 | Source Files
32 |
33 |
34 | Source Files
35 |
36 |
37 | Source Files
38 |
39 |
40 |
41 |
42 | Header Files
43 |
44 |
45 | Header Files
46 |
47 |
48 | Header Files
49 |
50 |
51 | Header Files
52 |
53 |
54 | Header Files
55 |
56 |
57 | Header Files
58 |
59 |
60 | Header Files
61 |
62 |
63 | Header Files
64 |
65 |
66 |
67 |
68 | Resource Files
69 |
70 |
71 |
--------------------------------------------------------------------------------
/NVScript ToDo.txt:
--------------------------------------------------------------------------------
1 | Sort multiplayer support
2 | check source for Tos' T2MP, ScriptHooks.cpp, line 69
3 |
4 | "Send Stim" message for NVConvEnhancer
5 |
6 | Built-in revert timer (for NVTrap scripts)
--------------------------------------------------------------------------------
/NVScript.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.438
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NVScript", "NVScript.vcxproj", "{8DA3AF8E-7C62-41D4-99C3-BF2ED005E187}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NVDebug", "NVDebug.vcxproj", "{8DA3AF8E-7C62-41D4-99C4-BF2ED005E187}"
9 | EndProject
10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lg", "lg.vcxproj", "{7326FEF0-652C-4C37-98A1-B8BBE4E7C443}"
11 | EndProject
12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ScriptLib", "ScriptLib.vcxproj", "{81F440D8-57C3-4DE6-8CD0-81432E7D4A80}"
13 | EndProject
14 | Global
15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
16 | Debug|Win32 = Debug|Win32
17 | DebugSS2|Win32 = DebugSS2|Win32
18 | DebugT1|Win32 = DebugT1|Win32
19 | Release|Win32 = Release|Win32
20 | ReleaseSS2|Win32 = ReleaseSS2|Win32
21 | ReleaseT1|Win32 = ReleaseT1|Win32
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {8DA3AF8E-7C62-41D4-99C3-BF2ED005E187}.Debug|Win32.ActiveCfg = Debug|Win32
25 | {8DA3AF8E-7C62-41D4-99C3-BF2ED005E187}.Debug|Win32.Build.0 = Debug|Win32
26 | {8DA3AF8E-7C62-41D4-99C3-BF2ED005E187}.DebugSS2|Win32.ActiveCfg = DebugSS2|Win32
27 | {8DA3AF8E-7C62-41D4-99C3-BF2ED005E187}.DebugSS2|Win32.Build.0 = DebugSS2|Win32
28 | {8DA3AF8E-7C62-41D4-99C3-BF2ED005E187}.DebugT1|Win32.ActiveCfg = DebugT1|Win32
29 | {8DA3AF8E-7C62-41D4-99C3-BF2ED005E187}.DebugT1|Win32.Build.0 = DebugT1|Win32
30 | {8DA3AF8E-7C62-41D4-99C3-BF2ED005E187}.Release|Win32.ActiveCfg = Release|Win32
31 | {8DA3AF8E-7C62-41D4-99C3-BF2ED005E187}.Release|Win32.Build.0 = Release|Win32
32 | {8DA3AF8E-7C62-41D4-99C3-BF2ED005E187}.ReleaseSS2|Win32.ActiveCfg = ReleaseSS2|Win32
33 | {8DA3AF8E-7C62-41D4-99C3-BF2ED005E187}.ReleaseSS2|Win32.Build.0 = ReleaseSS2|Win32
34 | {8DA3AF8E-7C62-41D4-99C3-BF2ED005E187}.ReleaseT1|Win32.ActiveCfg = ReleaseT1|Win32
35 | {8DA3AF8E-7C62-41D4-99C3-BF2ED005E187}.ReleaseT1|Win32.Build.0 = ReleaseT1|Win32
36 | {8DA3AF8E-7C62-41D4-99C4-BF2ED005E187}.Debug|Win32.ActiveCfg = Debug|Win32
37 | {8DA3AF8E-7C62-41D4-99C4-BF2ED005E187}.Debug|Win32.Build.0 = Debug|Win32
38 | {8DA3AF8E-7C62-41D4-99C4-BF2ED005E187}.DebugSS2|Win32.ActiveCfg = DebugSS2|Win32
39 | {8DA3AF8E-7C62-41D4-99C4-BF2ED005E187}.DebugSS2|Win32.Build.0 = DebugSS2|Win32
40 | {8DA3AF8E-7C62-41D4-99C4-BF2ED005E187}.DebugT1|Win32.ActiveCfg = DebugT1|Win32
41 | {8DA3AF8E-7C62-41D4-99C4-BF2ED005E187}.DebugT1|Win32.Build.0 = DebugT1|Win32
42 | {8DA3AF8E-7C62-41D4-99C4-BF2ED005E187}.Release|Win32.ActiveCfg = Release|Win32
43 | {8DA3AF8E-7C62-41D4-99C4-BF2ED005E187}.Release|Win32.Build.0 = Release|Win32
44 | {8DA3AF8E-7C62-41D4-99C4-BF2ED005E187}.ReleaseSS2|Win32.ActiveCfg = ReleaseSS2|Win32
45 | {8DA3AF8E-7C62-41D4-99C4-BF2ED005E187}.ReleaseSS2|Win32.Build.0 = ReleaseSS2|Win32
46 | {8DA3AF8E-7C62-41D4-99C4-BF2ED005E187}.ReleaseT1|Win32.ActiveCfg = ReleaseT1|Win32
47 | {8DA3AF8E-7C62-41D4-99C4-BF2ED005E187}.ReleaseT1|Win32.Build.0 = ReleaseT1|Win32
48 | {7326FEF0-652C-4C37-98A1-B8BBE4E7C443}.Debug|Win32.ActiveCfg = Debug|Win32
49 | {7326FEF0-652C-4C37-98A1-B8BBE4E7C443}.Debug|Win32.Build.0 = Debug|Win32
50 | {7326FEF0-652C-4C37-98A1-B8BBE4E7C443}.DebugSS2|Win32.ActiveCfg = DebugSS2|Win32
51 | {7326FEF0-652C-4C37-98A1-B8BBE4E7C443}.DebugSS2|Win32.Build.0 = DebugSS2|Win32
52 | {7326FEF0-652C-4C37-98A1-B8BBE4E7C443}.DebugT1|Win32.ActiveCfg = DebugT1|Win32
53 | {7326FEF0-652C-4C37-98A1-B8BBE4E7C443}.DebugT1|Win32.Build.0 = DebugT1|Win32
54 | {7326FEF0-652C-4C37-98A1-B8BBE4E7C443}.Release|Win32.ActiveCfg = Release|Win32
55 | {7326FEF0-652C-4C37-98A1-B8BBE4E7C443}.Release|Win32.Build.0 = Release|Win32
56 | {7326FEF0-652C-4C37-98A1-B8BBE4E7C443}.ReleaseSS2|Win32.ActiveCfg = ReleaseSS2|Win32
57 | {7326FEF0-652C-4C37-98A1-B8BBE4E7C443}.ReleaseSS2|Win32.Build.0 = ReleaseSS2|Win32
58 | {7326FEF0-652C-4C37-98A1-B8BBE4E7C443}.ReleaseT1|Win32.ActiveCfg = ReleaseT1|Win32
59 | {7326FEF0-652C-4C37-98A1-B8BBE4E7C443}.ReleaseT1|Win32.Build.0 = ReleaseT1|Win32
60 | {81F440D8-57C3-4DE6-8CD0-81432E7D4A80}.Debug|Win32.ActiveCfg = Debug|Win32
61 | {81F440D8-57C3-4DE6-8CD0-81432E7D4A80}.Debug|Win32.Build.0 = Debug|Win32
62 | {81F440D8-57C3-4DE6-8CD0-81432E7D4A80}.DebugSS2|Win32.ActiveCfg = DebugSS2|Win32
63 | {81F440D8-57C3-4DE6-8CD0-81432E7D4A80}.DebugSS2|Win32.Build.0 = DebugSS2|Win32
64 | {81F440D8-57C3-4DE6-8CD0-81432E7D4A80}.DebugT1|Win32.ActiveCfg = DebugT1|Win32
65 | {81F440D8-57C3-4DE6-8CD0-81432E7D4A80}.DebugT1|Win32.Build.0 = DebugT1|Win32
66 | {81F440D8-57C3-4DE6-8CD0-81432E7D4A80}.Release|Win32.ActiveCfg = Release|Win32
67 | {81F440D8-57C3-4DE6-8CD0-81432E7D4A80}.Release|Win32.Build.0 = Release|Win32
68 | {81F440D8-57C3-4DE6-8CD0-81432E7D4A80}.ReleaseSS2|Win32.ActiveCfg = ReleaseSS2|Win32
69 | {81F440D8-57C3-4DE6-8CD0-81432E7D4A80}.ReleaseSS2|Win32.Build.0 = ReleaseSS2|Win32
70 | {81F440D8-57C3-4DE6-8CD0-81432E7D4A80}.ReleaseT1|Win32.ActiveCfg = ReleaseT1|Win32
71 | {81F440D8-57C3-4DE6-8CD0-81432E7D4A80}.ReleaseT1|Win32.Build.0 = ReleaseT1|Win32
72 | EndGlobalSection
73 | GlobalSection(SolutionProperties) = preSolution
74 | HideSolutionNode = FALSE
75 | EndGlobalSection
76 | GlobalSection(ExtensibilityGlobals) = postSolution
77 | SolutionGuid = {1C4DE9E1-9AE6-4A75-B66B-8523B9361CE5}
78 | EndGlobalSection
79 | EndGlobal
80 |
--------------------------------------------------------------------------------
/NVScript.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 | Source Files
32 |
33 |
34 | Source Files
35 |
36 |
37 | Source Files
38 |
39 |
40 | Source Files
41 |
42 |
43 | Source Files
44 |
45 |
46 | Source Files
47 |
48 |
49 | Source Files
50 |
51 |
52 | Source Files
53 |
54 |
55 | Source Files
56 |
57 |
58 |
59 |
60 | Header Files
61 |
62 |
63 | Header Files
64 |
65 |
66 | Header Files
67 |
68 |
69 | Header Files
70 |
71 |
72 | Header Files
73 |
74 |
75 | Header Files
76 |
77 |
78 | Header Files
79 |
80 |
81 | Header Files
82 |
83 |
84 | Header Files
85 |
86 |
87 | Header Files
88 |
89 |
90 | Header Files
91 |
92 |
93 | Header Files
94 |
95 |
96 | Header Files
97 |
98 |
99 | Header Files
100 |
101 |
102 | Header Files
103 |
104 |
105 |
106 |
107 | Resource Files
108 |
109 |
110 |
--------------------------------------------------------------------------------
/NVScript/Citadel.rc:
--------------------------------------------------------------------------------
1 | // The major version number will be incremented for each release that may break
2 | // compatibility with older releases. If I feel confident that there won't
3 | // be any problems, I'll only increment the minor version.
4 | //
5 | // If you make your own modifications, please increase the revision or
6 | // sub-revision levels. But leave the major and minor version numbers alone.
7 | // You should also change the description to something else. Official releases
8 | // are labelled "NVScript Thief2 OSM"
9 | //
10 | #define SCRIPT_VERSION 1,0,0,0
11 | #define SCRIPT_VERSTRING "1.0.0"
12 | #define SCRIPT_NAME "Citadel Script Module"
13 | #define SCRIPT_LONGNAME "Citadel System Shock 2 OSM"
14 |
15 | #include "version.rc"
16 |
17 |
--------------------------------------------------------------------------------
/NVScript/CitadelChangeLog.txt:
--------------------------------------------------------------------------------
1 | ----- 2005/06/29
2 | * Increased the number of dynamic lights for Night Vision effect from 9 to 17.
3 | * Right-clicking now properly adjusts the 'Active/Inactive' text in the Settings window.
4 | * Hardware is no longer turned off then on unless the settings are actually changed.
5 | * Batteries are no longer used when power is already at maximum.
--------------------------------------------------------------------------------
/NVScript/Make-Citadel.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | set OutPath=output
3 |
4 | if exist Citadel_osm.cpp del Citadel_osm.cpp
5 | if exist Citadel_osm.o del Citadel_osm.o
6 | if exist Citadel.o del Citadel.o
7 | if not exist MakeShock del *.o
8 | if not exist MakeShock echo . >MakeShock
9 | D:\CygWin\bin\bash --login -i MakeCitadel.ccd
10 |
11 | echo.
12 |
13 | if not exist Citadel.osm echo ERROR compiling Citadel.osm (SS2)
14 | if exist Citadel.osm echo Citadel.osm (SS2) compiled successfully.
15 |
16 | if exist Citadel.osm copy Citadel.osm "%OutPath%"
17 |
--------------------------------------------------------------------------------
/NVScript/Make-DEBUG.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | if exist NVScript_osm.cpp del NVScript_osm.cpp
3 | if exist NVScript_osm.o del NVScript_osm.o
4 | if exist NVScript.o del NVScript.o
5 | if exist MakeShock del *.o
6 | if exist MakeShock del MakeShock
7 | D:\CygWin\bin\bash --login -i MakeNVScriptDebug.ccd
8 |
9 | echo.
10 | if not exist NVScript.osm echo ERROR compiling NVScript.osm
11 | if exist NVScript.osm echo NVScript.osm compiled successfully.
12 |
--------------------------------------------------------------------------------
/NVScript/Make-NVDebug.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | if exist NVScript_osm.cpp del NVScript_osm.cpp
3 | if exist NVScript_osm.o del NVScript_osm.o
4 | if exist NVScript.o del NVScript.o
5 | if exist MakeShock del *.o
6 | if exist MakeShock del MakeShock
7 | if exist MakeT1 del *.o
8 | if exist MakeT1 del MakeShock
9 | D:\CygWin\bin\bash --login -i MakeNVDebug.ccd
10 |
11 | echo.
12 | if not exist NVDebug.osm echo ERROR compiling NVDebug.osm
13 | if exist NVDebug.osm echo NVDebug.osm compiled successfully.
14 |
--------------------------------------------------------------------------------
/NVScript/Make-SS2.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | set OutPath=output
3 |
4 | if exist NVScript_osm.cpp del NVScript_osm.cpp
5 | if exist NVScript_osm.o del NVScript_osm.o
6 | if exist NVScript.o del NVScript.o
7 | if exist NVScript-SS2.o del NVScript-SS2.o
8 | if exist NVScript-ThiefShock.o del NVScript-ThiefShock.o
9 | if not exist MakeShock del *.o
10 | if not exist MakeShock echo . >MakeShock
11 | D:\CygWin\bin\bash --login -i ~/NVScript/NVScript/MakeNVScriptSS2.ccd
12 |
13 | echo.
14 | if not exist NVScript.osm echo ERROR compiling NVScript.osm (SS2)
15 | if exist NVScript.osm echo NVScript.osm (SS2) compiled successfully.
16 |
17 | if exist NVScript.osm copy NVScript.osm "%OutPath%"
18 |
19 | if not exist NVDebug.osm echo ERROR compiling NVDebug.osm
20 | if exist NVDebug.osm echo NVDebug.osm compiled successfully.
21 |
22 | if exist NVDebug.osm copy NVDebug.osm "%OutPath%"
23 |
24 |
25 |
26 | if not exist Citadel.osm echo ERROR compiling Citadel.osm (SS2)
27 | if exist Citadel.osm echo Citadel.osm (SS2) compiled successfully.
28 |
29 | if exist Citadel.osm copy Citadel.osm "%OutPath%"
30 |
31 | if exist NVScript.html copy NVScript.html NVScript-SS2.html
32 |
33 | ..\replace.exe "NVScript-SS2.html" "/*T2Version-Start*/" "/*T2Version-Start"
34 | ..\replace.exe "NVScript-SS2.html" "/*T2Version-End*/" "T2Version-Start*/"
35 | ..\replace.exe "NVScript-SS2.html" "/*SS2Version-Start" "/*SS2Version-Start*/"
36 | ..\replace.exe "NVScript-SS2.html" "SS2Version-End*/" "/*SS2Version-End*/"
37 |
38 | if exist NVScript-SS2.html move NVScript-SS2.html "%OutPath%\NVScript.html"
39 |
40 | if exist "%OutPath%\NVScript-SS2.zip" del "%OutPath%\NVScript-SS2.zip"
41 | if exist %OutPath%\NVScript.osm 7z.exe a "%OutPath%\NVScript-SS2.zip" "%OutPath%\NVScript.osm" "%OutPath%\NVScript.html" -tzip -mx9 >NUL
--------------------------------------------------------------------------------
/NVScript/Make-T1.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | set OutPath=output
3 |
4 | if exist NVScript_osm.cpp del NVScript_osm.cpp
5 | if exist NVScript_osm.o del NVScript_osm.o
6 | if exist NVScript.o del NVScript.o
7 | if not exist MakeT1 del *.o
8 | if not exist MakeT1 echo . >MakeT1
9 | D:\CygWin\bin\bash --login -i ~/NVScript/NVScript/MakeNVScriptT1.ccd
10 |
11 | echo.
12 | if not exist NVScript.osm echo ERROR compiling NVScript.osm (T1)
13 | if exist NVScript.osm echo NVScript.osm (T1) compiled successfully.
14 |
15 | if exist NVScript.osm copy NVScript.osm "%OutPath%"
16 | if exist NVScript.osm move NVScript.osm "C:\Games\DromEd1"
17 |
18 | echo Copying documentation to output
19 | if exist NVScript.html copy NVScript.html "%OutPath%"
20 |
21 | if exist "%OutPath%\NVScript-T1.zip" del "%OutPath%\NVScript-T1.zip"
22 | if exist %OutPath%\NVScript.osm 7z.exe a "%OutPath%\NVScript-T1.zip" "%OutPath%\NVScript.osm" "%OutPath%\NVScript.html" -tzip -mx9 >NUL
--------------------------------------------------------------------------------
/NVScript/Make.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | set OutPath=output
3 |
4 | if exist NVScript_osm.cpp del NVScript_osm.cpp
5 | if exist NVScript_osm.o del NVScript_osm.o
6 | if exist NVScript.o del NVScript.o
7 | if exist NVScriptLib.o del NVScriptLib.o
8 | if exist MakeShock del *.o
9 | if exist MakeShock del MakeShock
10 |
11 | if exist MakeT1 del *.o
12 | if exist MakeT1 del MakeT1
13 | D:\CygWin\bin\bash --login -i ~/NVScript/NVScript/MakeNVScript.ccd
14 |
15 | echo.
16 | if not exist NVScript.osm echo ERROR compiling NVScript.osm
17 | if exist NVScript.osm echo NVScript.osm compiled successfully.
18 |
19 |
20 | if exist NVScript.osm move NVScript.osm "%OutPath%"
21 |
22 | echo Readying documentation
23 | if exist NVScript.html copy NVScript.html "%OutPath%"
24 |
25 | cd "%OutPath%"
26 | if exist "NVScript.zip" del "NVScript.zip"
27 | if exist NVScript.osm "7z.exe" a "NVScript.zip" "NVScript.osm" "NVScript.html" -tzip -mx9 >NUL
28 |
29 | cd ..
--------------------------------------------------------------------------------
/NVScript/MakeCitadel.ccd:
--------------------------------------------------------------------------------
1 | make -C ~/NVScript/NVScript Citadel.osm GAMESUFFIX="-SS2" GAME=3
2 |
--------------------------------------------------------------------------------
/NVScript/MakeNVDebug.ccd:
--------------------------------------------------------------------------------
1 | make -C ~/NVScript/NVScript NVDebug.osm
--------------------------------------------------------------------------------
/NVScript/MakeNVScript.ccd:
--------------------------------------------------------------------------------
1 | make -C ~/NVScript/NVScript NVDebug.osm
2 | make -C ~/NVScript/NVScript NVScript.osm
--------------------------------------------------------------------------------
/NVScript/MakeNVScriptDebug.ccd:
--------------------------------------------------------------------------------
1 | make -C ~/NVScript/NVScript NVScript.osm DEBUG=1
2 |
--------------------------------------------------------------------------------
/NVScript/MakeNVScriptSS2.ccd:
--------------------------------------------------------------------------------
1 | make -C ~/NVScript/NVScript NVDebug.osm GAMESUFFIX="-SS2" SSINCLUDEH="NVScript-SS2.h NVScript-ThiefShock.h" SSINCLUDEO="NVScript-SS2.o NVScript-ThiefShock.o" SSINCLUDEC="NVScript-SS2.cpp NVScript-ThiefShock.cpp" GAME=3
2 | make -C ~/NVScript/NVScript Citadel.osm GAMESUFFIX="-SS2" SSINCLUDEH="NVScript-SS2.h NVScript-ThiefShock.h" SSINCLUDEO="NVScript-SS2.o NVScript-ThiefShock.o" SSINCLUDEC="NVScript-SS2.cpp NVScript-ThiefShock.cpp" GAME=3
3 | make -C ~/NVScript/NVScript NVScript.osm GAMESUFFIX="-SS2" SSINCLUDEH="NVScript-SS2.h NVScript-ThiefShock.h" SSINCLUDEO="NVScript-SS2.o NVScript-ThiefShock.o" SSINCLUDEC="NVScript-SS2.cpp NVScript-ThiefShock.cpp" GAME=3
--------------------------------------------------------------------------------
/NVScript/MakeNVScriptT1.ccd:
--------------------------------------------------------------------------------
1 | make -C ~/NVScript/NVScript NVDebug.osm GAMESUFFIX="-T1" GAME=1
2 | make -C ~/NVScript/NVScript Citadel.osm GAMESUFFIX="-T1" GAME=1
3 | make -C ~/NVScript/NVScript NVScript.osm GAMESUFFIX="-T1" GAME=1
--------------------------------------------------------------------------------
/NVScript/MakeNone.ccd:
--------------------------------------------------------------------------------
1 | cd NVScript
2 | cd NVScript
3 | echo make NVScript.osm {GAME=2} {BUILD=1} {DEBUG=}
--------------------------------------------------------------------------------
/NVScript/NVDebug.cpp:
--------------------------------------------------------------------------------
1 | //#if _DARKGAME != 2
2 | //#error NVDebug is written for Thief2. You can try, but I doubt it.
3 | //#else
4 |
5 | // #include
6 | //#include
7 |
8 | //#include "lg/interface.h"
9 | #include "lg/scrservices.h"
10 | //#include "lg/scrmanagers.h"
11 | #include "lg/scrmsgs.h"
12 | #include "ScriptLib.h"
13 |
14 | #define INITOSM
15 | #include "NVDebug.h"
16 |
17 | #include "lg/iids.h"
18 |
19 |
20 | /***********************
21 | * NVDifficultyDebug
22 | */
23 |
24 | MSGHANDLER cScr_NVDifficultyDebug::OnSim(sScrMsg* pMsg, sMultiParm* pReply, eScrTraceAction eTrace)
25 | {
26 | if (static_cast(pMsg)->fStarting)
27 | {
28 | SService pQSrv(g_pScriptManager);
29 | int iCurrent = -1; // Default value (if QVar doesn't exist)
30 | if (!pQSrv->Exists("Difficulty"))
31 | {
32 | if (pQSrv->Exists("DebugDifficulty"))
33 | {
34 | iCurrent = pQSrv->Get("DebugDifficulty"); // Get QVar value
35 | pQSrv->Set("difficulty", iCurrent, 0);
36 |
37 | // Process Difficulty:
38 | SService pDebugSrv(g_pScriptManager);
39 | pDebugSrv->Command("process_difficulty", "", "", "", "", "", "", "");
40 | }
41 | }
42 |
43 | // Display warning/info (to remind people to delete the object before packing the FM).
44 | #if (_DARKGAME != 3)
45 | switch ( iCurrent )
46 | {
47 | case -1:
48 | DisplayPrintf("Object %i is being used as Difficulty Debug\nNo difficulty defined.", m_iObjId);
49 | break;
50 | case 0:
51 | DisplayPrintf("Object %i is being used as Difficulty Debug\nDifficulty processed as 'Normal' (%i)", m_iObjId, iCurrent);
52 | break;
53 | case 1:
54 | DisplayPrintf("Object %i is being used as Difficulty Debug\nDifficulty processed as 'Hard' (%i)", m_iObjId, iCurrent);
55 | break;
56 | case 2:
57 | DisplayPrintf("Object %i is being used as Difficulty Debug\nDifficulty processed as 'Expert' (%i)", m_iObjId, iCurrent);
58 | break;
59 | default:
60 | DisplayPrintf("Object %i is being used as Difficulty Debug\nInvalid difficulty specified (%i)", m_iObjId, iCurrent);
61 | }
62 | #else
63 | switch ( iCurrent )
64 | {
65 | case -1:
66 | DisplayPrintf("Object %i is being used as Difficulty Debug\nNo difficulty defined.", m_iObjId);
67 | break;
68 | case 0:
69 | DisplayPrintf("Object %i is being used as Difficulty Debug\nDifficulty processed as 'Easy' (%i)", m_iObjId, iCurrent);
70 | break;
71 | case 1:
72 | DisplayPrintf("Object %i is being used as Difficulty Debug\nDifficulty processed as 'Normal' (%i)", m_iObjId, iCurrent);
73 | break;
74 | case 2:
75 | DisplayPrintf("Object %i is being used as Difficulty Debug\nDifficulty processed as 'Hard' (%i)", m_iObjId, iCurrent);
76 | break;
77 | case 3:
78 | DisplayPrintf("Object %i is being used as Difficulty Debug\nDifficulty processed as 'Impossible' (%i)", m_iObjId, iCurrent);
79 | break;
80 | default:
81 | DisplayPrintf("Object %i is being used as Difficulty Debug\nInvalid difficulty specified (%i)", m_iObjId, iCurrent);
82 | }
83 | #endif
84 | }
85 |
86 |
87 | return 0;
88 | }
89 |
90 | /***********************
91 | * NVObjDumper
92 | */
93 |
94 | MSGHANDLER cScr_NVObjDumper::OnBeginScript(sScrMsg* pMsg, sMultiParm* pReply, eScrTraceAction eTrace)
95 | {
96 | SService pOS(g_pScriptManager);
97 | cScrVec vPosition;
98 | pOS->Position(vPosition, m_iObjId);
99 |
100 | SInterface pTraits(g_pScriptManager);
101 | int iArchetype = pTraits->GetArchetype(m_iObjId); // Make a note of object's archetype.
102 |
103 | cScrStr strName;
104 | pOS->GetName(strName, iArchetype);
105 |
106 | DebugPrintf("%s (%i) at (%f, %f, %f)", static_cast(strName), m_iObjId, vPosition.x, vPosition.y, vPosition.z);
107 |
108 | return 0;
109 | }
110 | //#endif // _DARKGAME == 2
111 |
--------------------------------------------------------------------------------
/NVScript/NVDebug.h:
--------------------------------------------------------------------------------
1 | /****************************************
2 | * Scripts by Nameless Voice
3 | *
4 | */
5 |
6 | #ifndef NVDEBUGSCRIPT_H
7 | #define NVDEBUGSCRIPT_H
8 |
9 | #if _MSC_VER > 1000
10 | #pragma once
11 | #endif
12 |
13 | #include "lg/scrservices.h"
14 | #include "lg/properties.h"
15 |
16 | #include "scriptvars.h"
17 | //#include "Script.h"
18 | #include "ScriptNV.h"
19 |
20 |
21 | DECLARE_MODULE(NVDebug)
22 |
23 | /***************************************************
24 | * Debug / playtesting scripts.
25 | * Maybe these should be moved to a new module?
26 | **************************************************/
27 |
28 |
29 |
30 | /**************************
31 | * NVDifficultyDebug
32 | *
33 | * A script designed solely for use in DromEd game mode!?
34 | *
35 | * Messages: Sim
36 | * Parameters: None
37 | * Links: None
38 | */
39 | DECLARE_SCRIPT(cScr_NVDifficultyDebug,cScriptNV)
40 | {
41 | public:
42 | DECLARE_FACTORY(NVDifficultyDebug,CustomScript);
43 | cScr_NVDifficultyDebug(const char* pszName, int iHostObjId)
44 | : cScriptNV(pszName,iHostObjId)
45 | { }
46 |
47 | private:
48 | DECLARE_MSGHANDLER(OnSim);
49 |
50 | protected:
51 |
52 | virtual void InitScriptData()
53 | {
54 | cScriptNV::InitScriptData();
55 | REGISTER_MSGHANDLER("Sim", cScr_NVDifficultyDebug::OnSim);
56 | }
57 | };
58 |
59 | /**************************
60 | * NVObjDumper
61 | *
62 | * Dumps information about its object on BeginScript
63 | *
64 | * Messages: BeginScript
65 | * Parameters: None
66 | * Links: None
67 | */
68 | DECLARE_SCRIPT(cScr_NVObjDumper,cScriptNV)
69 | {
70 | public:
71 | DECLARE_FACTORY(NVObjDumper,CustomScript);
72 | cScr_NVObjDumper(const char* pszName, int iHostObjId)
73 | : cScriptNV(pszName,iHostObjId)
74 | { }
75 |
76 | private:
77 | // nothing
78 |
79 | protected:
80 | virtual void InitScriptData()
81 | {
82 | cScriptNV::InitScriptData();
83 | }
84 |
85 | virtual MSGHANDLER OnBeginScript(sScrMsg* pMsg, sMultiParm* pReply, eScrTraceAction eTrace);
86 | };
87 |
88 | #endif
89 |
--------------------------------------------------------------------------------
/NVScript/NVDebug.rc:
--------------------------------------------------------------------------------
1 | // This is the version resource file for the makefile build.
2 | // Not really used any more, versions are just pulled from buildconfig.h
3 | //
4 | #define MODULE_NVDEBUG
5 | #include "../buildconfig.h"
6 | #undef MODULE_NVDEBUG
7 |
8 | #include "version.rc"
9 |
10 |
--------------------------------------------------------------------------------
/NVScript/NVGenericScript.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef NVGENERICSCRIPT_H
3 | #define NVGENERICSCRIPT_H
4 |
5 | #include "scriptvars.h"
6 | #include "ScriptNV.h"
7 |
8 |
9 | /*****************
10 | * Generic Script
11 | *
12 | */
13 | class cScrNVGeneric : public cScriptNV
14 | {
15 | public:
16 | cScrNVGeneric(const char* pszName, int iHostObjId)
17 | : cScriptNV(pszName, iHostObjId),
18 | SCRIPT_VAROBJ(m_iUseCount),
19 | SCRIPT_VAROBJ(m_iOnCapacitor),
20 | SCRIPT_VAROBJ(m_iOffCapacitor),
21 | SCRIPT_VAROBJ(m_iOnCapacitorTime),
22 | SCRIPT_VAROBJ(m_iOffCapacitorTime)
23 | { }
24 |
25 | STDMETHOD_(long,ReceiveMessage)(sScrMsg*,sMultiParm*,eScrTraceAction);
26 |
27 | private:
28 | // Nothing private
29 |
30 | protected:
31 | script_int m_iUseCount;
32 | script_int m_iOnCapacitor;
33 | script_int m_iOffCapacitor;
34 | script_int m_iOnCapacitorTime;
35 | script_int m_iOffCapacitorTime;
36 |
37 | virtual void InitGenericVars(void)
38 | {
39 | m_iUseCount.Init();
40 | m_iOnCapacitor.Init();
41 | m_iOffCapacitor.Init();
42 | m_iOnCapacitorTime.Init();
43 | m_iOffCapacitorTime.Init();
44 | return;
45 | }
46 |
47 | virtual bool AnyUsesLeft(bool bOn);
48 | virtual bool CheckCapacitor(bool bOn, int iTime);
49 | virtual MSGHANDLER OnPreActivate(sScrMsg* pMsg, sMultiParm* pReply, eScrTraceAction eTrace);
50 | virtual MSGHANDLER OnPreDeactivate(sScrMsg* pMsg, sMultiParm* pReply, eScrTraceAction eTrace);
51 | virtual MSGHANDLER OnActivate(sScrMsg* pMsg, sMultiParm* pReply, eScrTraceAction eTrace) = 0;
52 | virtual MSGHANDLER OnDeactivate(sScrMsg* pMsg, sMultiParm* pReply, eScrTraceAction eTrace) = 0;
53 |
54 | public:
55 | // Nothing public
56 | };
57 |
58 | #endif // NVGENERICSCRIPT_H
59 |
--------------------------------------------------------------------------------
/NVScript/NVGenericTrigger.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef NVGENERICTRIGGER_H
3 | #define NVGENERICTRIGGER_H
4 |
5 | #include "scriptvars.h"
6 | #include "ScriptNV.h"
7 |
8 | /*
9 | * Generic Script
10 | *
11 | */
12 | class cScrNVTrigger
13 | {
14 | public:
15 | cScrNVTrigger()
16 | : m_iTrigObjId(0)
17 | {
18 | m_szTriggerName = new char[1];
19 | m_szTriggerName[0] = '\0';
20 | }
21 | cScrNVTrigger(const char* pszName,int iHostObjId)
22 | : m_iTrigObjId(iHostObjId)
23 | {
24 | m_szTriggerName = new char[strlen(pszName) + 1];
25 | strcpy(m_szTriggerName, pszName);
26 | }
27 |
28 | virtual ~cScrNVTrigger()
29 | {
30 | if (m_szTriggerName)
31 | {
32 | delete[] m_szTriggerName;
33 | m_szTriggerName = NULL;
34 | }
35 | }
36 |
37 | private:
38 | int m_iTrigObjId;
39 | char* m_szTriggerName;
40 | static int StimIterFunc(ILinkSrv* pLS, ILinkQuery* pLQ, IScript* pScript, void* pData);
41 | long TriggerSingleObject(object oDest, const char* pszMessage, int iMsgTime);
42 | long StimSingleObject(object oDest, object oStim, float fIntensity);
43 | long StimSingleObject(IActReactSrv* pARSrv, object oDest, object oStim, float fIntensity);
44 | // Nothing private
45 |
46 | protected:
47 | virtual void InitScriptData()
48 | {
49 |
50 | // Message handler registration function has not been inherited from cScript.
51 | // I think I'll just add this code to all decendants of this script instead.
52 | // RegisterMessageHandler("ResetTriggerCount", static_cast(&cScrNVTrigger::OnResetTriggerCount));
53 |
54 | return;
55 | }
56 |
57 | virtual long Trigger(bool bOn, sScrMsg* pMsg, int iDefaultDest = 0, const char* szDefaultOnMessage = "TurnOn", const char* szDefaultOffMessage = "TurnOff");
58 |
59 | void ResetTriggerCount();
60 |
61 | public:
62 | // Nothing public
63 | };
64 |
65 | #endif // NVGENERICTRIGGER_H
66 |
--------------------------------------------------------------------------------
/NVScript/NVScript-Defunct.h:
--------------------------------------------------------------------------------
1 | /**************************
2 | * NVSongTrap
3 | * (NVTrap)
4 | *
5 | *
6 | * Messages: TurnOn, TurnOff (Specifiable)
7 | * Parameters: NVVOQVar, NVPoliteVO
8 | * Links: None
9 | */
10 | /*
11 | DECLARE_SCRIPT(cScr_NVSongTrap, cScrNVGeneric)
12 | {
13 | public:
14 | DECLARE_FACTORY(NVSongTrap,NVGenericTrap);
15 | cScr_NVSongTrap(const char* pszName, int iHostObjId)
16 | : cScrNVGeneric(pszName,iHostObjId)
17 | { }
18 |
19 | private:
20 | virtual long OnActivate(sScrMsg* pMsg, sMultiParm* pReply, eScrTraceAction eTrace);
21 | virtual long OnDeactivate(sScrMsg* pMsg, sMultiParm* pReply, eScrTraceAction eTrace);
22 |
23 | protected:
24 | virtual void InitScriptData()
25 | {
26 | cScrNVGeneric::InitScriptData();
27 | }
28 |
29 | };
30 | */
31 |
32 | /**************************
33 | * NVInfinityStair
34 | *
35 | * Infinite stairs
36 | *
37 | *
38 | * Messages: Descend, Ascend
39 | * Parameters: None
40 | * Links: None
41 | */
42 | /*
43 | DECLARE_SCRIPT(cScr_NVInfinityStair,cScriptNV)
44 | {
45 | public:
46 | DECLARE_FACTORY(NVInfinityStair,CustomScript);
47 | cScr_NVInfinityStair(const char* pszName, int iHostObjId)
48 | : cScriptNV(pszName,iHostObjId),
49 | SCRIPT_VAROBJ(m_iLevel)
50 | { }
51 |
52 | private:
53 | DECLARE_MSGHANDLER(OnAscend);
54 | DECLARE_MSGHANDLER(OnDescend);
55 | DECLARE_MSGHANDLER(OnAddToLevel);
56 | DECLARE_MSGHANDLER(OnRemoveFromLevel);
57 | void Process(int iDirection);
58 |
59 | protected:
60 |
61 | virtual void InitScriptData()
62 | {
63 | cScriptNV::InitScriptData();
64 | REGISTER_MSGHANDLER("Ascend", cScr_NVInfinityStair::OnAscend);
65 | REGISTER_MSGHANDLER("Descend", cScr_NVInfinityStair::OnDescend);
66 | REGISTER_MSGHANDLER("AddToLevel", cScr_NVInfinityStair::OnAddToLevel);
67 | REGISTER_MSGHANDLER("RemoveFromLevel", cScr_NVInfinityStair::OnRemoveFromLevel);
68 | }
69 |
70 | script_int m_iLevel;
71 |
72 | virtual void InitVars(void)
73 | {
74 | m_iLevel.Init();
75 | return;
76 | }
77 |
78 |
79 | };
80 |
81 | */
82 | /**************************
83 | * NVInfinityStairCacheRoom
84 | *
85 | * Infinite stairs
86 | *
87 | *
88 | * Messages: Descend, Ascend
89 | * Parameters: None
90 | * Links: None
91 | */
92 | /*
93 | DECLARE_SCRIPT(cScr_NVInfinityStairCacheRoom,cScriptNV)
94 | {
95 | public:
96 | DECLARE_FACTORY(NVInfinityStairCacheRoom,CustomScript);
97 | cScr_NVInfinityStairCacheRoom(const char* pszName, int iHostObjId)
98 | : cScriptNV(pszName,iHostObjId)
99 | { }
100 |
101 | private:
102 | DECLARE_MSGHANDLER(OnIn);
103 | DECLARE_MSGHANDLER(OnOut);
104 |
105 | protected:
106 |
107 | virtual void InitScriptData()
108 | {
109 | cScriptNV::InitScriptData();
110 | REGISTER_MSGHANDLER("PlayerRoomEnter", cScr_NVInfinityStairCacheRoom::OnIn);
111 | REGISTER_MSGHANDLER("ObjectRoomEnter", cScr_NVInfinityStairCacheRoom::OnIn);
112 | REGISTER_MSGHANDLER("PlayerRoomExit", cScr_NVInfinityStairCacheRoom::OnOut);
113 | REGISTER_MSGHANDLER("ObjectRoomExit", cScr_NVInfinityStairCacheRoom::OnOut);
114 | }
115 | };
116 |
117 | */
--------------------------------------------------------------------------------
/NVScript/NVScript-Flames.cpp:
--------------------------------------------------------------------------------
1 | //#if _DARKGAME != 2
2 | //#error NVScript is written for Thief2. You can try, but I doubt it.
3 | //#else
4 |
5 | // #include
6 | #include
7 |
8 | #include "lg/interface.h"
9 | #include "lg/scrservices.h"
10 | #include "lg/scrmanagers.h"
11 | #include "lg/scrmsgs.h"
12 | #include "lg/objects.h"
13 | #include "ScriptLib.h"
14 | #include "NVScriptLib.h"
15 | #include "NVScript-Flames.h"
16 |
17 | #include "lg/iids.h"
18 |
19 |
20 |
21 | /***********************
22 | * NVInflammable
23 | */
24 |
25 | MSGHANDLER cScr_NVInflammable::OnBurn(sScrMsg* pMsg, sMultiParm* pReply, eScrTraceAction eTrace)
26 | {
27 | DisplayPrintf("I was hit with some fire...");
28 | if ( !m_iBurning )
29 | {
30 | DisplayPrintf("Starting to smoulder...");
31 | m_iBurning = 1;
32 |
33 | SService pOS(g_pScriptManager);
34 | object oMeta = ParamGetObject(m_iObjId, "NVFlameMeta", 0);
35 | if ( oMeta )
36 | {
37 | AddSingleMetaProperty(oMeta, m_iObjId);
38 | }
39 |
40 | const char* pszAttach;
41 | int iArc, iJoint;
42 | link lLink, lSPLink;
43 | object oCreated;
44 | char szParam[16];
45 |
46 | SService pLS(g_pScriptManager);
47 | SService pLTS(g_pScriptManager);
48 |
49 | for ( int i = 1; i < 11; i++ )
50 | {
51 | DebugPrintf("Considering whether to attach flame %i...", i);
52 | DisplayPrintf("Considering whether to attach flame %i...", i);
53 | oCreated = 0;
54 | sprintf(szParam, "NVFlame%i", i);
55 | pszAttach = ParamGetString(m_iObjId, szParam, NULL);
56 | if ( !pszAttach )
57 | {
58 | DebugPrintf("No such thing as flame %i", i);
59 | return 0;
60 | }
61 | sprintf(szParam, "NVFlameJoint%i", i);
62 | iJoint = ParamGetInt(m_iObjId, szParam, 0);
63 | iArc = StrToObject(pszAttach);
64 | if ( iArc )
65 | {
66 | DebugPrintf("Attaching flame %i...", i);
67 | DisplayPrintf("Attaching flame %i...", i);
68 | pOS->Create(oCreated, iArc);
69 | if ( oCreated )
70 | {
71 | DebugPrintf("Object successfully created for %i...", i);
72 | lLink = 0;
73 | pLS->Create(lLink, pLTS->LinkKindNamed("~ParticleAttachement"), m_iObjId, oCreated);
74 | if (lLink)
75 | {
76 | DebugPrintf("Link created for %i.", i);
77 | if ( iJoint )
78 | {
79 | DebugPrintf("Joint setup for %i.", i);
80 | pLTS->LinkSetData(lLink, "Type", 2);
81 | pLTS->LinkSetData(lLink, "Joint", iJoint);
82 | }
83 | pLS->Create(lSPLink, pLTS->LinkKindNamed("ScriptParams"), m_iObjId, oCreated);
84 | if ( lSPLink )
85 | {
86 | DebugPrintf("SP Link created for %i.", i);
87 | pLTS->LinkSetData(lSPLink, NULL, "NVFlameObject");
88 | }
89 | }
90 | }
91 | }
92 | }
93 | }
94 | return 0;
95 | }
96 |
97 | MSGHANDLER cScr_NVInflammable::OnDouse(sScrMsg* pMsg, sMultiParm* pReply, eScrTraceAction eTrace)
98 | {
99 | IterateLinksByData("ScriptParams", m_iObjId, 0, "NVFlameObject", -1, DestroyAttachedIterFunc, NULL, NULL);
100 | m_iBurning = 0;
101 | object oMeta = ParamGetObject(m_iObjId, "NVFlameMeta", 0);
102 | if ( oMeta )
103 | {
104 | RemoveSingleMetaProperty(oMeta, m_iObjId);
105 | }
106 | return 0;
107 | }
108 |
109 | int cScr_NVInflammable::DestroyAttachedIterFunc(ILinkSrv* pLS, ILinkQuery* pLQ, IScript* pScript, void* pData)
110 | {
111 | sLink sl;
112 | pLQ->Link(&sl);
113 |
114 | SInterface pOS(g_pScriptManager);
115 | pOS->Destroy(sl.dest);
116 | return 1;
117 | }
118 |
119 | //#endif // _DARKGAME == 2
120 |
--------------------------------------------------------------------------------
/NVScript/NVScript-Flames.h:
--------------------------------------------------------------------------------
1 | /****************************************
2 | * Scripts by Nameless Voice
3 | *
4 | *
5 | * For use with The Circle of Flames
6 | */
7 |
8 | #ifndef NVSCRIPTFLAMES_H
9 | #define NVSCRIPTFLAMES_H
10 |
11 | #if _MSC_VER > 1000
12 | #pragma once
13 | #endif
14 |
15 | #include "lg/scrservices.h"
16 | #include "lg/properties.h"
17 |
18 | #include "scriptvars.h"
19 | #include "ScriptNV.h"
20 |
21 | /**************************
22 | * NVInflammable
23 | *
24 | * This script allows things to be set on fire.
25 | *
26 | * Messages: FlameStimStimulus
27 | * Parameters: None
28 | * Links: Firer
29 | */
30 | DECLARE_SCRIPT(cScr_NVInflammable,cScriptNV)
31 | {
32 | public:
33 | DECLARE_FACTORY(NVInflammable,CustomScript);
34 | cScr_NVInflammable(const char* pszName, int iHostObjId)
35 | : cScriptNV(pszName,iHostObjId),
36 | SCRIPT_VAROBJ(m_iBurning)
37 | { }
38 |
39 | private:
40 | DECLARE_MSGHANDLER(OnBurn);
41 | DECLARE_MSGHANDLER(OnDouse);
42 | static int DestroyAttachedIterFunc(ILinkSrv* pLS, ILinkQuery* pLQ, IScript* pScript, void* pData);
43 | script_int m_iBurning;
44 |
45 | protected:
46 | virtual void InitScriptData()
47 | {
48 | cScriptNV::InitScriptData();
49 | REGISTER_MSGHANDLER("FireStimStimulus", cScr_NVInflammable::OnBurn);
50 | REGISTER_MSGHANDLER("FlameStimStimulus", cScr_NVInflammable::OnBurn);
51 | REGISTER_MSGHANDLER("WaterStimStimulus", cScr_NVInflammable::OnDouse);
52 | }
53 |
54 | virtual void InitVars(void)
55 | {
56 | m_iBurning.Init();
57 | return;
58 | }
59 | }
60 | END_DECLARE_SCRIPT(cScr_NVInflammable);
61 |
62 |
63 | #endif
64 |
--------------------------------------------------------------------------------
/NVScript/NVScript.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NamelessVoice/NVScript/72866513b1f42a91e1620aa50c9e6bcd7ff68b90/NVScript/NVScript.cpp
--------------------------------------------------------------------------------
/NVScript/NVScript.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NamelessVoice/NVScript/72866513b1f42a91e1620aa50c9e6bcd7ff68b90/NVScript/NVScript.h
--------------------------------------------------------------------------------
/NVScript/NVScript.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NamelessVoice/NVScript/72866513b1f42a91e1620aa50c9e6bcd7ff68b90/NVScript/NVScript.html
--------------------------------------------------------------------------------
/NVScript/NVScript.rc:
--------------------------------------------------------------------------------
1 | // This is the version resource file for the makefile build.
2 | // Not really used any more, versions are just pulled from buildconfig.h
3 | //
4 | #define MODULE_NVSCRIPT
5 | #include "../buildconfig.h"
6 | #undef MODULE_NVSCRIPT
7 |
8 | #include "version.rc"
9 |
10 |
--------------------------------------------------------------------------------
/NVScript/NVScriptLib.h:
--------------------------------------------------------------------------------
1 | /************************************************
2 | * General-purpose Utilities for script modules
3 | */
4 |
5 | #ifndef NVSCRIPTLIB_H
6 | #define NVSCRIPTLIB_H
7 |
8 | #if _MSC_VER > 1000
9 | #pragma once
10 | #endif
11 |
12 | #include
13 |
14 | #if (_DARKGAME == 3)
15 | #define QVARPROP "QBName"
16 | #else
17 | #define QVARPROP "TrapQVar"
18 | #endif
19 |
20 |
21 | /*************
22 | * Objects
23 | */
24 |
25 | // Convert a string to an object reference. Understands [Me], [Source], and ^ (closest)
26 | int NVStrToObject(const char* pszName, sScrMsg* pMsg);
27 | int NVStrToObject(const char* pszName, int iSource, int iMe);
28 |
29 | std::vector GetObjects(const char* pszDest, int iObj, sScrMsg* pMsg);
30 |
31 | // Get the distance between two points, using the Theorem of Pythagoras.
32 | float GetDistance(const mxs_vector* vSource, const mxs_vector* vDest);
33 | // Get the distance between two points on the X and Y axes only. The Z axis is ignored, using the Theorem of Pythagoras.
34 | float GetDistanceXY(const mxs_vector* vSource, const mxs_vector* vDest);
35 |
36 | // Returns the first object contained by iContainer that inherits from iType.
37 | int GetSinglePossession(int iContainer, int iType);
38 |
39 | // Gets a random ScriptParams link, treating data as a 'weight'.
40 | long GetAnyWeightedLink(int iSource, int iDest, sLink* pResult);
41 |
42 | int ParamGetNVObject(int iObject, const char* pszParam, int iDefault = 0);
43 |
44 | int NVParamGetInt(int iObject, const char* pszScriptName, const char* pszParam, int iDefault);
45 | void NVParamSetInt(int iObject, const char* pszScriptName, const char* pszParam, int iValue);
46 | float NVParamGetFloat(int iObject, const char* pszScriptName, const char* pszParam, float fDefault);
47 | const char* NVParamGetString(int iObject, const char* pszScriptName, const char* pszParam, const char* sDefault);
48 | int NVParamGetNVObject(int iObject, const char* pszScriptName, const char* pszParam, int iDefault);
49 |
50 | // Get the descriptive name (either its name, or the name of its archetype) of an object
51 | cScrStr GetObjectDescriptiveName(int objId);
52 |
53 | void ErrorPrintf(const char* pszMessage, const char* pszFormat, ...);
54 |
55 | bool GetQVarInfo(int iQVarObjId, char* cOperand, int* iValue, char** pszQVar, int* iValueLength);
56 | bool GetQVarInfo(char* pszQVarString, char* cOperand, int* iValue, char** pszQVar, int* iValueLength);
57 |
58 | #endif // NVSCRIPTLIB_H
59 |
--------------------------------------------------------------------------------
/NVScript/ParamCache.h:
--------------------------------------------------------------------------------
1 | #ifndef PARAMCACHE_H
2 | #define PARAMCACHE_H
3 |
4 | #if _MSC_VER > 1000
5 | #pragma once
6 | #endif
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 |
14 | #include