Skip to content

Commit 4895397

Browse files
committed
Added setup for version control and finished alias system ready for first pre-release
Signed-off-by: NarcoMarshDev <[email protected]>
1 parent c893613 commit 4895397

File tree

8 files changed

+450
-125
lines changed

8 files changed

+450
-125
lines changed

resourceDatabase.rdb

0 Bytes
Binary file not shown.

scripts/Game/!ESE_CORE.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
#define ESE_INSTALLED // Always keep this enabled to ensure mod compatiblity with aliases
1+
#define ESE_INSTALLED // Always keep this enabled to ensure mod compatiblity with additional aliases
2+
3+
bool ESE_IS_INITIALIZED = ESE.Init();
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// -----------------------------------------------------------------------------------------------------------
2+
// Enforce Script Extensions - By NarcoMarshmallow
3+
//
4+
// Message me @narcoleptic marshmallow #1188 on discord to give feedback or go to https://github.com/NarcoMarshDev
5+
// -----------------------------------------------------------------------------------------------------------
6+
7+
// This is a custom config for developing ese internally, it can all be ignored
8+
9+
//#define ESE_DEVMODE // remember to comment off before releases
10+
11+
#ifdef ESE_DEVMODE
12+
13+
//#define ESE_VERBOSE
14+
//#define ESE_ENABLE_WIP
15+
//#define ESE_EXPERIMENTAL
16+
//#define ESE_OBSOLETE
17+
#define ESE_ALIASES_ALL
18+
//#define ESE_ALIASES_MATERIALS
19+
//#define ESE_ALIASES_WEAPONS
20+
//#define ESE_ALIASES_ATTACHMENTS
21+
//#define ESE_ALIASES_MAGAZINES
22+
//#define ESE_ALIASES_EQUIPMENT
23+
//#define ESE_ALIASES_VEHICLES
24+
//#define ESE_ALIASES_MATH
25+
#define ESE_ALIASES_DEBUG
26+
27+
#endif
28+
29+
// -------------------- DO NOT MODIFY BEYOND THIS POINT --------------------
30+
31+
// Pre-processor enable all other alias defines if ESE_ALIASES_ALL is defined
32+
#ifdef ESE_ALIASES_ALL
33+
#define ESE_ALIASES_MATERIALS
34+
#define ESE_ALIASES_WEAPONS
35+
#define ESE_ALIASES_ATTACHMENTS
36+
#define ESE_ALIASES_MAGAZINES
37+
#define ESE_ALIASES_EQUIPMENT
38+
#define ESE_ALIASES_VEHICLES
39+
#define ESE_ALIASES_MATH
40+
#endif

scripts/Game/ESE.c

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,56 @@
66

77

88
// Different functionality of ESE can be enabled or disabled by defining some different values, go to ESE_Config.c to see how
9+
/**
10+
ESE Class
911
12+
Class containing generic static methods and constants
13+
14+
For full documentation check the wiki @ https://github.com/NarcoMarshDev/Enforce-Script-Extensions/wiki/ESE-Class
15+
16+
Code example:
17+
@code
18+
TODO
19+
@endcode
20+
*/
1021
class ESE
11-
{
22+
{
23+
static const int VERSION_MAJOR = 0;
24+
static const int VERSION_MINOR = 1;
25+
static const int VERSION_PATCH = 1;
26+
// initialize ese on startup, called in !ESE_CORE.c
27+
static bool Init()
28+
{
29+
if (ESE_IS_INITIALIZED)
30+
{
31+
Print("ESE.Init() already called", LogLevel.WARNING);
32+
return true;
33+
}
34+
35+
// print version info on init
36+
Print("Loaded ESE v" + VERSION_MAJOR + "." + VERSION_MINOR + "." + VERSION_PATCH);
37+
if (VERSION_MAJOR == 0)
38+
{
39+
Print("WARNING: This is a pre-release version of Enforce Script Extensions, future compatibility is not guaranteed!", LogLevel.WARNING);
40+
}
41+
42+
// get all addons and find the first one (the currently open project)
43+
array<string> availableAddons = {};
44+
GameProject.GetAvailableAddons(availableAddons);
45+
string mainProjectName = GameProject.GetAddonTitle(availableAddons[0]);
46+
if (mainProjectName == "Enforce Script Extensions")
47+
{
48+
#ifdef ESE_DEVMODE
49+
Print("ESE is in development mode, remember to goto !ESE_Config_EnforceScriptExtensions.c and disable before release");
50+
#endif
51+
#ifndef ESE_DEVMODE
52+
Print("ESE is not in development mode, goto !ESE_Config_EnforceScriptExtensions.c and enable it to enable all features");
53+
#endif
54+
}
55+
56+
return true;
57+
}
58+
1259
// Base class for all ESE static methods, if we ever get modding support for core types many of these will get added to their respective classes as well
1360

1461
// ================================ Entities ================================
@@ -61,13 +108,6 @@ class ESE
61108
}
62109
return allChildren;
63110
}
64-
// -----------------------------------------------------------------------------------------------------------
65-
// Deletes entity on server side
66-
static void DeleteEntity(IEntity ent)
67-
{
68-
RplComponent.DeleteRplEntity(ent, false);
69-
}
70-
71111

72112
// ================================ Player ================================
73113

scripts/Game/ESE_Aliases.c

Lines changed: 344 additions & 103 deletions
Large diffs are not rendered by default.
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
// Enforce Script Extensions - By NarcoMarshmallow
33
//
44
// Message me @narcoleptic marshmallow #1188 on discord to give feedback or go to https://github.com/NarcoMarshDev
5-
// -----------------------------------------------------------------------------------------------------------
6-
7-
// REMEMBER TO CHANGE THIS TO USING THE DEFINES IN THE PROJECT OPTIONS MENU OR PEOPLE WILL RIOT!!!
8-
95
/** -------------------------------------------------------- READ THIS --------------------------------------------------------
106
117
Different functionality of ESE can be enabled or disabled by defining some different values. To do so, duplicate this file
128
and name it ' !ESE_Config.c ' and then uncomment whatever #define statements you want, to enable those features.
139
10+
Full documentation : https://github.com/NarcoMarshDev/Enforce-Script-Extensions/wiki/Setting-Up-ESE#making-your-ese-config
11+
1412
-------------------------------------------------------- READ THIS --------------------------------------------------------
1513
1614
@code
@@ -37,27 +35,35 @@
3735
#define ESE_ALIASES_VEHICLES - All base game vehicle ResourceNames (almost, missing some odd variats)
3836
#define ESE_ALIASES_MATH - Useful mathematical constants and such like
3937
38+
#define ESE_ALIASES_DEBUG
39+
- Enables some extra debugging features to help with implementing custom aliases.
40+
4041
@endcode
4142
*/
4243

4344
//#define ESE_VERBOSE
4445
//#define ESE_ENABLE_WIP
4546
//#define ESE_EXPERIMENTAL
4647
//#define ESE_OBSOLETE
47-
#define ESE_ALIASES_ALL
48+
//#define ESE_ALIASES_ALL
4849
//#define ESE_ALIASES_MATERIALS
4950
//#define ESE_ALIASES_WEAPONS
5051
//#define ESE_ALIASES_ATTACHMENTS
5152
//#define ESE_ALIASES_MAGAZINES
53+
//#define ESE_ALIASES_EQUIPMENT
5254
//#define ESE_ALIASES_VEHICLES
5355
//#define ESE_ALIASES_MATH
56+
//#define ESE_ALIASES_DEBUG
57+
58+
// -------------------- DO NOT MODIFY BEYOND THIS POINT --------------------
5459

55-
// Pre-processor enable all other alias defs if ESE_ALIASES_ALL is defined
60+
// Pre-processor enable all other alias defines if ESE_ALIASES_ALL is defined
5661
#ifdef ESE_ALIASES_ALL
5762
#define ESE_ALIASES_MATERIALS
5863
#define ESE_ALIASES_WEAPONS
5964
#define ESE_ALIASES_ATTACHMENTS
6065
#define ESE_ALIASES_MAGAZINES
66+
#define ESE_ALIASES_EQUIPMENT
6167
#define ESE_ALIASES_VEHICLES
6268
#define ESE_ALIASES_MATH
6369
#endif

scripts/Game/ESE_Types.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
// Message me @narcoleptic marshmallow #1188 on discord to give feedback or go to https://github.com/NarcoMarshDev
55
// -----------------------------------------------------------------------------------------------------------
66

7+
#ifdef ESE_EXPERIMENTAL
78
class HierarchyMap<Class T>
89
{
910

1011
}
11-
12+
#endif

scripts/Game/Testing/ESE_TestingEntity.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@ class ESE_TestingEntity : SCR_BaseTriggerEntity
66
{
77
protected override void EOnInit(IEntity owner)
88
{
9-
ESE_Aliases.DebugRegister();
10-
ESE_Aliases.RemoveAliasFromRegister(ESE_Aliases.TEST_WEP_M18_RED);
11-
ESE_Aliases.DebugRegister();
9+
1210
}
1311

1412
protected override void EOnFrame(IEntity owner, float timeSlice)
1513
{
1614

17-
ResourceName test = ESE_Aliases.WEP_M21;
18-
//bool onScreen = ESE.IsEntityOnScreen(owner);
19-
//Print("onScreen: " + onScreen);
2015
}
2116
}

0 commit comments

Comments
 (0)