taro
taro copied to clipboard
feat: new functions, triggers, and actions
Add functions getStringObjectElement, setStringObjectElement, and removeStringObjectElement which can take key, a string parameter
Add a function, getUserId (this returns the account's unique identifier, not just the player's entity id)
Change insertStringArrayElement and updateStringArrayElement functions to let empty strings pass too
Add splitStringIntoArray function, takes parameters string and separator
Usage:
split Hello World by (space) into json array
// Will return a string: ["Hello","World"]
Add getPositionInFrontOfPosition function, takes parameters position, distance, angle
Usage:
get position (5) distance from {x: 0, y: 0} at (0) radians
// Will return a position: {x: 5, y: 0}
Add a function allUnitsOfUnitType, which can be used in for all units loops. Takes parameter unitType.
Add a function allPlayersOfPlayerType, which can be used in for all players loops. Takes parameter playerType.
I was always bugged by the fact that (center of (entire map region)) returned a position 1 tile off from the actual map's center, and turns out the entire map function intentionally returns a region offset by 2 tiles? Not sure what the reason behind this is
Add 4 functions for incrementing player/entity attributes. Usage:
increase (attribute) of (player) by (value)
decrease (attribute) of (player) by (value)
increase (attribute) of (entity) by (value)
decrease (attribute) of (entity) by (value)
Also move 'comment' case to the top so it breaks out of the switch early when encountering a comment instead of testing the 200+ cases