Difference between revisions of "Engine Function Documentation Template"
Line 2: | Line 2: | ||
<br>You can copypaste this block for your function Documentation: | <br>You can copypaste this block for your function Documentation: | ||
<pre> | <pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== <code>'''SetWorldPosition(...)'''</code> === | == <code>'''SetWorldPosition(...)'''</code> === | ||
{| | {| | ||
Line 78: | Line 24: | ||
{| | {| | ||
|- | |- | ||
− | | <code>(GameObj) || <code>mObj: || The gameobject you want to place somewhere in the world | + | | <code>(GameObj)</code> || <code>mObj:</code> || The gameobject you want to place somewhere in the world |
|- | |- | ||
− | | <code>(Loc) || <code>mLoc: || The location where to put the object | + | | <code>(Loc)</code> || <code>mLoc:</code> || The location where to put the object |
|- | |- | ||
− | | <code>(type) || <code>name: || Description | + | | <code>(type)</code> || <code>name:</code> || Description |
|} | |} | ||
Line 90: | Line 36: | ||
{| | {| | ||
|- | |- | ||
− | | <code>(boolean) || <code>mBool: || True on success. False otherwise. | + | | <code>(boolean)</code> || <code>mBool:</code> || True on success. False otherwise. |
|- | |- | ||
− | | <code>(type) || <code>name: || Description | + | | <code>(type)</code> || <code>name:</code> || Description |
|} | |} | ||
Revision as of 19:11, 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.
You can copypaste this block for your function Documentation:
SetWorldPosition(...)
=
Function Type: | Engine API |
Function Category: | GameObj |
Official Documentation: | SetWorldPosition |
Description
Sets the position of this object in the worldPrototype
mBool = mObj:SetWorldPosition(mLoc )
(GameObj) |
mObj: |
The gameobject you want to place somewhere in the world |
(Loc) |
mLoc: |
The location where to put the object |
(type) |
name: |
Description |
(boolean) |
mBool: |
True on success. False otherwise. |
(type) |
name: |
Description |
Notes and Caveats
This works for both mobile and non-mobile objects. This will remove objects from containers and equipment slotsDon'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) )