Skip to content

Releases: ItsDeltin/Overwatch-Script-To-Workshop

OSTW v0.3.15

18 Aug 21:38

Choose a tag to compare

OSTW v0.3.15 Pre-release
Pre-release

OSTW v0.3.15

Import support.

// Top of file
import "HUD.del";
import "TrackerClass.del";
import "ZombieClass.del";

// Absolute paths work too.
import "../Extras.del";

rule: "my rule"
...

New methods

Workshop:

  • EventHealing()
  • Healee()
  • Healer()
  • HostPlayer()

Custom by @TrueCP6 :

  • OptimisedBlendedIndex()
  • OptmisedRangeOfArray()
  • OptimisedSortedMedian()
  • OptimisedUnsortedMedian()
  • OptimisedEyeCastHitPosition()
  • OptimisedHorizontalDistance()
  • IsAIUnintrusive()
  • IsAIAccurate()
  • OptimisedIsOnScreen()
  • OptimisedLinearInterpolate()
  • OptimisedLinearInterpolateDistance()
  • ToRadians()
  • ToDegrees()
  • SetHealth()
  • OptimisedSphereHitbox()

Fixed bugs

Fixed ServerLoad(), ServerLoadAverage(), and ServerLoadPeak().
Player.Genji event restriction typo fixed.
Icon.Asterisk typo fixed.

VSCode extension v0.0.7

Now supports diagnostics for multiple files. The vscode extension must be updated to work with v0.3.15.

OSTW v0.3.14

12 Aug 19:13

Choose a tag to compare

OSTW v0.3.14 Pre-release
Pre-release

Added StopChasingVariable(variable).
Fixed crash when rule names are longer than 128 characters.
Fixed ChaseVariable looper rule setting variable to 0 if the destination was not yet set.

New event types (PTR only):

Event.OnHealingDealt
Event.OnHealingTaken
Event.OnPlayerJoin
Event.OnPlayerLeave

New custom methods by @TrueCP6 :

BlendedIndex(array, index)

Allows you to get a value from an array using a non-integer index. Only works on data types that can have math operation performed upon them.


MinOfArray(array)

The lowest value of an array.


MaxOfArray(array)

The highest value of an array.


RangeOfArray(array)

The highest value of an array subtracted by its lowest value.


SortedMedian(array)

The median of an array that has already been sorted.


UnsortedMedian(array)

The median of an array that has not been sorted yet.


Destination(startingPoint, direction, distance)

Calculates a destination given a starting point, distance and direction.


EyeCastHitPosition(player, range)

Casts a ray in the direction the player is facing with a certain range.


FOVTakenUpBySphere(distanceToSphereCenter, sphereRadius)

The midpoint between 2 vectors.


HorizontalDistance(vector1, vector2)

The distance between 2 points as if they were on the same Y level.


IsOnScreen(player, point, fovOfPlayer)

Whether a point is visible on a players screen or not.


LinearInterpolate(point1, point2, fraction)

A point a fraction along the distance between 2 points.


LinearInterpolateDistance(point1, point2, distance)

A point a distance along a straight line between 2 points.


Midpoint(point1, point2)

The midpoint between 2 vectors.


Pythag(side1, side2)

Calculates the length of the longest side (hypotenuse) of a right angled triangle.


PythagConverse(side1, hypotenuse)

Calculates the missing side of a right angled triangle.


SphereHitbox(player, spherePosition, sphereRadius)

Whether the given player is looking directly at a sphere with collision.


TallnessOfPlayer(player)

The height of the player measured from feet to eyes.


ToKPH(metersPerSecond)

Converts from meters per second to kilometers per hour.


ToMPH(metersPerSecond)

Converts from meters per second to miles per hour.


ToFt(meters)

Converts from meters to feet.


ToYards(meters)

Converts from meters to yards.


ToInches(meters)

Converts meters to inches.

OSTW v0.3.13

07 Aug 17:18

Choose a tag to compare

OSTW v0.3.13 Pre-release
Pre-release

Variables defined outside of methods and structs can now have a default value.
Added IsConditionTrue() and IsConditionFalse().
Fixed aborting in loops. (#34)
Fixed crash when calling the same method twice. (#37)

OSTW v0.3.12

28 Jul 20:25

Choose a tag to compare

OSTW v0.3.12 Pre-release
Pre-release
  • Fixed number output. (#32, #33)
  • HealthPercent() renamed to NormalizedHealth(). (#31)
  • Fixed StopHoldingButton parameters. (#35)
  • Fixed operator precedence.
  • Fixed non-workshop methods in if statements being evaluated after the block.
  • Added AngleBetweenVectors().
  • Added ServerLoad(), ServerLoadAverage(), ServerLoadPeak().

Multidimensional array manipulation

The Overwatch workshop inspector won't show multidimensional arrays correctly.

Example
define myArray;
myArray[2][6] = 5;
SmallMessage(EventPlayer(), myArray[2][6]); // Output is 5

Struct support

These can contain variables and methods.

Example
TeleportSphere playervar spheres;
define playervar wasCreated;

rule: "Create sphere"
Event.OngoingPlayer
if (IsButtonHeld(EventPlayer(), Button.Interact))
{
    if (!wasCreated)
    {
        spheres = new TeleportSphere(EventPlayer(), PositionOf(EventPlayer()));
        spheres.Create(); 
    }
}

rule: "Destroy"
Event.OngoingPlayer
if (IsButtonHeld(EventPlayer(), Button.PrimaryFire))
{
    spheres.Destroy();
}

rule: "Return"
Event.OngoingPlayer
if (IsButtonHeld(EventPlayer(), Button.SecondaryFire))
{
    spheres.Return();
}

struct TeleportSphere
{
    define location;
    define owner;
    define radius = 5;
    define initialRadius = radius;
    define effectID;
    define wasDestroyed = false;

    public TeleportSphere(owner, location)
    {
        this.owner = owner;
        this.location = location;
        owner.wasCreated = true;
    }

    private method Create()
    {
        CreateEffect(AllPlayers(), Effect.Sphere, Color.Red, this.location, radius, EffectRev.VisibleToPositionAndRadius);
        effectID = LastCreatedEntity();
        ApplyImpulse(EventPlayer(), Vector(0, 10, 0), 10);
    }

    private method Destroy()
    {
        if (wasDestroyed) return;

        ChaseVariable(radius, 0, 10);

        // Wait for the effect to be destroyed
        CreateEffect(AllPlayers(), Effect.BadAura, Color.Red, location, radius + 1);
        define sparkEffect = LastCreatedEntity();
        while (radius != 0);
        DestroyEffect(sparkEffect);

        ChaseVariable(radius, 0, 0);

        // Play an explosion
        PlayEffect(AllPlayers(), PlayEffect.BadExplosion, Color.Red, location, 3);

        // Damage nearby players
        foreach 6 (define player in AllPlayers())
            if (IsInRange(player))
                Damage(player, owner, 50);

        DestroyEffect(effectID);
        wasDestroyed = true;
        owner.wasCreated = false;
    }

    private method IsInRange(player)
    {
        return DistanceBetween(PositionOf(player), location) < initialRadius;
    }

    private method Return()
    {
        if (wasDestroyed) return;
        Teleport(owner, location);
        PlayEffect(AllPlayers(), PlayEffect.GoodExplosion, Color.Blue, location, radius - 1);
    }
}

Public, private, and static support will come later.

New keywords

If you have any variables named one of these, be sure to change it to prevent conflicts.

  • new
  • this
  • struct

These are registered keywords that aren't functional yet, but they will be later:

  • public
  • private
  • static

VSCode extension

Updated for new keywords.

OSTW v0.3.11

13 Jul 22:55

Choose a tag to compare

OSTW v0.3.11 Pre-release
Pre-release

Updated foreach.

  • Uses one less variable and action.
  • Now takes an optional repeater parameter. Makes the foreach faster, but uses more actions. For example:
rule: "Repeater test."
Event.OngoingPlayer 
if (IsButtonHeld(EventPlayer(), Button.Interact))
{
    define start = TotalTimeElapsed();    
    foreach 5 (define player in AllPlayers()) // 5 is the repeater count
    {
        SmallMessage(player, "hello!");
    }
    define finished = TotalTimeElapsed();
    SmallMessage(EventPlayer(), <"time finished: <0>", finished - start>);
}
Repeater count Time to Complete Actions
1 19 ms 12
2 10 ms 14
3 6 ms 16
4 5 ms 18
5 3 ms 20

The number of actions scale with the number of statements in the foreach.

Added Pi()

Fixed Rounding.Nearest (#30)

Fixed VerticalFacingAngleOf() (#27)

Fixed semantic predicate priority. (#26)

VSCode extension updates

  • Is now much, much faster.
  • Extension must be updated for this release to work with the language server.

OSTW v0.3.10

08 Jul 03:34

Choose a tag to compare

OSTW v0.3.10 Pre-release
Pre-release

Variables defined in methods can now use a specific workshop variable.

Fixed special symbol output. (#25)

Fixed variables named 'array' not working.

Fixed the {0} + {1} string.

Improved local variable autocomplete.

Improved recursive methods.

  • Variables defined in recursive methods now work properly.
  • Removed the -allowrecursion argument. Recursive methods are now declared like recursive method myRecursiveMethod().

Methods can now have documentation which will show up in the autocomplete:

# My Method does something.
method myMethod()

New methods:

  • Added RemoveFromArrayAtIndex().
  • Added InsertValueInArray()

VSCode extension:

  • Updated syntax to work with method changes.
  • Changed default ports to 9145 and 9146

OSTW v0.3.9

04 Jul 02:49

Choose a tag to compare

OSTW v0.3.9 Pre-release
Pre-release

ChaseVariable() now works with vectors and player variables.

Added ternary conditionals.

OSTW v0.3.8

30 Jun 21:01

Choose a tag to compare

OSTW v0.3.8 Pre-release
Pre-release

Added ChaseVariable(), which will work with named variables.
Fixed AngleOfVectors() parameters.
AngleOfVectorsCom() will return the angle instead of the res now.

OSTW v0.3.7

26 Jun 17:07

Choose a tag to compare

OSTW v0.3.7 Pre-release
Pre-release

Added new workshop strings
Removed underscores from strings.
Added EventDamage(), EventWasCriticalHit(), and DestroyAllInworldText().
Fixed Left() return type.
Fixed Dva, Torbjorn, and Lucio enums.

OSTW v0.3.6

23 Jun 19:08

Choose a tag to compare

OSTW v0.3.6 Pre-release
Pre-release

Fixed loops running despite the condition.
Added foreach(define var in array) { ... } (Actual value instead of index now)
Added increment var++ and decrement var-- (You can do for (define i = 0; i < 10; i++) instead of i+=1)
Removed for (var in array)