Difference between revisions of "Engine Function Documentation Template"

From Legends of Aria Admin and Modding Wiki
Jump to: navigation, search
(Examples)
 
(33 intermediate revisions by the same user not shown)
Line 1: Line 1:
You can use the code of this page as a template when creating a function documentation in the "Shards Online Lua Interface" category.
+
''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.''
 +
<br>You can copypaste this block for your function Documentation:
 +
<br>Below the block you can see how it will look.
  
'''CanDrop(...)'''
+
<pre>
 +
== <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 ===
 
=== Prototype ===
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
function CanDrop(mObj, mLoc)
+
mBool = mObj:SetWorldPosition(mLoc )
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 
Parameters:
 
Parameters:
* (gameObj) mObj: The target gameobject
+
{|
* (Loc) mLoc: The Location used in the function
+
|-
 +
| <code>(GameObj)</code> || <code>mObj:</code> || The gameobject you want to place somewhere in the world
 +
|-
 +
| <code>(Loc)</code> || <code>mLoc:</code> || The location where to put the object
 +
|-
 +
| <code>(type)</code> || <code>name:</code> || Description
 +
 
 +
|}
 +
 
 +
 
 
Return Values
 
Return Values
* (boolean): Returns true when mObj can be dropped at mLoc, false otherwise
+
{|
=== Caveats ===
+
|-
Non existing sample function for documentation prototyping only.
+
| <code>(boolean)</code> || <code>mBool:</code> || True on success. False otherwise.
 +
|-
 +
| <code>(type)</code> || <code>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 ===
 
=== Examples ===
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
print("My example code goes here"..tostring(CanDrop(mObj,mLoc)))
+
-- puts "this" to the map origin
 +
mLoc = Loc(0,0,0)
 +
mResult = this:SetWorldPosition(mLoc)
 +
print("Success: "..tostring(mResult) )
 
</syntaxhighlight>
 
</syntaxhighlight>
And here goes some explanation
+
The example places the object mObj to the map origin Loc(0,0,0)
  
 +
[[Category:Shards Online Lua Interface]][[Category:Function Reference]]
 +
</pre>
  
 +
== <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)</code> || <code>mObj:</code> || The gameobject you want to place somewhere in the world
 +
|-
 +
| <code>(Loc)</code> || <code>mLoc:</code> || The location where to put the object
 +
|-
 +
| <code>(type)</code> || <code>name:</code> || Description
 +
 +
|}
 +
 +
 +
Return Values
 +
{|
 +
|-
 +
| <code>(boolean)</code> || <code>mBool:</code> || True on success. False otherwise.
 +
|-
 +
| <code>(type)</code> || <code>name:</code> || Description
 +
|}
  
  
[[Category:Shards Online Lua Interface]]
+
 
 +
=== 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]]

Latest revision as of 19:22, 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:
Below the block you can see how it will look.

== <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)</code> || <code>mObj:</code> || The gameobject you want to place somewhere in the world
|-
| <code>(Loc)</code> || <code>mLoc:</code> || The location where to put the object
|-
| <code>(type)</code> || <code>name:</code> || Description

|}


Return Values
{|
|-
| <code>(boolean)</code> || <code>mBool:</code> || True on success. False otherwise.
|-
| <code>(type)</code> || <code>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)