ant7735 Posted March 3, 2024 Share Posted March 3, 2024 Looking through consolescreen.lua, you can find things like: self.console_edit:EnableWordPrediction({width = 1000, mode=Profile:GetConsoleAutocompleteMode()}) self.console_edit:AddWordPredictionDictionary({words = prefab_names, delim = '"', postfix='"', skip_pre_delim_check=true}) self.console_edit:AddWordPredictionDictionary({words = prefab_names, delim = "'", postfix="'", skip_pre_delim_check=true}) In modmain, how would I be able to create a custom console command, and then add it to the Dictionary ? Link to comment https://forums.kleientertainment.com/forums/topic/154618-custom-console-command-with-autocomplete/ Share on other sites More sharing options...
_zwb Posted March 4, 2024 Share Posted March 4, 2024 13 hours ago, ant7735 said: In modmain, how would I be able to create a custom console command, and then add it to the Dictionary ? You just need to define a global function starting with "c_", it will be imported automatically. You can set your environment to global by calling GLOBAL.setfenv(1, GLOBAL) at the start of modmain. Link to comment https://forums.kleientertainment.com/forums/topic/154618-custom-console-command-with-autocomplete/#findComment-1702015 Share on other sites More sharing options...
ant7735 Posted March 14, 2024 Author Share Posted March 14, 2024 Does it have to start with "c_" ? Link to comment https://forums.kleientertainment.com/forums/topic/154618-custom-console-command-with-autocomplete/#findComment-1704606 Share on other sites More sharing options...
The Starver Posted March 14, 2024 Share Posted March 14, 2024 31 minutes ago, ant7735 said: Does it have to start with "c_" ? I think so, since "c_" (If I'm right) means a call to "console" (or something like that). Link to comment https://forums.kleientertainment.com/forums/topic/154618-custom-console-command-with-autocomplete/#findComment-1704625 Share on other sites More sharing options...
ant7735 Posted March 14, 2024 Author Share Posted March 14, 2024 48 minutes ago, The Starver said: I think so, since "c_" (If I'm right) means a call to "console" (or something like that). Thanks Link to comment https://forums.kleientertainment.com/forums/topic/154618-custom-console-command-with-autocomplete/#findComment-1704635 Share on other sites More sharing options...
The Starver Posted March 14, 2024 Share Posted March 14, 2024 (edited) 47 minutes ago, ant7735 said: Thanks I'm not entirely sure, since I'm not a developer or an expert modder. Definitely get a second opinion to check first. Edited March 14, 2024 by The Starver Link to comment https://forums.kleientertainment.com/forums/topic/154618-custom-console-command-with-autocomplete/#findComment-1704641 Share on other sites More sharing options...
ant7735 Posted March 14, 2024 Author Share Posted March 14, 2024 1 hour ago, The Starver said: I'm not entirely sure, since I'm not a developer or an expert modder. Definitely get a second opinion to check first. Yep, after a bit of messing around the only other thing that 'cloud' work, is d_, It seems d_ and c_ are the only scanned prefixes inside of the consolecommandscreen.lua. 1 Link to comment https://forums.kleientertainment.com/forums/topic/154618-custom-console-command-with-autocomplete/#findComment-1704674 Share on other sites More sharing options...
_zwb Posted March 15, 2024 Share Posted March 15, 2024 15 hours ago, ant7735 said: Does it have to start with "c_" ? Yes Link to comment https://forums.kleientertainment.com/forums/topic/154618-custom-console-command-with-autocomplete/#findComment-1704851 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now