Teardown-Issue-Tracker-Maintainers / Teardown-Issue-Tracker

A public repo for the community to track issues/bugs/feature requests in Teardown.
12 stars 5 forks source link

[Documentation] Examples in Lua API docs reference incorrect functions #1

Closed BrunoBieri closed 3 years ago

BrunoBieri commented 3 years ago

In the Lua API documentation for Teardown 0.6.2 there are some minor issues


For "SetString"

The example API shows SetBool("level.name", "foo")

Actual Result: Note that it says SetBool.

Expected Result: I think it should be SetString instead.

Link: https://www.teardowngame.com/modding/api.html#SetString


For "FindJoint" and "FindJoints"

Both examples API use FindLocation instead of FindJoint and FindJoints

Links: https://www.teardowngame.com/modding/api.html#FindJoint https://www.teardowngame.com/modding/api.html#FindJoints


For "FindShape"

The example API shows

--Search for a shape tagged "mybox" in script scope
local target = FindShape("mybox")

--Search for a shape tagged "laserturret" in entire scene
local escape = FindBody("laserturret", true)

Actual Result: Note that in the second line of code it says FindBody.

Expected Result: I think it should be FindShape instead.

https://www.teardowngame.com/modding/api.html#FindShape


For "GetShapeLocalTransform"

The example API shows

--Shape transform in body local space
local shapeTransform = GetShapeLocalTransform(shape)

--Body transform in world space
local bodyTransforn = GetBodyTransform(GetShapeBody(shape))

--Shape transform in world space
local worldTranform = TransformToParentTransform(bodyTransform, shapeTransform)

Actual Result: Note the variable name bodyTransforn.

Expected Result: Should actually be bodyTransform instead with an "m" at the end.

https://www.teardowngame.com/modding/api.html#GetShapeLocalTransform


For "GetShapeWorldTransform"

The example API shows

local worldTransform = GetShapeWorldTransform(shape)

--This is equivalent to
local shapeTransform = GetShapeLocalTransform(shape)
local bodyTransforn = GetBodyTransform(GetShapeBody(shape))
worldTranform = TransformToParentTransform(bodyTransform, shapeTransform)

Actual Result: Note the variable name bodyTransforn.

Expected Result: Should actually be bodyTransform instead with an "m" at the end.

https://www.teardowngame.com/modding/api.html#GetShapeWorldTransform

tuxedolabs commented 3 years ago

All fixed in 0.7.0. Thanks for reporting!