Difference between revisions of "CreateObject"

From Dragon Age Toolset Wiki
Jump to: navigation, search
(Generated by Sunjammer's Dragon Age Script Paser)
(a note about CreateObject mentioned in http://daforums.bioware.com/forums/viewtopic.html?topic=706863&forum=140&sp=0 by Georg)
Line 1: Line 1:
{{Generated}}
 
 
{{dafunction
 
{{dafunction
 
|name=CreateObject
 
|name=CreateObject
Line 36: Line 35:
 
<!-- This section contains the full description from the functions comments. Do not change unless you are confident these are incomplete or incorrect. -->
 
<!-- This section contains the full description from the functions comments. Do not change unless you are confident these are incomplete or incorrect. -->
  
<!-- == Remarks == -->
+
== Remarks ==
 
<!-- This section contains additional comments, observations and known issues. -->
 
<!-- This section contains additional comments, observations and known issues. -->
 +
 +
Note that dynamic creation of objects in the engine is subject to a host of limitations, reason being attempts to cut down 'unaccounted' memory usage.
 +
 +
Try avoiding CreateObject whenever possible.
  
 
<!-- == Examples == -->
 
<!-- == Examples == -->

Revision as of 02:11, 13 November 2009

Create an object in the specified location. Will attempt to use a corresponding pool if one exists.

object CreateObject(
int nObjectType,
resource rTemplate,
location lLoc,
string sOverrideScript = "",
int bSpawnActive = TRUE,
int bNoPermDeath = FALSE
);
Parameters:
nObjectType
The object type (placeable, creature, etc)
rTemplate
The template to use
lLoc
Location of the object
sOverrideScript
Script assigned to the object. If empty, the engine will use the template script
bSpawnActive
Whether or not this object is enabled at spawn time
bNoPermDeath
Set to TRUE to avoid destroying the object permanently (only valid for pool creatures)
Returns:

The new object, OBJECT_INVALID on failure

Source:

script.ldf


Remarks

Note that dynamic creation of objects in the engine is subject to a host of limitations, reason being attempts to cut down 'unaccounted' memory usage.

Try avoiding CreateObject whenever possible.


See also

CreatePool, DestroyObject