Difference between revisions of "CBlob"

From King Arthur's Gold Wiki
Jump to: navigation, search
m (Added a new table with some of the available hooks. The list is by no means complete, and each one should probably have their own page/template.)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<onlyinclude>
 
<onlyinclude>
+
CBlob is most common networked object in game that can be interacted in some way.
 
</onlyinclude>
 
</onlyinclude>
 
   
 
   
Line 9: Line 9:
 
! '''Method'''
 
! '''Method'''
 
! '''Description'''
 
! '''Description'''
 +
|-
 +
| [[CBlob::exists|exists]]
 +
| {{:CBlob::exists|exists}}
 +
|-
 +
| [[CBlob::get_(type)|get_(type)]]
 +
| {{:CBlob::get_(type)|get_(type)}}
 +
|-
 +
| [[CBlob::set_(type)|set_(type)]]
 +
| {{:CBlob::set_(type)|set_(type)}}
 +
|-
 +
| [[CBlob::Sync|Sync]]
 +
| {{:CBlob::Sync|Sync}}
 
|-
 
|-
 
| [[CBlob::getPosition|getPosition]]
 
| [[CBlob::getPosition|getPosition]]
Line 78: Line 90:
 
| [[CBlob::isOnLadder|isOnLadder]]
 
| [[CBlob::isOnLadder|isOnLadder]]
 
| {{:CBlob::isOnLadder|isOnLadder}}
 
| {{:CBlob::isOnLadder|isOnLadder}}
 +
|-
 +
| [[CBlob::isOnWall|isOnWall]]
 +
| {{:CBlob::isOnWall|isOnWall}}
 +
|-
 +
| [[CBlob::isOnCeiling|isOnCeiling]]
 +
| {{:CBlob::isOnCeiling|isOnCeiling}}
 
|-
 
|-
 
| [[CBlob::isInAction|isInAction]]
 
| [[CBlob::isInAction|isInAction]]
Line 369: Line 387:
 
| [[CBlob::SendCommand|SendCommand]]
 
| [[CBlob::SendCommand|SendCommand]]
 
| {{:CBlob::SendCommand|SendCommand}}
 
| {{:CBlob::SendCommand|SendCommand}}
 +
|-
 +
| [[CBlob::Tag|Tag]]
 +
| {{:CBlob::Tag|Tag}}
 +
|-
 +
| [[CBlob::Untag|Untag]]
 +
| {{:CBlob::Untag|Untag}}
 +
|-
 +
| [[CBlob::hasTag|hasTag]]
 +
| {{:CBlob::hasTag|hasTag}}
 +
|-
 +
| [[CBlob::AddScriptObject|AddScriptObject]]
 +
| {{:CBlob::AddScriptObject|AddScriptObject}}
 +
|-
 +
| [[CBlob::DeleteScriptObject|DeleteScriptObject]]
 +
| {{:CBlob::DeleteScriptObject|DeleteScriptObject}}
 +
|-
 +
| [[CBlob::DeleteScriptObjectByIndex|DeleteScriptObjectByIndex]]
 +
| {{:CBlob::DeleteScriptObjectByIndex|DeleteScriptObjectByIndex}}
 +
|-
 +
| [[CBlob::AddScriptObjectGroup|AddScriptObjectGroup]]
 +
| {{:CBlob::AddScriptObjectGroup|AddScriptObjectGroup}}
 +
|-
 +
| [[CBlob::getScriptObject|getScriptObject]]
 +
| {{:CBlob::getScriptObject|getScriptObject}}
 +
|-
 +
| [[CBlob::getScriptObjectGroupSize|getScriptObjectGroupSize]]
 +
| {{:CBlob::getScriptObjectGroupSize|getScriptObjectGroupSize}}
 +
|-
 +
| [[CBlob::getScriptObjectsArray|getScriptObjectsArray]]
 +
| {{:CBlob::getScriptObjectsArray|getScriptObjectsArray}}
 +
|-
 +
| [[CBlob::GetScriptObjectsArray|GetScriptObjectsArray]]
 +
| {{:CBlob::GetScriptObjectsArray|GetScriptObjectsArray}}
 
|-
 
|-
 
|}
 
|}
Line 407: Line 458:
 
| dimension2di
 
| dimension2di
 
|
 
|
 +
|-
 +
|}
 +
 +
Hooks:
 +
 +
{| class="wikitableShiny" border="1"
 +
|-
 +
! '''Signature'''
 +
! '''Description'''
 +
|-
 +
| void onInit(CBlob@ this)
 +
| Called on initialization.
 +
|-
 +
| void onTick(CBlob@ this)
 +
| Called on every tick.
 +
|-
 +
| f32 onHit(CBlob@ this, Vec2f worldPoint, Vec2f velocity, f32 damage, CBlob@ hitterBlob, u8 customData)
 +
| Called on every hit.
 +
|-
 +
| bool canBePickedUp(CBlob@ this, CBlob@ other)
 +
| Called on pickup check.
 +
|-
 +
| bool doesCollideWithBlob(CBlob@ this, CBlob@ other)
 +
| Called on collision check.
 +
|-
 +
| void onCollision(CBlob@ this, CBlob@ other, bool solid, Vec2f normal, Vec2f point)
 +
| Called on collision.
 +
|-
 +
| void onDie(CBlob@ this)
 +
| Called on death.
 
|-
 
|-
 
|}
 
|}

Latest revision as of 16:10, 31 January 2016

CBlob is most common networked object in game that can be interacted in some way.


Methods:

Method Description
exists

Returns a bool indicating whether or not this blob has given property.

get_(type)

Retrieves a value of a certain type

set_(type)

Stores a value of a certain type.

Sync

Synchronizes a property value over the network.

getPosition

Returns a Vec2f value with current blob's position.

setPosition

Sets a new position for the blob.

getVelocity

Returns a Vec2f value with current blob's velocity.

getOldVelocity


setVelocity

Sets a new velocity for the blob.

AddForce


getRadius

Retrieve this blob's radius

getWidth


getHeight


getMass


SetVisible

Sets blob's visibility in the world.

SetDead

Sets blob dead.

Die


isActive


SetActive


Settle

Settles object in physical world.

UnSettle

Unsettles object in physical world.

getPostionWIthOffset


getScreenPos


isFacingLeft

Returns true if blob is facing left, false if blob is facing right.

SetFacingLeft

Sets blob's facing to left or right, depending on boolean parameter

isOnGround

Returns true if blob is on ground, false if blob is in air.

isOnLadder

Returns true if blob is on the ladder, false otherwise.

isOnWall


isOnCeiling


isInAction


isSnapTodGrid


RemoveScript


AddScript


PutInInventory


PutOutInventory


RemoveFromInventories


canBePutInInventory


isInventoryAccessible


SetQuantity


getQuantity


getInventoryName


RenderForHUD


getTouchingCount


getTouchingByIndex


getTouchingOffsetByIndex


getTouchingOffsetByBlob


setTouchingOffsetbyBlob


setTouchingOffsetbyIndex


isTouching


getAttachmentPointCount


getAttachmentPoint


DetachFrom


DetachAll


DetachFromAll


isAttachedTo


isAttached


getAbsoluteAttachemntPoint


getCarriedBlob


PutCarriedInventory


DropCarried


Throw


ShootBlob


AttachTo


CreateGenericButton


ClearMenus


ClearGridMenus


ClearButtons


ShowInteractButtons


ClickInteractButton


ClickClosestInteractButton


CreateInventoryMenu


ShowPickupButtons


CreateBubbleMenu


ShowBubble


ClearBubbleMenu


isInWater


getProperties


ClickGridMenu


getSprite


getShape


getMovement


getWeapon


getBrain


getAttachments


getInventory


Pickup


PickupIntoHands


PickupIntoInventory


getNetworkID


getTeamNum


setTeamNum


getTeam


getSkinNum


getHeadNum


getSexNum


getName


isMyPlayer


getControls


isKeyPressed


wasKeyPressed


isKeyJustPressed


isKeyJustReleased


setKeyPressed


getAimPos


setAimPos


getMapTile


isMapBlock


canBePlacedAt


Hit


HitMap


Damage


Heal


getHitInfosFromArc


getHitInfosFromRay


getHitInfosSize


getHitInfoByIndex


SetDamageOwnerPlayer


getRespawnPosition


CreateRespawnPoint


ModifyRespawnPoint


PlugPlayer


UnplugPlayer


MoveBlobStuffTo


getPlayer


SetTimeToDie


SendCommand

Sends a command over the network.

Tag

Turns on a basic boolean flag.

Untag

Turns off a basic boolean flag

hasTag

Checks if a basic boolean flag has been set.

AddScriptObject


DeleteScriptObject


DeleteScriptObjectByIndex


AddScriptObjectGroup


getScriptObject


getScriptObjectGroupSize


getScriptObjectsArray


GetScriptObjectsArray


Properties:

Property Type Description
shape CShape@ Reference to the blob's shape object.
health f32
defaultHealth f32
inventoryIconFrame int
inventoryMaxStacks int
inventoryFramDimension dimension2di
inventorySlots dimension2di

Hooks:

Signature Description
void onInit(CBlob@ this) Called on initialization.
void onTick(CBlob@ this) Called on every tick.
f32 onHit(CBlob@ this, Vec2f worldPoint, Vec2f velocity, f32 damage, CBlob@ hitterBlob, u8 customData) Called on every hit.
bool canBePickedUp(CBlob@ this, CBlob@ other) Called on pickup check.
bool doesCollideWithBlob(CBlob@ this, CBlob@ other) Called on collision check.
void onCollision(CBlob@ this, CBlob@ other, bool solid, Vec2f normal, Vec2f point) Called on collision.
void onDie(CBlob@ this) Called on death.