Skip to content

Unit OC/Object

Represents a battle unit object.


Constructor

oc unit(string bdat, int id = 0, int unk = 0)

Gets a bdat unit.

Valid names:

  • FLD_npclist or npc
  • BTL_enelist or ene
  • BTL_pclist or pc
  • player

Attributes

x

float unit.x

X position.


y

float unit.y

Y position.


y

float unit.z

Z position.


dir

float unit.dir

Direction.


name

string unit.name

Unit name.


bdid

string unit.bdid

Unknown. Getter only.


ID

string unit.ID

ID. Getter only.


HP

string unit.HP

Current HP. Getter only.


Methods

isValid

void unit->isValid()

⚠ Dummy function.


setGround

void unit->setGround()

Unknown.


dispOn

void unit->dispOn(int visible = true)

Set whether the unit is visible.


dispOff

void unit->dispOff(int invisible = true)

Set whether the unit is invisible.


forceDispOff

void unit->forceDispOff(int invisible = true)

Unknown.


dispWeapon

void unit->dispWeapon(bool visible)

Sets whether the unit's weapon is visible.


moveMode

void unit->moveMode(int mode)

Sets the move mode.


getMoveMode

int unit->getMoveMode()

Gets the move mode.


isSetDir

int unit->isSetDir()

⚠ Dummy function.


setModeChange

void unit->setModeChange(bool unk)

Unknown.


setModeChange

void unit->setModeChange(float x, float y, float z, int param, int moveMode)

Unknown.


walkR

void unit->walkR(float unk)

⚠ Dummy function.


walkIdleTime

void unit->walkIdleTime(int unk)

⚠ Dummy function.


initWalk

void unit->initWalk(float x, float y, float z)

⚠ Dummy function.


movePoint

void unit->movePoint(int start, int end, array param, float angle = 360)

Moves to a point.


isMoveEnd

bool unit->isMoveEnd()

Returns whether the unit is done moving.


waitMoveEnd

void unit->waitMoveEnd()

Waits until the unit is done moving.


moveTo

void unit->moveTo(int unk, float x, float y, float z, float angle = 360, int a6 = 0, bool a7 = false, bool a8 = false)

Moves to a specific point.


moveToRun

void unit->moveToRun(int unk, float x, float y, float z, float angle = 360, int a6 = 0, bool a7 = false, bool a8 = false)

Runs to a specific point.


moveToWalk

void unit->moveToWalk(int unk, float x, float y, float z, float angle = 360, int a6 = 0, bool a7 = false, bool a8 = false)

Walks to a specific point.


moveToSpd

void unit->moveToSpd(float speed)

Sets the movement speed.


moveToTurnSpd

void unit->moveToTurnSpd(float speed)

Sets the turning speed.


loopMotion

void unit->loopMotion(int type)

Sets the looping motion.


corpMotion

void unit->corpMotion(int unk, int unk2, int unk3)

Unknown. Values appears to be the same as loop motion (types).


isTalk

bool unit->isTalk()

⚠ Dummy function.


winTalk

void unit->winTalk(int id)

Opens a talking balloon with the specified message id.


winTalk2

void unit->winTalk2(string script, int messageItem)

Opens a talking balloon with the specified message (V2).


holdTalk

void unit->holdTalk(bool hold)

Whether to hold talk.


holdTalk

void unit->holdTalk(bool hold = true)

Whether to hold talk.


winAutoTalk

bool unit->winAutoTalk()

⚠ Dummy function.


onEvent

bool unit->onEvent()

Returns whether the unit is currently on an event.


onEventAutoTalk

bool unit->onEventAutoTalk()

⚠ Dummy function.


winTalkSelect

int unit->winTalkSelect()

Gets the selected auto talk balloon option index.


winTalkToSimpleEve

void unit->winTalkToSimpleEve(int id)

Unknown. Might summon a script.


setAct

void unit->setAct(int id, float speed = nil)

Sets the current action.


setActDirect

void unit->setActDirect(int id, float speed = nil)

Sets the current direct action.


setActSpd

void unit->setActSpd(float speed = nil)

Sets the current action speed.


lookAt

void unit->lookAt(oc other, bool maybeUnused = false, bool enableSpine = true, bool bodyLink = false, bool BF1IKMode = true, bool BF1ZIKMode = false)

Looks at another unit.


turn

void unit->turn(int angle, bool unk = false)

Turns.


setPcNpcWeapon

void unit->setPcNpcWeapon()

Unknown.


setPcNpcWeapon2

void unit->setPcNpcWeapon2()

Unknown.


getTargetOC

oc unit->getTargetOC()

Gets the current targetted oc for this unit.


getTargetOC

int unit->getTargetID()

⚠ Dummy function.


isPC

bool unit->isPC()

Returns whether the current unit is a playable character.


isNPC

bool unit->isNPC()

Returns whether the current unit is a NPC.


isENE

bool unit->isENE()

Returns whether the current unit is an enemy.


isPT

bool unit->isPT()

⚠ Dummy function.


invin

void unit->invin(bool invincible)

⚠ Dummy function.


setBtlState

void unit->setBtlState(int state, int time = 0, int val1 = 0, int val2 = 0, int interval = 0)

Sets a battle state.


clearBtlState

void unit->clearBtlState(int state)

Clears a battle state.


setColi

void unit->setColi(bool collision)

Sets collision status.


setEye

void unit->setEye(int unk)

⚠ Dummy function.


setGravity

void unit->setGravity(bool gravity)

Sets gravity mode.


setDyRstOff

void unit->setDyRstOff(bool unk)

⚠ Dummy function.


dispHighlight

void unit->dispHighlight(bool dispHighlight)

Whether to display highlight.


setRot

void unit->setRot(float x, float y, float z)

Sets unit rotation.


setKiriEff

void unit->setKiriEff(int unk = 0)

Unknown.