Difference between revisions of "CreateBlob"
From King Arthur's Gold Wiki
Shadlington (Talk | contribs) |
Shadlington (Talk | contribs) |
||
Line 6: | Line 6: | ||
There are two variants, one of which will also accept a team number and position vector. | There are two variants, one of which will also accept a team number and position vector. | ||
− | <pre>CBlob@ CreateBlob( const string &factoryName, const string &configFilename )</pre> | + | <pre>CBlob@ CreateBlob( const string &factoryName, const string &configFilename ) |
+ | CBlob@ CreateBlob( const string &factoryName, const string &configFilename, u16 team, Vec2f Position )</pre> | ||
+ | |||
Example from Entities/Characters/Scripts/ArcherLogic.as: | Example from Entities/Characters/Scripts/ArcherLogic.as: | ||
<pre>CBlob@ arrow = CreateBlob( "genericitem", "Entities/Items/Arrow.cfg" );</pre> | <pre>CBlob@ arrow = CreateBlob( "genericitem", "Entities/Items/Arrow.cfg" );</pre> | ||
− | |||
− | |||
Example from Entities/Workshops/WorkshopTasks.as: | Example from Entities/Workshops/WorkshopTasks.as: | ||
<pre>CBlob @shopBlob = CreateBlob( "genericblock", "Entities/Workshops/Base/WorkshopWAR.cfg", 0, this.getBlob().getPosition() );</pre> | <pre>CBlob @shopBlob = CreateBlob( "genericblock", "Entities/Workshops/Base/WorkshopWAR.cfg", 0, this.getBlob().getPosition() );</pre> |
Revision as of 19:48, 12 August 2012
CreateBlob will create a blob with the given name (not particularly important, I think?) and the given path to a config file defining the blob. It will return a reference to the blob.
There are two variants, one of which will also accept a team number and position vector.
CBlob@ CreateBlob( const string &factoryName, const string &configFilename ) CBlob@ CreateBlob( const string &factoryName, const string &configFilename, u16 team, Vec2f Position )
Example from Entities/Characters/Scripts/ArcherLogic.as:
CBlob@ arrow = CreateBlob( "genericitem", "Entities/Items/Arrow.cfg" );
Example from Entities/Workshops/WorkshopTasks.as:
CBlob @shopBlob = CreateBlob( "genericblock", "Entities/Workshops/Base/WorkshopWAR.cfg", 0, this.getBlob().getPosition() );