New @protected and/or @library directive #2645
ugib
started this conversation in
Suggestions
Replies: 2 comments 2 replies
-
I don't see the point of this as a directive, maybe can just have a client cvar to not allow replacing E2 chips with different names. |
Beta Was this translation helpful? Give feedback.
2 replies
-
@ugib Not sure about overwriting another e2, but this will prevent you from spawning one: @model models/bull/gates/microcontroller1.mdl
if(entity():model() == "models/bull/gates/microcontroller1.mdl"){
selfDestruct()
error("This is a library; #include it in something.")
} I use it in my libraries to notify the user the chip isn't meant to be spawned by itself. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you happen to work with a lot of different E2 chips on the same contraption, it might happen that you accidentally override the wrong E2 chip, which means you have to rewire all inputs and outputs. This is especially annoying when working with libraries, i.e. E2s that only contain functions.
Thus, I suggest either (or both) directives:
@protected
: Makes it so this E2 can only be overridden/updated with E2s of the same name.@library
: Makes it so the E2 cannot be spawned or be used to overwrite another E2.Of course, the directive names are merely suggestions. Maybe other terms are more appropriate.
Beta Was this translation helpful? Give feedback.
All reactions