OverwatchCode – My Custom ScriptLanguage for the Overwatch workshop

Overwatch9 - OverwatchCode - My Custom ScriptLanguage for the Overwatch workshop

On the PTR we already have the option to copy and past code. But I don't like the style of that code. So I wrote my own little language + parser.


– write code in c-style

– custom var names

– if-, for-, while-statements (not yet included in the live version)

How does the code look like?

onglobal test(a == b && c < d && IsGameInProgress) { $a = a%b * c + CountOf(s.f); BigMessage(AllPlayers(Team2), String("Hallo", null, null, null)); } 

every rule is defined by the event:

  • onglobal = Ongoing – global
  • onplayer = Ongoing – player
  • plelimination = Player earned Elimination

Then the name of a rule, followed by the conditions and finally a block of actions

I wrote the parser with javacc and this was my first project using javacc. I don't know if I have configured everything right but right now it looks like everything is working fine.
Right now if you want to assign a value you have to add a $ at the start of the statement. If you dont add it the parser cannot decide if the statement is an assignment or a function call. I will fix this as soon as I've found a solution. Maybe there is someone out there who has used javacc before and encountered a simillar problem.

all keywords given by the oberwatch workshop (e.g. rules, Ongoing – global, EventPlayer, Count Of (), …) can be defined in the lib.json. here you can set how the parser should interpret your code:

e.g. you don't like onglobal, so you can change it to something like "og"

you can also set how the parser should work with your custom variable names:
my default settigs are looking for variables that are not single letters and then math them on empty variable fields. The algorithm I wrote needs more improvement so I suggest you just use a variable mapping:

, "D": , "Z":  } }, { "scope": "player", "nameConnections": { "B": , "X": , "A":  } } > 

with this system you can rename variables

The workshop keywords in the code structure (rules, conditions, event, actions) are language specific. This means that if you are playing overwatch in german you will have other keywords then if you are playing overwatch in english. To fix this I have added a language section in the lib.json where you can add your language specific keywords.

I have already added the keywords for german and english, but if you want to I can add them for other languages too.

So have fun using this language and tell me if you find any bugs or if you would like to see any features.

Features I will include soon:

  • if, for, while
  • structs
  • automatic string creation

Link to my Project:
Overwatch Code - OverwatchCode - My Custom ScriptLanguage for the Overwatch workshop


ps: dont worry if the parser tells you that the functions you are using are unknown. there are a lot of functions and variables and I have included only a few of them. I will try to add them all. Just convert your script and import it to overwatch, the workshop will tell you if you have a typo somewhere in your code.

Source: Original link

© Post "OverwatchCode – My Custom ScriptLanguage for the Overwatch workshop" for game Overwatch.

Top 10 Most Anticipated Video Games of 2020

2020 will have something to satisfy classic and modern gamers alike. To be eligible for the list, the game must be confirmed for 2020, or there should be good reason to expect its release in that year. Therefore, upcoming games with a mere announcement and no discernible release date will not be included.

Top 15 NEW Games of 2020 [FIRST HALF]

2020 has a ton to look forward to...in the video gaming world. Here are fifteen games we're looking forward to in the first half of 2020.

You Might Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *