UGX-Mods

Call of Duty 5: World at War => Applications & Tools => Custom Maps, Mods & Tools => 3rd-Party Applications & Tools => Topic started by: DeletedUser on June 24, 2015, 04:52:59 pm

Title: CoDScript Sublime Text Syntax and auto-completion
Post by: DeletedUser on June 24, 2015, 04:52:59 pm
www.mediafire.com
Spent few hours to make a CoDScript Sublime Text Syntax, which is an updated version of the one that is on the internet (forgot who originally made it). Function list thanks to DUKIP
It also includes some useful auto-completions, like infinite loop and NewHudElem with text. Need ideas for more of them, please suggest them in topic.
(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fgyazo.com%2Fd42c19e5cbbf168f02549fa3a04ad09d.gif&hash=e3ee32dea4e96c7fae256de5bfe8d98ca8ca6351)
Install:
Open packages directory
(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F4wevGmn.png&hash=49395f0dcfb49717f80d04a3120360ac40009416)
Copy the archive contents there
(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F2azce2g.png&hash=b5bc6210998cc9992ec991b4b198a385b23c1a40)
It will appear as CoDScript2 in Syntax menu
Known issues:
- Currently it contains mostly SP functions but I doubt anyone scripts for MP anymore
Title: Re: CoDScript Sublime Text Syntax and auto-completion
Post by: MakeCents on June 24, 2015, 05:23:49 pm
Dude, so awesome. Been wanting this and haven't had time to look into it.

Quick question, I usually use ctrl+/ to comment things out, using c++ syntax in sublime, but when switching to codscript syntax, it no worky anymore. Any advise? Its why I stopped using the old version actually.


Edit: Also, would you know how to add a for loop auto complete? Where it then multi cursor selects the var, say players?
Nvmind mind on this one, used your stuff and made it myself. Thanks again! You wouldn't know how to add a hint or default text would you?
Editing the CoDScript2.sublime-completions
Added this after FlagEnemyUnattackable line
Code Snippet
Plaintext
{ "trigger": "for(", "contents": "for(${1})" },
and added this after "newHUDElem\tText with a comma at the end of the previous line of course.
Code Snippet
Plaintext
{ "trigger": "for\tText: Global", "contents": "for(i=0;i<${1}.size;i++){\n\t${1}[i] thread ${2};\n}" }

Adding all kinds, this is fun.
Spoiler: click to open...
{ "trigger": "for", "contents": "for(${1})" },
{ "trigger": "players", "contents": "players = get_players()" },
{ "trigger": "flag_wait", "contents": "flag_wait()" },


{ "trigger": "for\tfor loop", "contents": "for(${2}=0;${2}<${1}.size;${2}++){\n\t${1}[${2}] thread ${3}();\n}" },
{ "trigger": "flag_wait\t all players connected", "contents": "flag_wait(\"all_players_connected\");\n" },
{ "trigger": "flag_wait\t electricity on", "contents": "flag_wait(\"electricity_on\");\n" },
{ "trigger": "players\tplayers", "contents": "players = get_players();\nfor(i=0;i<players.size;i++){\n\tplayers thread ${1}();\n}\n" },
{ "trigger": "players\tplayers with flag", "contents": "flag_wait(\"all_players_connected\");\nplayers = get_players();\nfor(i=0;i<players.size;i++){\n\tplayers thread ${1}();\n}" }

Title: Re: CoDScript Sublime Text Syntax and auto-completion
Post by: DeletedUser on June 24, 2015, 06:05:39 pm
Quick question, I usually use ctrl+/ to comment things out, using c++ syntax in sublime, but when switching to codscript syntax, it no worky anymore. Any advise? Its why I stopped using the old version actually.
Will look into this, will release a fix when I find out.
Title: Re: CoDScript Sublime Text Syntax and auto-completion
Post by: MakeCents on June 24, 2015, 06:10:12 pm
Will look into this, will release a fix when I find out.

cool, I copied the whole C.tmLanguage over to the Codscript one and it worked, so I know its in there, lol. I didn't leave it that way of course cause it breaks the auto complete and who knows what else.
Title: Re: CoDScript Sublime Text Syntax and auto-completion
Post by: MakeCents on June 26, 2015, 01:47:16 am
Will look into this, will release a fix when I find out.
I got it to work for commenting, and I made a gsc and a csc separate auto complete with full common function lists. Here is the file to add to your packages to get commenting to work. The auto complete I am still working on when I get time. PM me if interested.
http://www.mediafire.com/download/loqo6bri1byv9vb/Comments_(CodScript).rar (http://www.mediafire.com/download/loqo6bri1byv9vb/Comments_(CodScript).rar)


Answer found here:
http://stackoverflow.com/questions/26701960/how-do-i-get-comment-toggle-to-work-with-my-own-tmlanguage-syntax-for-sublime-te (http://stackoverflow.com/questions/26701960/how-do-i-get-comment-toggle-to-work-with-my-own-tmlanguage-syntax-for-sublime-te)