Skip to content

Releases: ItsDeltin/Overwatch-Script-To-Workshop

v2.0-beta.5

07 Jan 08:20

Choose a tag to compare

v2.0-beta.5 Pre-release
Pre-release
  • i18n: Updated translations (@MarbasFR)
  • Pathfinder: Added bakemaps.
    Bakemaps is a new, very fast pathfinding system. You can pathfind 12 players across the entire map and the shortest path will be found in a single tick (without waits!) and without crashing the server. The downside is that it can take a minute to load at the start of a custom game for large pathmaps that cover the entire map.
    You can create a Bakemap by doing this:
// Get the map.
Pathmap map = new Pathmap('kings row.pathmap');

// Bake the pathmap.
Bakemap bake = map.Bake(attributes:[0,1], printProgress: p => {
    // Show baking progress as a HUD text
    CreateHudText(AllPlayers(), <'Baking: <0>%', Min(100, p * 100)>, Location: Location.Top, SortOrder: 2);
});

// Pathfind players
bake.Pathfind(players, position);

You can try out bakemaps for yourself in the workshop with the import code J133M

v2.0-beta.4

03 Jan 20:34

Choose a tag to compare

v2.0-beta.4 Pre-release
Pre-release
  • Array index is now an operator with precedence. x.y[z] is now parsed as (x.y)[z] rather than x.(y[z]).
  • Fixed exception when invoking a function like (x.y)();
  • Pathfinder: Now works with v2.0.
  • Pathfinder: The Create pathmap from CSV clipboard command now requires the current variable set as actions rather than the csv values.

v2.0-beta.3

30 Dec 23:11

Choose a tag to compare

v2.0-beta.3 Pre-release
Pre-release
  • Fixed exception when using an action comment on an unknown function.
  • Calling subroutines with restricted values will now add a warning rather than an error. Fixed restricted calls in constructors.
  • Decompiler: Added @Protowalker's precedence fix to the decompiler.
  • Decompiler #266: Added the ability to put action comments at the end of a block.
  • Decompiler #268: Null formats causing the decompiler to fail.
  • Decompiler #267: Modify actions causing the decompiler to fail.
  • Lobby #243: Added 'Ability Cooldown Time'
  • Lobby #250: Shared hero settings will now compile and decompile percentage values.
  • Optimizer #263: x*x no longer optimizes to x^2

v2.0-beta.2

19 Dec 00:40

Choose a tag to compare

v2.0-beta.2 Pre-release
Pre-release

Preview releases can now be downloaded right from Visual Studio Code:

  • Added support for Freezethaw Deathmatch and Snowball Deathmatch.
  • Added default parameters to chase functions.
  • Action comments now work again.
  • Added support for condition comments.
  • Changed return type of VerticalAngleFromDirection from vector to number.
  • The first created class reference now has a value of 1.
  • Fixed signature help and autocompletion not working in some cases.
  • Improved WaitAsync's completion and hover documentation.
  • Fixed memory bug with switches when there is a syntax error.
  • Fixed StackOverflowException when there is an extraneous else.
  • Fixed importing files with single-quote strings.
  • Fixed PlayerHeroStat not using the correct enumerator.
  • Fixed decompiling and converting several lobby settings.
  • Fixed decompiling functions that start with String.
  • Fixed decompiling Add Health Pool To Player.
  • Fixed converting decompiled strings to ostw.
  • Fixed writing comments on the first line causing the lexer to throw an exception.
  • Fixed optimization for DirectionFromAngles.

Visual Studio Code Extension

  • Updated to version v3.0.0.
    This will be published to the Visual Studio Code marketplace, so you do not need to download the vsix.
  • Added a status bar item displaying ostw's current version.
    Clicking on it will allow you to seamlessly download a specific ostw release.
  • Added the Restart Language Server command.
  • Fixed downloading the language server on Linux.
  • Improved decompiler error reporting.
  • For devs: added the ostw.dev.waitForDebugger setting which will restart the language server when the specified file is changed. This should be set to ../obj/Debug/netcoreapp3.0/Deltinteger.csproj.CopyComplete

v2.0-beta.1

01 Nov 09:07

Choose a tag to compare

v2.0-beta.1 Pre-release
Pre-release

Changes compared to the previous preview:

  • Added spectators option for the CreateProgressBarHudText function.
  • Added color reevaluation options to EffectRev.
  • Array creation ([ ]) now returns an array type.
  • Fixed comment block lexing.
  • Fixed incorrect skips when returning in functions.
  • Fixed order of operations. #204
  • Fixed unary operators. #191
  • Fixed incorrect document ranges after editing a file. #194
  • Fixed break and continue in for loops.
  • Fixed method groups as parameters.
  • Fixed layered lambdas. #202
  • Fixed exception when the lambda's value is an expression.
  • Fixed constant lambda names.
  • Fixed variable initial assignment constant type checking.
  • Fixed type cast parsing.
  • Fixed returning lambdas that access local variables.
  • Fixed macros usage in method groups.

v2.0-beta.0

23 Oct 23:30

Choose a tag to compare

v2.0-beta.0 Pre-release
Pre-release

Important

This is a preview. Some syntax may change before the final release.

Breaking changes

  • Lambdas whose parameters contain types must be wrapped around parentheses. Lambdas can now determine the parameter types from the context, so all you need to do is remove the type,
    Example:
array.FilteredArray(define a => a == 6)

to

array.FilteredArray(a => a == 6)

or

array.FilteredArray(a => (define a) == 6)
  • In future previews, the new string functions will probably be moved into the string type.

Removed ButtonValue, any occurrences of something like ButtonValue(Button.PrimaryFire) can be replaced with just Button.PrimaryFire.

VSCode extension

Because this is a preview, the vscode extension will not automatically update. Everything except decompiling will still work with the current version, so if you want to decompile, be sure to install the .vsix extension included in the assets.

2.0 features not included in this preview (@Protowalker 👀 )

  • Linux support
  • Explicit typing
  • Type aliasing*
  • Generics*

*May come out after 2.0 is released, we will see!

Changelog

Added support for the Workshop's October 2020 patch

Patch notes here.

Code text parser completely reworked

  • The new parser is extremely fast.
    • The Workshop Code channel in the output updates too slow, use the Create a panel for workshop code output to see the live changes in real time.
  • Files are now parsed incrementally.
  • Missing tokens are now handled elegantly.
    • This includes missing parentheses, brackets, etc.
    • File an issue if you get an exception from a missing character in your script.

Portable functions and subroutine variables

You can now store functions in variables, for example:

Example 1

// Specify the function name without parameters.

// 'DeclareMatchDraw()' is a function with no parameters that returns nothing.
(() => void) myFunction = DeclareMatchDraw;
myFunction();

Example 2

// 'Teleport(players, location)' is a function with 2 parameters that returns nothing.
((define, define) => void) tp = Teleport;
tp(eventPlayer, location);

Example 3

// An array of functions:
(() => void)[] functionArray = [
    DestroyAllDummyBots,
    DestroyAllEffects,
    DestroyAllHudText,
    DestroyAllIcons,
    // Lambdas work as well!
    () => {
        SmallMessage(AllPlayers(), "This was called from inside a lambda!");
    }
];

// Functions are internally stored as an array,
// because AppendToArray flattens arrays, you need to wrap the function inside [ ].
// This will probably be handled automatically before the full 2.0 release.
ModifyVariable(functionArray, Operation.AppendToArray, [DestroyAllInworldText])

// Execute the functions
foreach ((() => void) func in functionArray)
    func();

Example 4

rule: "My rule"
{
    // Choose a random subroutine.
    (() => void) myFunction =
        // Choose either 0 or 1.
        RandomInteger(0, 1) == 0 ?
        // If 0 is chosen, use Subroutine1.
        Subroutine1 :
        // Otherwise, use Subroutine2.
        Subroutine2

    // Call the subroutine.
    myFunction();
}

void Subroutine1() "Subroutine #1"
{
    SmallMessage(AllPlayers(), "This is subroutine #1");
}

void Subroutine2() "Subroutine #2"
{
    SmallMessage(AllPlayers(), "This is subroutine #2");
}

WaitAsync

WaitAsync functions like the Wait action but it does not block the current rule. A rule with a wait cannot be executed again until the wait is over, however, with WaitAsync it can be activated multiple times.

// If the host player presses interact, a number will be printed and 3 seconds later the same number will be printed again.
// Pressing interact multiple times in 3 seconds will execute the rule each time, unlike the default Wait.
// Local variables are captured, so 'value' is not replaced when executing the rule again.
rule: "Test"
if (IsButtonHeld(HostPlayer(), Button.Interact))
{
    define value = RandomInteger(0, 5);
    SmallMessage(AllPlayers(), <"Start: <0>", value>);

    WaitAsync(3, () => {
        SmallMessage(AllPlayers(), <"End: <0>", value>);
    });
}

Constructor subroutines

class Test
{
    public Test() "This is the subroutine name."
    {
    }
}

Decompiling

  • Improved error reporting.
  • Custom workshop settings are now supported.
  • The ^ operator is now recognized as right-associative.
  • Fixed decompiling Start Damage Modification and Start Healing Modification.
  • Fixed decompiling certain maps.
  • Fixed decompiling disabled modes.
  • Fixed decompiling several specific hero settings. (@Polymathical)

Bug fixes (and other stuff)

  • Any files with the .lobby extension can be used instead of customGameSettings.json.
  • Fixed ternary precedence.
  • Fixed exception when using enums in ternaries. (@Protowalker)

VSCode extension

  • Updated syntax to support function types like (() => void).

Known issues:

  • Some diagnostic's error range is one character longer than it should be.

OSTW v1.7 - Decompiler, inspector, pathfinding 3.0

23 Aug 05:44

Choose a tag to compare

Decompiler

Overwatch Script To Workshop can now decompile workshop code into OSTW code. More information on the wiki page.

Inspector

OSTW now has its own inspector! It supports multidimensional arrays and viewing class structures. More information on the wiki page.

Pathfinding

The wiki page has also been updated, I recommend checking it out!

Also check out the jump pads example.

  • Optimized the pathfinding functions a bit.
  • Multiple attributes can now be assigned to a segment.
    • CurrentSegmentAttribute() now returns an array of attributes rather than a single attribute.
  • Removing a segment no longer deletes the attribute data associated with it, use Pathmap.DeleteAttribute().
  • Removed Pathmap.SetSegmentAttributeAB()
  • Removed Pathmap.SetSegmentAttributeBA()
  • Renamed Pathmap.NextNode() to Pathmap.NextPosition()
  • Added Pathmap.AddAttribute()
  • Added Pathmap.DeleteAttribute()
  • Added Pathmap.DeleteAllAttributes().
  • Added Pathmap.DeleteAllAttributesConnectedToNodes()
  • Added Pathmap.CurrentNode()
  • Added Pathmap.IsPathfindingToAttribute()

Bug fixes

  • Fixed completion being handled before the dot is.
    • This means typing Color. will now show the colors right away rather than needing to press escape then ctrl+space.
  • Fixed a[b].c throwning an exception if a does not exist.

OSTW v1.6 - Fashion update!

16 Jul 00:16

Choose a tag to compare

General

  • Updated for the new workshop update.
  • Array type's functions IsTrueForAll, IsTrueForAny, FilteredArray, and SortedArray now have a new overload that can take a lambda with 2 parameters, one for the array value and one for the array index. For example: myArray.FilteredArray((define value, define index) => ...).
  • Array types now have the Map function.
  • TODO: WorkshopSettingInteger, WorkshopSettingReal, and WorkshopSettingToggle need constant parameters.

Syntax highlighting

Syntax highlighting has been reworked. Your code will look prettier now!

OSTW now supports semantic highlighting. This can be disabled in the settings.

Easier installation process

The latest version of OSTW can now be installed by running the vscode command Overwatch Script To Workshop: Download the latest OSTW release.

Restricted value detection

There is now a syntax error when calling a restricted value inside a rule that does not support it. You no longer need to dig through your output to find that stray Event Player value.

Visual Studio Code Extension

New settings:

  • ostw.deltintegerShell: Whether to use the operating system shell to start the deltinteger process.
  • ostw.semanticHighlighting: Determines if OSTW will use semantic highlighting.

New commands:

  • ostw.downloadLatestRelease: Download the latest OSTW release.
  • ostw.locateServerInstallation: Locate the server installation.
  • ostw.copyWorkshopCode: Copy the workshop output to the clipboard.

New hotkeys:

  • ostw.copyWorkshopCode: Copy the workshop output to the clipboard. Defaults to ctrl+alt+c.

Bug fixes and other stuff

  • Variables with the same name as existing types shouldn't cause problems anymore.
    • This means variables named Color and Effect will work now.
  • Recursive lambda detection.
  • Fixed Is In Alternate Form.
  • Added optional wait parameter to MinWait().

v1.6.1

  • Fixed parameters for the workshop values StopForcingPlayerOutlines, AddHealthPoolToPlayer, and RemoveHealthPoolFromPlayer.
  • Updated the lobby settings schema for Max Team 1/2 Players to support up to 12 players on one team.

OSTW v1.5 - Pathfinding 2.0

22 Jun 02:14

Choose a tag to compare

v1.5

Pathfinding 2.0

The pathfinding wiki still needs to be updated!

If you have any questions about the new pathfinding system (or OSTW in general), feel free to message my discord: Deltin#1624.

Attributes

Attributes is a new system that allows pathfinding to take advantage of hero abilities. All pathfinding functions now have an attributes parameter which determines which paths a player can take. In the example below, a Genji will double jump whenever they reach a path with an attribute of 3 and wall climb when they reach an attribute of 2.

Attributes
Attributes

Path resolving

Paths can now be precalculated and reused using the new Pathmap.Resolve() function. After a destination is resolved, pathfinding will instantly know the path to take from anywhere on the map with almost no affect on the server load. Example:

globalvar Pathmap hanamuraMap;
globalvar PathResolve resolvedPath;

rule: "Resolve path"
{
    Pathmap hanamuraMap = new Pathmap("hanamura.pathmap");
    PathResolve resolve = hanamuraMap.Resolve(Vector(-7.35, 1, -13.45));
}

rule: "Do pathfind"
{
    resolve.Pathfind(AllPlayers()); // Works with an array of players or a single player.
}

Server load VS algorithm speed

You can now customize the pathfinding functions depending on if server load or speed is more important.

Pathmap.Pathfind(), Pathmap.PathfindAll(), Pathmap.PathfindEither(), and Pathmap.Resolve() now contain optional parameters that can be used to determine where and when waits will occur while pathfinding. There are 2 main loops that make up pathfinding, where one is nested in the other. By default, 2 Wait(0.016) will occur at the start of each of these loops.

In the example below, a wait will occur every 4 iterations of the nested loop.

define waitIterate = 0;

hanamuraMap.Pathfind(lastDummyBot, LookingAtSpot, onLoopStart: () => {}, onNeighborLoopStart: () => {
    waitIterate++;
    if (waitIterate % 4 == 0) MinWait();
});

Hooks

Hooks can be used to modify how pathfinding-generated rules are created. More information on hooks is provided in their completion.
Hooks are set by assigning them in the rule-level, like so:

globalvar define myVariable;

Pathmap.OnPathStartHook = () => {
    // Specify additonal code to run when the 'Pathfinder: Resolve Current' rule runs.
};

rule: "My rule" { ... }

Currently, there are 5 hooks.

  • Pathmap.OnPathStartHook: The code to run when a path starts.
  • Pathmap.OnNodeReachedHook: The code to run when a player reaches a node.
  • Pathmap.OnPathCompleted: The code to run when a player reaches their destination.
  • Pathmap.IsNodeReachedDeterminer: The condition used to determine wether or not a player reached a node.
  • Pathmap.ApplicableNodeDeterminer: The code used to get a node from a position.

Dynamic nodes and segments

Nodes and segments can now be added dynamically using the AddNode and AddSegment functions. If a player has a placeable jump pad ability, you can create a new path so pathfinders will consider the new jump pad.

Better pathmap editing workflow

New vscode commands make it easier to edit pathmaps. You no longer need to drag-and-drop files into deltinteger.exe.

  • Overwatch Script To Workshop: Copy pathmap editor code
    Copies to clipboard the code used to edit a pathmap. If a .pathmap files is opened when the command is executed, code used to edit said pathmap will be copied to the clipboard. This code can be pasted into Overwatch to start editing.

  • Overwatch Script To Workshop: Create pathmap from CSV clipboard
    Creates a .pathmap file from the clipboard after copying CSV values in Overwatch.

New functions

Object functions:
Object functions require a Pathmap reference like Pathmap hanamura = new Pathmap("maps/hanamura.pathmap"). They can then be accessed by doing hanamura.Function().

  • Added Pathmap.Resolve()
  • Added Pathmap.PathfindEither()
  • Added Pathmap.AddNode()
  • Added Pathmap.DeleteNode()
  • Added Pathmap.AddSegment()
  • Added Pathmap.DeleteSegment()
  • Added Pathmap.SetSegmentAttributeAB()
  • Added Pathmap.SetSegmentAttributeBA()
  • Added Pathmap.SegmentFromNodes()

Static functions:

  • Added Pathmap.CurrentSegmentAttribute()
  • Added Pathmap.Recalibrate()
  • Added Pathmap.IsPathfindingToNode()
  • Added Pathmap.IsPathfindingToSegment()
  • Added Pathmap.ThrottleEventPlayerToNextNode()

And more:

  • Lower element count and some optimizations.
  • New class: PathResolve
  • New struct: PathmapSegment
  • Pathmap.Pathfind() now works on moving players.
    • Pathmap.PathfindAll() still does not work on moving players. However, pathfinding an array of players that could potentially be moving can be done with Pathmap.Resolve.

Virtual macros

  • Macros can now be assigned the virtual attribute and can be overriden.
  • This works for both macro variables (virtual define myMacro: value) and macro functions (virtual define myMacro(): value).
  • Created by Protowalker ♥

Enum values

  • Enums can now have custom values.
  • Also created by Protowalker ♥

Action comments

  • Actions generated can now have comments.
# Resurrect all nearby players
Resurrect(PlayersWithinRadius(PositionOf(eventPlayer), 5, TeamOf(eventPlayer), RadiusLOS.SurfacesAndAllBarriers));

Array Improvements

  • Typeless arrays can now be defined like define[].
  • Added Contains(), Random(), Randomize(), Append(), Remove(), Slice(), IndexOf(), Last, and First to array types.

Workshop

Note: In a future update there will be a json file where you can add new workshop actions without the need to wait for the next OSTW update.

  • Added the Player Dealt Knockback and Player Recieved Knockback events.
  • Added the Start Forcing Player Position and Stop Forcing Player Position actions.
  • Added the Attach Players and Detach Players actions.
  • Added the Is In Alternative Form, Is Duplicating, and Hero Being Duplicated values.

VSCode extension

  • New Commands:
    • Overwatch Script To Workshop: Copy pathmap editor code
      Copies to clipboard the code used to edit a pathmap. If a .pathmap files is opened when the command is executed, code used to edit said pathmap will be copied to the clipboard. This code can be pasted into Overwatch to start editing.
    • Overwatch Script To Workshop: Create pathmap from CSV clipboard
      Creates a .pathmap file from the clipboard after copying CSV values in Overwatch.

Bug fixes and other stuff

  • Named and nameless parameters now work together, for example:
// Previously, you needed to add 'VisibleTo:' before 'AllPlayers()' because of the named parameter proceeding it.
// Now, it will recognize 'AllPlayers()' is for the 'VisibleTo' parameter. 
CreateHudText(AllPlayers(), Text: "Hello!");
  • Added the Limit Valid Control Points setting to the custom game settings.
  • Class identifiers are now printed to the output.
  • Lambda parameters now show the argument types so you don't need to guess. (And no more errors like Expecting value of type BlockLambda, got BlockLambda.)
  • Function completion detail shows return type.
  • Fixed CTF maps for the lobby settings.
  • If, ElseIf, and Else actions are now hidden.
  • Fixed formatting strings with more than 3 parameters.
  • Fixed issue with static variables and functions.
  • Fixed array inherit check.
  • Fixed ternary conditionals in arrays.
  • Fixed error when files end with comment.

Modules

  • Improved Container.del.
  • Freecam is no longer jittery.

OSTW v1.4.1

25 Apr 21:13

Choose a tag to compare

OSTW v1.4.1 Pre-release
Pre-release

Updated for the new workshop update, see patch notes here.

  • Updated element counter.
  • Echo support.
  • Added description support for customGameSettings.json.
  • Calling break; will now use the workshop's new Break action rather than skip. Calling continue; will use the workshop's new Continue action. Calling continue in a for loop with an iterator or in a foreach loop will still use skip.
  • Added new workshop functions.
    • IsMeleeing
    • IsJumping
    • EventDirection
    • EventAbility
    • AbilityCooldown
    • AbilityIconString
    • SetCrouchEnabled
    • SetMeleeEnabled
    • SetJumpEnabled
    • DeclareRoundDraw
    • SetAbilityCooldown
    • CancelPrimaryAction
    • ButtonValue

ButtonValue needs to wrap the Button enumerator for the new actions and values that require a button parameter.

  • Subroutine overriders now call the subroutine rather than inserting the actions.
  • Added 'Call Mech Knockback Scalar' and 'Spawn Without Mech' settings.
  • Fixed class variables resolving initial value at the wrong time.
  • Fixed getting a macro variable's index.
  • Fixed 'Match Voice Chat' setting output.
  • Fixed Settings/lobby output.
  • Fixed type initialization occurring multiple times.
  • Fixed Team rule restriction.

v1.4.1

Fixed assigning subroutine parameters to the extended collection.