-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable additional built-in commands for single player only #280
base: master
Are you sure you want to change the base?
Conversation
Probably cleaner to inject wherever |
Why? It's definitely possible I'm missing something, but to my understanding it's far, far cleaner to set the I also kept this function flexible, in case in the future there are other values that should be checked, set, verified, clamped, etc. before MP is loaded.
Each definitely has use cases for single player map/mod developers in testing for their projects. The usefulness of Moreover... why not? While I would be opposed to adding launcher tickboxes or UI buttons for commands like this, providing safe, single player-only access to commands like this via console has literally no downside, and is relatively standard/expected for similar games. Very few FPS games, especially from RF's time period (at least those that have a developer console), do not allow access to a noclip command for example. |
Imo it is just hacky to have to override values before MP is loaded.
If |
IMO it's far more hacky to inject into the place the value is checked as opposed to setting the value that is to be checked via the game's standard mechanism.
Unless I'm misunderstanding, the suggestion here seems to be that features that would be useful to mod developers (and tbh just SP players) should be kept obscured from them on the basis that other people simply being aware of the existence of those commands might be incentivized to create debug builds (which they already can do) and then use them in multiplayer to cheat in extremely obvious ways? Not only does that seem exceedingly unlikely to me, and a huge stretch, but I would argue that if that were a concern, the current state is actually worse - currently anyone who does want to use these functions in SP only must use a debug build to do so, which has no protections against them then using them in multiplayer. I don't view this as a fair or relevant concern in any event, but even if it were, the existence of these functions is already quite clear to anyone with the desire and means to exploit them in multiplayer. Current state: Few people know the functions exist, so few are able to derive legitimate/honest value from them. Everyone with access to the functionality is extremely well equipped to use them to cheat in MP if they so choose. The premise that useful functionality should be kept from those who would derive value from it because other people might want to use it to cheat (through a method already available to them today) is fundamentally flawed, in my view. |
This PR adds support for the additional built-in RF console commands listed below in release builds, while restricting their use to single player only for obvious reasons.
Command list:
drop_clutter
drop_entity
drop_item
teleport
pcollide
For the first 4 listed commands, it's sufficient to simply disable access to the command in multiplayer (since they are relevant only for the level/instance in which they are entered). For
pcollide
, I've also added a step when initializing multiplayer to force it on if it's currently off, following the same method already used for thedebug
rendering subcommands.Two additional very minor changes also included in this PR are:
entity_lookup_type
method toentity.h
: Added this because I initially supportedbody
in single player as well, but decided against because it's of very little use to players but its behaviour can be confusing. Thought there was no harm in keeping method inentity.h
anyway though for later utility.difficulty
command from debug build register commands list: Unnecessary because it's already registered in all builds.