eyza-cod2 / vscode-cod-gsc

Extension for VS Code for GSC scripts used in Call of Duty games
GNU General Public License v3.0
15 stars 0 forks source link

add conditional operators support please #4

Open Xeirh opened 4 months ago

Xeirh commented 4 months ago

pretty cool, always cool to check out other extensions.

she doesn't like conditional operators, would love to see it not flag as an error in the future and keep up the good work.

Screenshot 2024-07-24 013851

Obama loves you

eyza-cod2 commented 4 months ago

What game it is?

I did not found conditional (ternary) operator in any of the source files yet.

Xeirh commented 4 months ago

currently cod4 mwr but this is any and all titles can use and compile with these conditions. you for sure won't find any of them conditions being used in the source, would also like to see foreach supported Screenshot 2024-07-24 152917

and not sure what this is called but param = value blah blah Screenshot 2024-07-24 153155

these the most common used on client auto compilers and injectors.

if you can make it so these don't flag as syntax, you my sir would have a perfect extension.

best feature! Screenshot 2024-07-24 154703

eyza-cod2 commented 3 months ago

Are you sure its for CoD4?

Dont you mean newer games like BO2 or the Plutonium project? For example BO2 has foreach and parameter default values.

k4r3l01 commented 3 months ago

what i know cod4 mwr dont have dedicated servers and not support for mods

k4r3l01 commented 3 months ago

and about conditional operators i checked cod4 and black ops 3 and this not working in any of this games

Xeirh commented 3 months ago

what i know cod4 mwr dont have dedicated servers and not support for mods

we have a client called auroramod h1-mod

Xeirh commented 3 months ago

Are you sure its for CoD4?

Dont you mean newer games like BO2 or the Plutonium project? For example BO2 has foreach and parameter default values.

well thinking about it, it's kinda new-ish, released in 2016. Just asking if these can be added into the syntax parser so they don't show as syntax anymore if that makes sense. It's not a huge issue because I can still just ctrl+s and run it without an issue. Just not huge fan of all my files being red and marked with syntax. Screenshot 2024-07-31 110408

Xeirh commented 3 months ago

and about conditional operators i checked cod4 and black ops 3 and this not working in any of this games not sure boss because these work in all the titles, never had issues with them, compiles fine, just annoying that the parser doesnt like them. Screenshot 2024-07-31 111324 Screenshot 2024-07-31 111350

k4r3l01 commented 3 months ago

i dont find anywhere mwr server i tried this on old cod4 with cod4x

eyza-cod2 commented 3 months ago

I did some research what games support GSC coding and this is what i found (if you can you cold correct this table)

Game Code Moding Special things Code example
CoD1 IW1 Yes no dev block /##/ do {} while ()
CoD2 IW2 Yes
CoD3 T1 ?
CoD4 IW3 Yes
CoD5 T4 Plutonium T4
CoD6:MW2 IW4 X Labs (shut down) Alterware IW4X root variable foreach childthread call https://github.com/FreeTheTech101/IW4-Dump-Files/tree/master https://github.com/DoktorSAS/GSC/tree/main/IW4/http
CoD7:BO1 T5 Plutonium T5 foreach #"cvar" https://github.com/DoktorSAS/GSC/tree/main/T5
CoD8:MW3 IW5 Plutonium-IW5 foreach https://github.com/DoktorSAS/GSC/tree/main/IW5
CoD9:BO2 T6 Plutonium-T6 foreach https://github.com/DoktorSAS/GSC/tree/main/T6
Ghosts IW6 X Labs (shut down) foreach https://github.com/DoktorSAS/GSC/blob/main/IW6/autobots.gsc
AW S1? X Labs (shut down) Alterware S1-mod foreach https://github.com/DoktorSAS/GSC/blob/main/S1/autobots.gsc
BO3 T7 #using #namespace function .gscc .csc .cscc Modtools on steam https://github.com/DoktorSAS/GSC/blob/main/T7/zm/zombiesCounter_raw.gsc
IW IW7 Aurora mod (IW7-Mod)
CoD4:MWR H1 Aurora mod (H1 mod) foreach param value ternary operator https://docs.auroramod.dev/gsc-scripting-syntax
WWII S2?
BO4 T8
eyza-cod2 commented 3 months ago

I will implement the foreach and conditional (ternary) operators in future version.

eyza-cod2 commented 1 month ago

Added a support for foreach, ternary

Will continue with default parameter value