Difference between revisions of "Engine Function Documentation Template"
(→SetWorldPosition(...)=) |
|||
Line 15: | Line 15: | ||
Parameters: | Parameters: | ||
− | * (GameObj) mObj: The gameobject you want to place somewhere in the world | + | * <code>(GameObj) mObj:</code> The gameobject you want to place somewhere in the world |
− | * (Loc) mLoc: The location where to put the object | + | * <code>(Loc) mLoc:</code> The location where to put the object |
Return Values | Return Values | ||
− | * (boolean) mBool: True on success. False otherwise. | + | * <code>(boolean) mBool:</code> True on success. False otherwise. |
=== Notes and Caveats === | === Notes and Caveats === |
Revision as of 15:42, 1 November 2016
{You can use the code of this page as a template when creating a function documentation in the Category:Shards Online Lua Interface or Category:Function Reference category. Everything italic in curly brackets is just a comment or explanation and not part of the template.}
{REMOVEME: Template for API Functions}
SetWorldPosition(...)=
Function Type: Engine API Function Category: GameObj
Description
Set the position of this object in the world
Prototype
mBool = mObj:SetWorldPosition(mLoc )
Parameters:
(GameObj) mObj:
The gameobject you want to place somewhere in the world(Loc) mLoc:
The location where to put the object
Return Values
(boolean) mBool:
True on success. False otherwise.
Notes and Caveats
This works for both mobile and non-mobile objects. This will remove objects from containers and equipment slots
Don't place GameObjects outside the map coordinates. Just don't do it. Its evil
Examples
-- puts "this" to the map origin
mLoc = Loc(0,0,0)
mResult = this:SetWorldPosition(mLoc)
print("Success: "..tostring(mResult) )
The example places the object mObj to the map origin Loc(0,0,0)