Difference between revisions of "CBlob::Settle"

From King Arthur's Gold Wiki
Jump to: navigation, search
(Created page with "<onlyinclude> </onlyinclude> <syntaxhighlight lang="cpp"> void Settle() </syntaxhighlight> Object method of: CBlob Category:Scripting Category:Object Methods")
 
Line 1: Line 1:
 
<onlyinclude>
 
<onlyinclude>
+
Settles object in physical world
 
</onlyinclude>
 
</onlyinclude>
+
 
 +
This function will settle object in phyiscal world.
 +
In other words, it removes any interaction with ingame phyiscal laws from the blob.
 +
Best described with following example:
 +
When you place stone wall, consisting of three stone blocks, all of these blocks are placed in Settle state. If you destroy the bottom most stone block, other two will start UnSettle and start interacting with phyiscal laws, thus drop until they hit the ground, where they turn into rubble.
 +
 
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
 
 
void Settle()
 
void Settle()
+
</syntaxhighlight>
 +
 
 +
 
 +
Example (In this example you first spawn stone block that will stay still in the middle of the air, because you remove any phyiscal (law) interaction when it spawns using Settle function):
 +
<syntaxhighlight lang="cpp">
 +
CBlob @block = CreateBlob( "genericitem", "Entities/Structures/Stone/Block1x1.cfg" );
 +
block.setPosition(getControls().getMouseWorldPos());
 +
block.Settle();
 
</syntaxhighlight>
 
</syntaxhighlight>
 
   
 
   

Revision as of 23:14, 1 October 2012

Settles object in physical world


This function will settle object in phyiscal world. In other words, it removes any interaction with ingame phyiscal laws from the blob. Best described with following example: When you place stone wall, consisting of three stone blocks, all of these blocks are placed in Settle state. If you destroy the bottom most stone block, other two will start UnSettle and start interacting with phyiscal laws, thus drop until they hit the ground, where they turn into rubble.

void Settle()


Example (In this example you first spawn stone block that will stay still in the middle of the air, because you remove any phyiscal (law) interaction when it spawns using Settle function):

CBlob @block = CreateBlob( "genericitem", "Entities/Structures/Stone/Block1x1.cfg" );
block.setPosition(getControls().getMouseWorldPos());
block.Settle();

Object method of: CBlob