Difference between revisions of "Engine Function Documentation Template"
Line 9: | Line 9: | ||
|- | |- | ||
| Function Category: || GameObj | | Function Category: || GameObj | ||
+ | |- | ||
+ | | Official Documentation: || [http://shardsonline.com/lN2rwhz4jSVambqesEBZ/lua-reference/gameobj.html#setworldposition_ SetWorldPosition] | ||
|} | |} | ||
Line 22: | Line 24: | ||
{| | {| | ||
|- | |- | ||
− | | <code>(GameObj) mObj:</code> || The gameobject you want to place somewhere in the world | + | | <code>(GameObj) || mObj:</code> || The gameobject you want to place somewhere in the world |
|- | |- | ||
− | | <code>(Loc) | + | | <code>(Loc) || mLoc:</code> || The location where to put the object |
|- | |- | ||
− | | <code>(type) | + | | <code>(type) || name:</code> || Description |
|} | |} | ||
Line 34: | Line 36: | ||
{| | {| | ||
|- | |- | ||
− | | <code>(boolean) mBool:</code> || True on success. False otherwise. | + | | <code>(boolean) || mBool:</code> || True on success. False otherwise. |
|- | |- | ||
− | | <code>(type) | + | | <code>(type) || name:</code> || Description |
|} | |} | ||
Line 63: | Line 65: | ||
|- | |- | ||
| Function Category: || GameObj | | Function Category: || GameObj | ||
+ | |- | ||
+ | | Official Documentation: || [http://shardsonline.com/lN2rwhz4jSVambqesEBZ/lua-reference/gameobj.html#setworldposition_ SetWorldPosition] | ||
|} | |} | ||
Line 76: | Line 80: | ||
{| | {| | ||
|- | |- | ||
− | | <code>(GameObj) mObj:</code> || The gameobject you want to place somewhere in the world | + | | <code>(GameObj) || mObj:</code> || The gameobject you want to place somewhere in the world |
|- | |- | ||
− | | <code>(Loc) | + | | <code>(Loc) || mLoc:</code> || The location where to put the object |
|- | |- | ||
− | | <code>(type) | + | | <code>(type) || name:</code> || Description |
|} | |} | ||
Line 88: | Line 92: | ||
{| | {| | ||
|- | |- | ||
− | | <code>(boolean) mBool:</code> || True on success. False otherwise. | + | | <code>(boolean) || mBool:</code> || True on success. False otherwise. |
|- | |- | ||
− | | <code>(type) | + | | <code>(type) || name:</code> || Description |
|} | |} | ||
Revision as of 19:06, 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.}
You can copypaste this block for your function Documentation:
== <code>'''SetWorldPosition(...)'''</code> === {| |- | Function Type: || Engine API |- | Function Category: || GameObj |- | Official Documentation: || [http://shardsonline.com/lN2rwhz4jSVambqesEBZ/lua-reference/gameobj.html#setworldposition_ SetWorldPosition] |} ===Description === Sets the position of this object in the world === Prototype === <syntaxhighlight lang="lua"> mBool = mObj:SetWorldPosition(mLoc ) </syntaxhighlight> Parameters: {| |- | <code>(GameObj) || mObj:</code> || The gameobject you want to place somewhere in the world |- | <code>(Loc) || mLoc:</code> || The location where to put the object |- | <code>(type) || name:</code> || Description |} Return Values {| |- | <code>(boolean) || mBool:</code> || True on success. False otherwise. |- | <code>(type) || name:</code> || Description |} === Notes and Caveats === This works for both mobile and non-mobile objects. This will remove objects from containers and equipment slots <br>Don't place GameObjects outside the map coordinates. Just don't do it. Its evil === Examples === <syntaxhighlight lang="lua"> -- puts "this" to the map origin mLoc = Loc(0,0,0) mResult = this:SetWorldPosition(mLoc) print("Success: "..tostring(mResult) ) </syntaxhighlight> The example places the object mObj to the map origin Loc(0,0,0) [[Category:Shards Online Lua Interface]][[Category:Function Reference]]
SetWorldPosition(...)
=
Function Type: | Engine API |
Function Category: | GameObj |
Official Documentation: | SetWorldPosition |
Description
Sets 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 |
(type) |
name: | Description |
Return Values
(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 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)