Just going to start a thread here for bugs in the text as they're found so we can keep them all in one place.
In the section Actors it incorrectly explains the Lua colon syntax
Actor state, attributes, modifiers and inventory functions all take the
actor as the first parameter, and so can be called using Lua's ':' operator:
x,y,z = foo:get_xyz() -- means the same as: x,y,z = get_xyz(foo) |
which should be:
x,y,z = foo:get_xyz() -- means the same as: x,y,z = foo.get_xyz(foo) |
It's a sugar for methods/functions that are properties of tables, not for regular functions not associated with a table.
Am I correct to say that there is an implicit `this` reference that gets passed into scripts on actors? I was poking around is Molly's object as saw that in the scripts. Would be nice if that was mentioned in the docs.
[Please log in to post a comment]