Skip to content

Engine API Quick Reference

Home | Engine API Quick Reference


目次


エンティティメソッド

完全なリファレンス: 第6.1章: エンティティシステム

位置と向き (Object)

メソッドシグネチャ説明
GetPositionvector GetPosition()ワールド座標
SetPositionvoid SetPosition(vector pos)ワールド座標を設定
GetOrientationvector GetOrientation()ヨー、ピッチ、ロール(度数)
SetOrientationvoid SetOrientation(vector ori)ヨー、ピッチ、ロールを設定
GetDirectionvector GetDirection()前方方向ベクトル
SetDirectionvoid SetDirection(vector dir)前方方向を設定
GetScalefloat GetScale()現在のスケール
SetScalevoid SetScale(float scale)スケールを設定

トランスフォーム (IEntity)

メソッドシグネチャ説明
GetOriginvector GetOrigin()ワールド座標(エンジンレベル)
SetOriginvoid SetOrigin(vector orig)ワールド座標を設定(エンジンレベル)
GetYawPitchRollvector GetYawPitchRoll()ヨー/ピッチ/ロールとしての回転
GetTransformvoid GetTransform(out vector mat[4])完全な 4x3 トランスフォーム行列
SetTransformvoid SetTransform(vector mat[4])トランスフォームを設定
VectorToParentvector VectorToParent(vector vec)ローカル方向をワールドに変換
CoordToParentvector CoordToParent(vector coord)ローカル座標をワールドに変換
VectorToLocalvector VectorToLocal(vector vec)ワールド方向をローカルに変換
CoordToLocalvector CoordToLocal(vector coord)ワールド座標をローカルに変換

階層構造 (IEntity)

メソッドシグネチャ説明
AddChildvoid AddChild(IEntity child, int pivot, bool posOnly = false)ボーンに子をアタッチ
RemoveChildvoid RemoveChild(IEntity child, bool keepTransform = false)子をデタッチ
GetParentIEntity GetParent()親エンティティまたは null
GetChildrenIEntity GetChildren()最初の子エンティティ
GetSiblingIEntity GetSibling()次の兄弟エンティティ

表示情報 (Object)

メソッドシグネチャ説明
GetTypestring GetType()config クラス名(例: "AKM"
GetDisplayNamestring GetDisplayName()ローカライズされた表示名
IsKindOfbool IsKindOf(string type)config 継承のチェック

ボーン位置 (Object)

メソッドシグネチャ説明
GetBonePositionLSvector GetBonePositionLS(int pivot)ローカル空間でのボーン位置
GetBonePositionMSvector GetBonePositionMS(int pivot)モデル空間でのボーン位置
GetBonePositionWSvector GetBonePositionWS(int pivot)ワールド空間でのボーン位置

Config アクセス (Object)

メソッドシグネチャ説明
ConfigGetBoolbool ConfigGetBool(string entry)config から bool を読み取り
ConfigGetIntint ConfigGetInt(string entry)config から int を読み取り
ConfigGetFloatfloat ConfigGetFloat(string entry)config から float を読み取り
ConfigGetStringstring ConfigGetString(string entry)config から string を読み取り
ConfigGetTextArrayvoid ConfigGetTextArray(string entry, out TStringArray values)文字列配列を読み取り
ConfigIsExistingbool ConfigIsExisting(string entry)config エントリの存在チェック

体力とダメージ

完全なリファレンス: 第6.1章: エンティティシステム

メソッドシグネチャ説明
GetHealthfloat GetHealth(string zone, string type)体力値を取得
GetMaxHealthfloat GetMaxHealth(string zone, string type)最大体力を取得
SetHealthvoid SetHealth(string zone, string type, float value)体力を設定
SetHealthMaxvoid SetHealthMax(string zone, string type)最大値に設定
AddHealthvoid AddHealth(string zone, string type, float value)体力を加算
DecreaseHealthvoid DecreaseHealth(string zone, string type, float value, bool auto_delete = false)体力を減少
SetAllowDamagevoid SetAllowDamage(bool val)ダメージの有効/無効
GetAllowDamagebool GetAllowDamage()ダメージ許可の確認
IsAlivebool IsAlive()生存チェック(EntityAI で使用)
ProcessDirectDamagevoid ProcessDirectDamage(int dmgType, EntityAI source, string component, string ammoType, vector modelPos, float coef = 1.0, int flags = 0)ダメージを適用(EntityAI)

よく使われる zone/type の組み合わせ: ("", "Health") グローバル、("", "Blood") プレイヤーの血液量、("", "Shock") プレイヤーのショック値、("Engine", "Health") 車両エンジン。


型チェック

メソッドクラス説明
IsMan()Objectプレイヤーかどうか
IsBuilding()Object建物かどうか
IsTransport()Object車両かどうか
IsDayZCreature()Objectクリーチャー(ゾンビ/動物)かどうか
IsKindOf(string)Objectconfig 継承のチェック
IsItemBase()EntityAIインベントリアイテムかどうか
IsWeapon()EntityAI武器かどうか
IsMagazine()EntityAIマガジンかどうか
IsClothing()EntityAI衣類かどうか
IsFood()EntityAI食料かどうか
Class.CastTo(out, obj)Class安全なダウンキャスト(bool を返します)
ClassName.Cast(obj)Classインラインキャスト(失敗時は null を返します)

インベントリ

完全なリファレンス: 第6.1章: エンティティシステム

メソッドシグネチャ説明
GetInventoryGameInventory GetInventory()インベントリコンポーネントを取得(EntityAI)
CreateInInventoryEntityAI CreateInInventory(string type)カーゴにアイテムを生成
CreateEntityInCargoEntityAI CreateEntityInCargo(string type)カーゴにアイテムを生成
CreateAttachmentEntityAI CreateAttachment(string type)アタッチメントとしてアイテムを生成
EnumerateInventoryvoid EnumerateInventory(int traversal, out array<EntityAI> items)全アイテムをリスト
CountInventoryint CountInventory()アイテム数をカウント
HasEntityInInventorybool HasEntityInInventory(EntityAI item)アイテムの存在チェック
AttachmentCountint AttachmentCount()アタッチメント数
GetAttachmentFromIndexEntityAI GetAttachmentFromIndex(int idx)インデックスでアタッチメントを取得
FindAttachmentByNameEntityAI FindAttachmentByName(string slot)スロット名でアタッチメントを取得

エンティティの生成と削除

完全なリファレンス: 第6.1章: エンティティシステム

メソッドシグネチャ説明
CreateObjectObject GetGame().CreateObject(string type, vector pos, bool local = false, bool ai = false, bool physics = true)エンティティを生成
CreateObjectExObject GetGame().CreateObjectEx(string type, vector pos, int flags, int rotation = RF_DEFAULT)ECE フラグ付きで生成
ObjectDeletevoid GetGame().ObjectDelete(Object obj)サーバー側の即時削除
ObjectDeleteOnClientvoid GetGame().ObjectDeleteOnClient(Object obj)クライアント側のみの削除
Deletevoid obj.Delete()遅延削除(次フレーム)

主要な ECE フラグ

フラグ説明
ECE_NONE0特別な動作なし
ECE_CREATEPHYSICS1024コリジョンを生成
ECE_INITAI2048AI を初期化
ECE_EQUIP24576アタッチメント + カーゴ付きでスポーン
ECE_PLACE_ON_SURFACEcombined物理 + パス + トレース
ECE_LOCAL1073741824クライアントのみ(レプリケートされません)
ECE_NOLIFETIME4194304デスポーンしません
ECE_KEEPHEIGHT524288Y 座標を維持

プレイヤーメソッド

完全なリファレンス: 第6.1章: エンティティシステム

メソッドシグネチャ説明
GetIdentityPlayerIdentity GetIdentity()プレイヤー識別オブジェクト
GetIdentity().GetName()string GetName()Steam/プラットフォーム表示名
GetIdentity().GetId()string GetId()BI 固有 ID
GetIdentity().GetPlainId()string GetPlainId()Steam64 ID
GetIdentity().GetPlayerId()int GetPlayerId()セッションプレイヤー ID
GetHumanInventory().GetEntityInHands()EntityAI GetEntityInHands()手に持っているアイテム
GetDrivingVehicleEntityAI GetDrivingVehicle()運転中の車両
IsAlivebool IsAlive()生存チェック
IsUnconsciousbool IsUnconscious()意識不明チェック
IsRestrainedbool IsRestrained()拘束チェック
IsInVehiclebool IsInVehicle()車両内チェック
SpawnEntityOnGroundOnCursorDirEntityAI SpawnEntityOnGroundOnCursorDir(string type, float dist)プレイヤーの前方にスポーン

車両メソッド

完全なリファレンス: 第6.2章: 車両システム

乗員 (Transport)

メソッドシグネチャ説明
CrewSizeint CrewSize()総座席数
CrewMemberHuman CrewMember(int idx)座席の人物を取得
CrewMemberIndexint CrewMemberIndex(Human member)人物の座席を取得
CrewGetOutvoid CrewGetOut(int idx)座席から強制排出
CrewDeathvoid CrewDeath(int idx)乗員を死亡させる

エンジン (Car)

メソッドシグネチャ説明
EngineIsOnbool EngineIsOn()エンジン稼働中か
EngineStartvoid EngineStart()エンジン始動
EngineStopvoid EngineStop()エンジン停止
EngineGetRPMfloat EngineGetRPM()現在の RPM
EngineGetRPMRedlinefloat EngineGetRPMRedline()レッドライン RPM
GetGearint GetGear()現在のギア
GetSpeedometerfloat GetSpeedometer()速度(km/h)

流体 (Car)

メソッドシグネチャ説明
GetFluidCapacityfloat GetFluidCapacity(CarFluid fluid)最大容量
GetFluidFractionfloat GetFluidFraction(CarFluid fluid)充填レベル 0.0-1.0
Fillvoid Fill(CarFluid fluid, float amount)流体を追加
Leakvoid Leak(CarFluid fluid, float amount)流体を除去
LeakAllvoid LeakAll(CarFluid fluid)全流体を排出

CarFluid 列挙型: FUEL, OIL, BRAKE, COOLANT

コントロール (Car)

メソッドシグネチャ説明
SetBrakevoid SetBrake(float value, int wheel = -1)0.0-1.0、-1 = 全輪
SetHandbrakevoid SetHandbrake(float value)0.0-1.0
SetSteeringvoid SetSteering(float value, bool analog = true)ステアリング入力
SetThrustvoid SetThrust(float value, int wheel = -1)0.0-1.0 スロットル

天候メソッド

完全なリファレンス: 第6.3章: 天候システム

アクセス

メソッドシグネチャ説明
GetGame().GetWeather()Weather GetWeather()天候シングルトンを取得

気象現象 (Weather)

メソッドシグネチャ説明
GetOvercastWeatherPhenomenon GetOvercast()雲量
GetRainWeatherPhenomenon GetRain()
GetFogWeatherPhenomenon GetFog()
GetSnowfallWeatherPhenomenon GetSnowfall()降雪
GetWindMagnitudeWeatherPhenomenon GetWindMagnitude()風速
GetWindDirectionWeatherPhenomenon GetWindDirection()風向
GetWindvector GetWind()風方向ベクトル
GetWindSpeedfloat GetWindSpeed()風速 m/s
SetStormvoid SetStorm(float density, float threshold, float timeout)雷の設定

WeatherPhenomenon

メソッドシグネチャ説明
GetActualfloat GetActual()現在の補間値
GetForecastfloat GetForecast()目標値
GetDurationfloat GetDuration()残り時間(秒)
Setvoid Set(float forecast, float time = 0, float minDuration = 0)目標を設定(サーバーのみ)
SetLimitsvoid SetLimits(float min, float max)値の範囲制限
SetTimeLimitsvoid SetTimeLimits(float min, float max)変化速度の制限
SetChangeLimitsvoid SetChangeLimits(float min, float max)変化量の制限

ファイル I/O メソッド

完全なリファレンス: 第6.8章: ファイル I/O と JSON

パスプレフィックス

プレフィックス場所書き込み可能
$profile:サーバー/クライアントのプロファイルディレクトリはい
$saves:セーブディレクトリはい
$mission:現在のミッションフォルダ通常は読み取りのみ
$CurrentDir:作業ディレクトリ状況による

ファイル操作

メソッドシグネチャ説明
FileExistbool FileExist(string path)ファイルの存在チェック
MakeDirectorybool MakeDirectory(string path)ディレクトリを作成
OpenFileFileHandle OpenFile(string path, FileMode mode)ファイルを開く(0 = 失敗)
CloseFilevoid CloseFile(FileHandle fh)ファイルを閉じる
FPrintvoid FPrint(FileHandle fh, string text)テキストを書き込み(改行なし)
FPrintlnvoid FPrintln(FileHandle fh, string text)テキスト + 改行を書き込み
FGetsint FGets(FileHandle fh, string line)1行を読み取り
ReadFilestring ReadFile(FileHandle fh)ファイル全体を読み取り
DeleteFilebool DeleteFile(string path)ファイルを削除
CopyFilebool CopyFile(string src, string dst)ファイルをコピー

JSON (JsonFileLoader)

メソッドシグネチャ説明
JsonLoadFilevoid JsonFileLoader<T>.JsonLoadFile(string path, T obj)JSON をオブジェクトに読み込み(void を返します
JsonSaveFilevoid JsonFileLoader<T>.JsonSaveFile(string path, T obj)オブジェクトを JSON として保存

FileMode 列挙型

説明
FileMode.READ読み取り用に開く
FileMode.WRITE書き込み用に開く(作成/上書き)
FileMode.APPEND追記用に開く

タイマーと CallQueue メソッド

完全なリファレンス: 第6.7章: タイマーと CallQueue

アクセス

戻り値説明
GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY)ScriptCallQueueゲームプレイ用コールキュー
GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM)ScriptCallQueueシステム用コールキュー
GetGame().GetCallQueue(CALL_CATEGORY_GUI)ScriptCallQueueGUI 用コールキュー
GetGame().GetUpdateQueue(CALL_CATEGORY_GAMEPLAY)ScriptInvokerフレーム毎の更新キュー

ScriptCallQueue

メソッドシグネチャ説明
CallLatervoid CallLater(func fn, int delay = 0, bool repeat = false, param1..4)遅延/繰り返し呼び出しをスケジュール
Callvoid Call(func fn, param1..4)次フレームで実行
CallByNamevoid CallByName(Class obj, string fnName, int delay = 0, bool repeat = false, Param par = null)文字列名でメソッドを呼び出し
Removevoid Remove(func fn)スケジュール済み呼び出しをキャンセル
RemoveByNamevoid RemoveByName(Class obj, string fnName)文字列名でキャンセル
GetRemainingTimefloat GetRemainingTime(Class obj, string fnName)CallLater の残り時間を取得

Timer クラス

メソッドシグネチャ説明
Timer()void Timer(int category = CALL_CATEGORY_SYSTEM)コンストラクタ
Runvoid Run(float duration, Class obj, string fnName, Param params = null, bool loop = false)タイマー開始
Stopvoid Stop()タイマー停止
Pausevoid Pause()タイマー一時停止
Continuevoid Continue()タイマー再開
IsPausedbool IsPaused()一時停止中か
IsRunningbool IsRunning()実行中か
GetRemainingfloat GetRemaining()残り秒数

ScriptInvoker

メソッドシグネチャ説明
Insertvoid Insert(func fn)コールバックを登録
Removevoid Remove(func fn)コールバックを登録解除
Invokevoid Invoke(params...)全コールバックを発火
Countint Count()登録済みコールバック数
Clearvoid Clear()全コールバックを削除

Widget 生成メソッド

完全なリファレンス: 第3.5章: プログラムによる Widget 作成

メソッドシグネチャ説明
GetGame().GetWorkspace()WorkspaceWidget GetWorkspace()UI ワークスペースを取得
CreateWidgetsWidget CreateWidgets(string layout, Widget parent = null).layout ファイルを読み込み
FindAnyWidgetWidget FindAnyWidget(string name)名前で子を検索(再帰的)
Showvoid Show(bool show)Widget の表示/非表示
SetTextvoid TextWidget.SetText(string text)テキスト内容を設定
SetImagevoid ImageWidget.SetImage(int index)画像インデックスを設定
SetColorvoid SetColor(int color)Widget の色を設定(ARGB)
SetAlphavoid SetAlpha(float alpha)透明度を設定 0.0-1.0
SetSizevoid SetSize(float x, float y, bool relative = false)Widget のサイズを設定
SetPosvoid SetPos(float x, float y, bool relative = false)Widget の位置を設定
GetScreenSizevoid GetScreenSize(out float x, out float y)画面解像度
Destroyvoid Widget.Destroy()Widget を削除して破棄

ARGB カラーヘルパー

関数シグネチャ説明
ARGBint ARGB(int a, int r, int g, int b)カラー int を作成(各 0-255)
ARGBFint ARGBF(float a, float r, float g, float b)カラー int を作成(各 0.0-1.0)

RPC / ネットワーキングメソッド

完全なリファレンス: 第6.9章: ネットワーキングと RPC

環境チェック

メソッドシグネチャ説明
GetGame().IsServer()bool IsServer()サーバー / リッスンサーバーホストで true
GetGame().IsClient()bool IsClient()クライアントで true
GetGame().IsMultiplayer()bool IsMultiplayer()マルチプレイヤーで true
GetGame().IsDedicatedServer()bool IsDedicatedServer()専用サーバーでのみ true

ScriptRPC

メソッドシグネチャ説明
ScriptRPC()void ScriptRPC()コンストラクタ
Writebool Write(void value)値をシリアライズ(int, float, bool, string, vector, array)
Sendvoid Send(Object target, int rpc_type, bool guaranteed, PlayerIdentity recipient = null)RPC を送信
Resetvoid Reset()書き込みデータをクリア

受信(Object で Override)

メソッドシグネチャ説明
OnRPCvoid OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)RPC 受信ハンドラ

ParamsReadContext

メソッドシグネチャ説明
Readbool Read(out void value)値をデシリアライズ(Write と同じ型)

レガシー RPC (CGame)

メソッドシグネチャ説明
RPCSingleParamvoid GetGame().RPCSingleParam(Object target, int rpc, Param param, bool guaranteed, PlayerIdentity recipient = null)単一の Param オブジェクトを送信
RPCvoid GetGame().RPC(Object target, int rpc, array<Param> params, bool guaranteed, PlayerIdentity recipient = null)複数の Param を送信

ScriptInputUserData(入力検証付き)

メソッドシグネチャ説明
CanStoreInputUserDatabool ScriptInputUserData.CanStoreInputUserData()キューに空きがあるかチェック
Writebool Write(void value)値をシリアライズ
Sendvoid Send()サーバーに送信(クライアントのみ)

数学定数とメソッド

完全なリファレンス: 第1.7章: Math と Vector

定数

定数説明
Math.PI3.14159...円周率
Math.PI26.28318...2 * Pi
Math.PI_HALF1.57079...Pi / 2
Math.DEG2RAD0.01745...度からラジアンへの乗数
Math.RAD2DEG57.2957...ラジアンから度への乗数
int.MAX2147483647int の最大値
int.MIN-2147483648int の最小値
float.MAX3.4028e+38float の最大値
float.MIN1.175e-38float の最小正数

乱数

メソッドシグネチャ説明
Math.RandomIntint RandomInt(int min, int max)ランダム int [min, max)
Math.RandomIntInclusiveint RandomIntInclusive(int min, int max)ランダム int [min, max]
Math.RandomFloat01float RandomFloat01()ランダム float [0, 1]
Math.RandomBoolbool RandomBool()ランダム true/false

丸め

メソッドシグネチャ説明
Math.Roundfloat Round(float f)最も近い値に丸め
Math.Floorfloat Floor(float f)切り捨て
Math.Ceilfloat Ceil(float f)切り上げ

クランプと補間

メソッドシグネチャ説明
Math.Clampfloat Clamp(float val, float min, float max)範囲内にクランプ
Math.Minfloat Min(float a, float b)2つの最小値
Math.Maxfloat Max(float a, float b)2つの最大値
Math.Lerpfloat Lerp(float a, float b, float t)線形補間
Math.InverseLerpfloat InverseLerp(float a, float b, float val)逆線形補間

絶対値とべき乗

メソッドシグネチャ説明
Math.AbsFloatfloat AbsFloat(float f)絶対値(float)
Math.AbsIntint AbsInt(int i)絶対値(int)
Math.Powfloat Pow(float base, float exp)べき乗
Math.Sqrtfloat Sqrt(float f)平方根
Math.SqrFloatfloat SqrFloat(float f)二乗(f * f)

三角関数(ラジアン)

メソッドシグネチャ説明
Math.Sinfloat Sin(float rad)サイン
Math.Cosfloat Cos(float rad)コサイン
Math.Tanfloat Tan(float rad)タンジェント
Math.Asinfloat Asin(float val)アークサイン
Math.Acosfloat Acos(float val)アークコサイン
Math.Atan2float Atan2(float y, float x)成分からの角度

スムースダンピング

メソッドシグネチャ説明
Math.SmoothCDfloat SmoothCD(float val, float target, inout float velocity, float smoothTime, float maxSpeed, float dt)目標に向かってスムースにダンプ(Unity の SmoothDamp に類似)
c
// Smooth damping usage
// val: current value, target: target value, velocity: ref velocity (persisted between calls)
// smoothTime: smoothing time, maxSpeed: speed cap, dt: delta time
float m_Velocity = 0;
float result = Math.SmoothCD(current, target, m_Velocity, 0.3, 1000.0, dt);

角度

メソッドシグネチャ説明
Math.NormalizeAnglefloat NormalizeAngle(float deg)0-360 に正規化

ベクトルメソッド

メソッドシグネチャ説明
vector.Distancefloat Distance(vector a, vector b)2点間の距離
vector.DistanceSqfloat DistanceSq(vector a, vector b)2乗距離(高速)
vector.Directionvector Direction(vector from, vector to)方向ベクトル
vector.Dotfloat Dot(vector a, vector b)内積
vector.Lerpvector Lerp(vector a, vector b, float t)位置の補間
v.Length()float Length()ベクトルの大きさ
v.LengthSq()float LengthSq()2乗の大きさ(高速)
v.Normalized()vector Normalized()単位ベクトル
v.VectorToAngles()vector VectorToAngles()方向からヨー/ピッチに変換
v.AnglesToVector()vector AnglesToVector()ヨー/ピッチから方向に変換
v.Multiply3vector Multiply3(vector mat[3])行列乗算
v.InvMultiply3vector InvMultiply3(vector mat[3])逆行列乗算
Vector(x, y, z)vector Vector(float x, float y, float z)ベクトルを作成

グローバル関数

関数シグネチャ説明
GetGame()CGame GetGame()ゲームインスタンス
GetGame().GetPlayer()Man GetPlayer()ローカルプレイヤー(クライアントのみ)
GetGame().GetPlayers(out arr)void GetPlayers(out array<Man> arr)全プレイヤー(サーバー)
GetGame().GetWorld()World GetWorld()ワールドインスタンス
GetGame().GetTickTime()float GetTickTime()サーバー時間(秒)
GetGame().GetWorkspace()WorkspaceWidget GetWorkspace()UI ワークスペース
GetGame().SurfaceY(x, z)float SurfaceY(float x, float z)指定位置の地形高さ
GetGame().SurfaceGetType(x, z)string SurfaceGetType(float x, float z)地表マテリアルの種類
GetGame().GetObjectsAtPosition(pos, radius, objects, proxyCargo)void GetObjectsAtPosition(vector pos, float radius, out array<Object> objects, out array<CargoBase> proxyCargo)位置付近のオブジェクトを検索
GetScreenSize(w, h)void GetScreenSize(out int w, out int h)画面解像度を取得
GetGame().IsServer()bool IsServer()サーバーチェック
GetGame().IsClient()bool IsClient()クライアントチェック
GetGame().IsMultiplayer()bool IsMultiplayer()マルチプレイヤーチェック
Print(string)void Print(string msg)スクリプトログに書き込み
ErrorEx(string)void ErrorEx(string msg, ErrorExSeverity sev = ERROR)重要度付きでエラーをログ
DumpStackString()string DumpStackString()コールスタックを文字列で取得
string.Format(fmt, ...)string Format(string fmt, ...)文字列フォーマット(%1..%9

ミッションフック

完全なリファレンス: 第6.11章: ミッションフック

サーバーサイド (modded MissionServer)

メソッド説明
override void OnInit()マネージャーの初期化、RPC の登録
override void OnMissionStart()全 Mod 読み込み後
override void OnUpdate(float timeslice)フレーム毎(アキュムレータを使用してください)
override void OnMissionFinish()シングルトンのクリーンアップ、イベントの購読解除
override void OnEvent(EventType eventTypeId, Param params)チャット、ボイスイベント
override void InvokeOnConnect(PlayerBase player, PlayerIdentity identity)プレイヤーが参加
override void InvokeOnDisconnect(PlayerBase player)プレイヤーが離脱
override void OnClientReadyEvent(int peerId, PlayerIdentity identity)クライアントがデータ受信準備完了
override void PlayerRegistered(int peerId)アイデンティティが登録済み

クライアントサイド (modded MissionGameplay)

メソッド説明
override void OnInit()クライアントマネージャーの初期化、HUD 作成
override void OnUpdate(float timeslice)フレーム毎のクライアント更新
override void OnMissionFinish()クリーンアップ
override void OnKeyPress(int key)キーが押された
override void OnKeyRelease(int key)キーが離された

アクションシステム

完全なリファレンス: 第6.12章: アクションシステム

アイテムにアクションを登録

c
override void SetActions()
{
    super.SetActions();
    AddAction(MyAction);           // Add custom action
    RemoveAction(ActionEat);       // Remove vanilla action
}

ActionBase の主要メソッド

メソッド説明
override void CreateConditionComponents()CCINone/CCTNone 距離条件の設定
override bool ActionCondition(...)カスタム検証ロジック
override void OnExecuteServer(ActionData action_data)サーバーサイドでの実行
override void OnExecuteClient(ActionData action_data)クライアントサイドのエフェクト
override string GetText()表示名(#STR_ キーをサポート)

完全なドキュメント: ホーム | チートシート | エンティティシステム | 車両 | 天候 | タイマー | ファイル I/O | ネットワーキング | ミッションフック | アクションシステム

Released under CC BY-SA 4.0 | Code examples under MIT License