Skip to content

OSTW v0.5

Pre-release
Pre-release

Choose a tag to compare

@ItsDeltin ItsDeltin released this 19 Sep 16:44
· 1888 commits to master since this release
  • Classes

Example

The example below will print 2 then 4. If myClass was changed into a struct, it would print 2 then 2.

rule: "Test"
{
    myClass myVar = new myClass();
    SmallMessage(AllPlayers(), myVar.classVar);
    change(myVar);
    SmallMessage(AllPlayers(), myVar.classVar);
}

method change(myClass myVar)
{
    myVar.classVar = 4;
}

class myClass
{
    public define classVar = 2;
}

A maximum of 1000 classes can be allocated at a time. Use the delete() keyword to free up memory.

rule: "Clean Up"
{
    delete(myVar);
}
  • New methods

ClassMemory(): Gets the percentage of class memory remaining.

ClassMemoryRemaining(): Gets the number of classes that can be created.

ClassMemoryUsed(): Gets the number of classes that were created.

  • Type conversion

(<MyClass>myVar).methodInClass();

Macros work in conditions and do not use any actions.

private macro NotOnTeam(define player): FilteredArray(AllPlayers(), ArrayElement().team != player.team && IsAlive(ArrayElement()));
private macro Normal(define start, define end): RayCastHitNormal(start, end, null, null, true);
  • New keywords: delete, macro, root.

    • root can be used in classes/structs to get variables created at the rule level.
  • public/private accessors work now. Class/struct elements are now private by default.

  • CreateTextMinimal is now CreateText. Old CreateText is now CreateTextFancy. CreateText (old CreateTextMinimal) creates even less effects now.

  • ShowWireframe and the CreateText methods can now take a vector as a rotation parameter. If the vector is a constant (ex Vector(40, 10, 20)) it will create the effect with the model pre-rotated.

  • Changed boolean operators | and & to || and &&.

  • Added variable invert (-myVal == myVal * -1).

  • Fixed invalid statements not showing an error.

  • Fixed structs in foreach (#59).

  • Fixed crash when using model variables as normal variables.

VSCode extension v0.1.2

Updated for new keywords.


v0.5.0.1 hotfix

Fixed crash if there are no constructors in a class or struct.