Difference between revisions of "CreateBlob"

From King Arthur's Gold Wiki
Jump to: navigation, search
Line 3: Line 3:
 
It will return a reference to the blob.
 
It will return a reference to the blob.
 
</onlyinclude>
 
</onlyinclude>
 
 
For factoryName, either pass genericitem or genericblock. Use genericblock if the block needs to settle on the map grid, otherwise use genericitem.
 
For factoryName, either pass genericitem or genericblock. Use genericblock if the block needs to settle on the map grid, otherwise use genericitem.
  

Revision as of 13:50, 13 August 2012

CreateBlob will create a blob with the given factory and the given path to a config file defining the blob. It will return a reference to the blob.

For factoryName, either pass genericitem or genericblock. Use genericblock if the block needs to settle on the map grid, otherwise use genericitem.

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() );