Skip to content
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

Command line parameter to support dot slashes in VScript file read calls #274

Conversation

Blixibon
Copy link
Member

@Blixibon Blixibon commented Jan 5, 2024

This PR adds a command line parameter (-script_dotslash_read) to allow dot slashes in VScript file read functions, namely FileToString, FileExists, and KeyValuesRead. This would allow any file outside of the vscript_io directory to be read using VScript.

Individual users can specify this in their command line parameters to allow it, but this can also be enabled by individual mods by using the CommandLine section in gameinfo.txt:

"GameInfo"
{
    game         "Mapbase - HL2 Episodic"
    title         "HALF-LIFE'"
    title2        ""

    type        singleplayer_only
    supportsvr    0

    GameData    "bin/halflife2.fgd"

+    CommandLine
+    {
+        -script_dotslash_read "1"
+    }
    ...

This feature was requested for the specific use case of being able to read save files in an adjacent sourcemod using VScript. An equivalent parameter for writing to files will not be added at this time.


PR Checklist

  • My PR follows all guidelines in the CONTRIBUTING.md file
  • My PR targets a develop branch OR targets another branch with a specific goal in mind

Copy link

@1upD 1upD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - especially with the consideration that it is read only

@Blixibon Blixibon merged commit 11533fa into mapbase-source:develop Feb 4, 2024
4 checks passed
@Blixibon Blixibon deleted the mapbase/feature/dot-slash-command-line-param branch February 4, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants