Skip to content

Engine API Quick Reference

Home | Engine API Quick Reference


Tartalomjegyzek


Entitas metodusok

Teljes referencia: 6.1. fejezet: Entitas rendszer

Pozicio es orientacio (Object)

MetodusSzignaturaLeiras
GetPositionvector GetPosition()Vilagpozicio
SetPositionvoid SetPosition(vector pos)Vilagpozicio beallitasa
GetOrientationvector GetOrientation()Elfordulas (yaw, pitch, roll) fokban
SetOrientationvoid SetOrientation(vector ori)Elfordulas beallitasa (yaw, pitch, roll)
GetDirectionvector GetDirection()Elore mutato iranyvektor
SetDirectionvoid SetDirection(vector dir)Elore mutato irany beallitasa
GetScalefloat GetScale()Jelenlegi meret
SetScalevoid SetScale(float scale)Meret beallitasa

Transzformacio (IEntity)

MetodusSzignaturaLeiras
GetOriginvector GetOrigin()Vilagpozicio (engine szint)
SetOriginvoid SetOrigin(vector orig)Vilagpozicio beallitasa (engine szint)
GetYawPitchRollvector GetYawPitchRoll()Forgatas yaw/pitch/roll formaban
GetTransformvoid GetTransform(out vector mat[4])Teljes 4x3 transzformacios matrix
SetTransformvoid SetTransform(vector mat[4])Teljes transzformacio beallitasa
VectorToParentvector VectorToParent(vector vec)Lokalis irany vilagkoordinataba
CoordToParentvector CoordToParent(vector coord)Lokalis pont vilagkoordinataba
VectorToLocalvector VectorToLocal(vector vec)Vilag irany lokalis koordinataba
CoordToLocalvector CoordToLocal(vector coord)Vilag pont lokalis koordinataba

Hierarchia (IEntity)

MetodusSzignaturaLeiras
AddChildvoid AddChild(IEntity child, int pivot, bool posOnly = false)Gyermek csatolasa csonthoz
RemoveChildvoid RemoveChild(IEntity child, bool keepTransform = false)Gyermek levalasztasa
GetParentIEntity GetParent()Szulo entitas vagy null
GetChildrenIEntity GetChildren()Elso gyermek entitas
GetSiblingIEntity GetSibling()Kovetkezo testver entitas

Megjelenito informaciok (Object)

MetodusSzignaturaLeiras
GetTypestring GetType()Konfiguracios osztalynev (pl. "AKM")
GetDisplayNamestring GetDisplayName()Lokalizalt megjeleno nev
IsKindOfbool IsKindOf(string type)Konfiguracios oroklodes ellenorzese

Csontpoziciok (Object)

MetodusSzignaturaLeiras
GetBonePositionLSvector GetBonePositionLS(int pivot)Csontpozicio lokalis terben
GetBonePositionMSvector GetBonePositionMS(int pivot)Csontpozicio modellterben
GetBonePositionWSvector GetBonePositionWS(int pivot)Csontpozicio vilagterben

Konfiguracio hozzaferes (Object)

MetodusSzignaturaLeiras
ConfigGetBoolbool ConfigGetBool(string entry)Bool olvasasa konfiguraciobol
ConfigGetIntint ConfigGetInt(string entry)Int olvasasa konfiguraciobol
ConfigGetFloatfloat ConfigGetFloat(string entry)Float olvasasa konfiguraciobol
ConfigGetStringstring ConfigGetString(string entry)String olvasasa konfiguraciobol
ConfigGetTextArrayvoid ConfigGetTextArray(string entry, out TStringArray values)String tomb olvasasa
ConfigIsExistingbool ConfigIsExisting(string entry)Konfiguracios bejegyzes letezese

Elet es sebzes

Teljes referencia: 6.1. fejezet: Entitas rendszer

MetodusSzignaturaLeiras
GetHealthfloat GetHealth(string zone, string type)Elet ertek lekerdezese
GetMaxHealthfloat GetMaxHealth(string zone, string type)Maximalis elet lekerdezese
SetHealthvoid SetHealth(string zone, string type, float value)Elet beallitasa
SetHealthMaxvoid SetHealthMax(string zone, string type)Maximumra allitas
AddHealthvoid AddHealth(string zone, string type, float value)Elet hozzaadasa
DecreaseHealthvoid DecreaseHealth(string zone, string type, float value, bool auto_delete = false)Elet csokkentese
SetAllowDamagevoid SetAllowDamage(bool val)Sebzes engedelyezese/tiltasa
GetAllowDamagebool GetAllowDamage()Sebzes engedelyezett-e
IsAlivebool IsAlive()Eletellenorzes (EntityAI-n hasznald)
ProcessDirectDamagevoid ProcessDirectDamage(int dmgType, EntityAI source, string component, string ammoType, vector modelPos, float coef = 1.0, int flags = 0)Sebzes alkalmazasa (EntityAI)

Gyakori zona/tipus parok: ("", "Health") globalis, ("", "Blood") jatekos ver, ("", "Shock") jatekos sokk, ("Engine", "Health") jarmu motor.


Tipusellenorzes

MetodusOsztalyLeiras
IsMan()ObjectEz jatekos?
IsBuilding()ObjectEz epulet?
IsTransport()ObjectEz jarmu?
IsDayZCreature()ObjectEz leny (zombi/allat)?
IsKindOf(string)ObjectKonfiguracios oroklodes ellenorzese
IsItemBase()EntityAIEz inventar targy?
IsWeapon()EntityAIEz fegyver?
IsMagazine()EntityAIEz tar?
IsClothing()EntityAIEz ruha?
IsFood()EntityAIEz etel?
Class.CastTo(out, obj)ClassBiztonsagos lefele tipuskenyszerites (bool-t ad vissza)
ClassName.Cast(obj)ClassInline tipuskenyszerites (null-t ad vissza sikertelen esetben)

Inventar

Teljes referencia: 6.1. fejezet: Entitas rendszer

MetodusSzignaturaLeiras
GetInventoryGameInventory GetInventory()Inventar komponens lekerdezese (EntityAI)
CreateInInventoryEntityAI CreateInInventory(string type)Targy letrehozasa cargoban
CreateEntityInCargoEntityAI CreateEntityInCargo(string type)Targy letrehozasa cargoban
CreateAttachmentEntityAI CreateAttachment(string type)Targy letrehozasa csatolmanykent
EnumerateInventoryvoid EnumerateInventory(int traversal, out array<EntityAI> items)Osszes targy listazasa
CountInventoryint CountInventory()Targyak szama
HasEntityInInventorybool HasEntityInInventory(EntityAI item)Targy ellenorzese
AttachmentCountint AttachmentCount()Csatolmanyok szama
GetAttachmentFromIndexEntityAI GetAttachmentFromIndex(int idx)Csatolmany lekerdezese index alapjan
FindAttachmentByNameEntityAI FindAttachmentByName(string slot)Csatolmany lekerdezese slot alapjan

Entitas letrehozas es torles

Teljes referencia: 6.1. fejezet: Entitas rendszer

MetodusSzignaturaLeiras
CreateObjectObject GetGame().CreateObject(string type, vector pos, bool local = false, bool ai = false, bool physics = true)Entitas letrehozasa
CreateObjectExObject GetGame().CreateObjectEx(string type, vector pos, int flags, int rotation = RF_DEFAULT)Letrehozas ECE flagekkel
ObjectDeletevoid GetGame().ObjectDelete(Object obj)Azonnali szerveren torteno torles
ObjectDeleteOnClientvoid GetGame().ObjectDeleteOnClient(Object obj)Csak kliens oldali torles
Deletevoid obj.Delete()Halasztott torles (kovetkezo frame)

Gyakori ECE flagek

FlagErtekLeiras
ECE_NONE0Nincs specialis viselkedes
ECE_CREATEPHYSICS1024Utkozes letrehozasa
ECE_INITAI2048AI inicializalasa
ECE_EQUIP24576Letrehozas csatolmanyokkal + cargo
ECE_PLACE_ON_SURFACEkombinaltFizika + utvonal + kovetelmeny
ECE_LOCAL1073741824Csak kliens (nem replikalt)
ECE_NOLIFETIME4194304Nem tunik el
ECE_KEEPHEIGHT524288Y pozicio megtartasa

Jatekos metodusok

Teljes referencia: 6.1. fejezet: Entitas rendszer

MetodusSzignaturaLeiras
GetIdentityPlayerIdentity GetIdentity()Jatekos identitas objektum
GetIdentity().GetName()string GetName()Steam/platform megjeleno nev
GetIdentity().GetId()string GetId()BI egyedi azonosito
GetIdentity().GetPlainId()string GetPlainId()Steam64 ID
GetIdentity().GetPlayerId()int GetPlayerId()Munkamenet jatekos ID
GetHumanInventory().GetEntityInHands()EntityAI GetEntityInHands()Kezben tartott targy
GetDrivingVehicleEntityAI GetDrivingVehicle()Vezetett jarmu
IsAlivebool IsAlive()Eletellenorzes
IsUnconsciousbool IsUnconscious()Eszmeletlen ellenorzes
IsRestrainedbool IsRestrained()Megkotozott ellenorzes
IsInVehiclebool IsInVehicle()Jarmuben van-e ellenorzes
SpawnEntityOnGroundOnCursorDirEntityAI SpawnEntityOnGroundOnCursorDir(string type, float dist)Letrehozas a jatekos elott

Jarmu metodusok

Teljes referencia: 6.2. fejezet: Jarmu rendszer

Szemelyzet (Transport)

MetodusSzignaturaLeiras
CrewSizeint CrewSize()Osszes ulesszam
CrewMemberHuman CrewMember(int idx)Ember lekerdezese az ulesen
CrewMemberIndexint CrewMemberIndex(Human member)Ember ulesszama
CrewGetOutvoid CrewGetOut(int idx)Kenyszeritett kiszallas
CrewDeathvoid CrewDeath(int idx)Szemelyzet tag megolese

Motor (Car)

MetodusSzignaturaLeiras
EngineIsOnbool EngineIsOn()Jar a motor?
EngineStartvoid EngineStart()Motor inditas
EngineStopvoid EngineStop()Motor leallitas
EngineGetRPMfloat EngineGetRPM()Jelenlegi fordulatszam
EngineGetRPMRedlinefloat EngineGetRPMRedline()Piros zona fordulatszam
GetGearint GetGear()Jelenlegi sebessegfokozat
GetSpeedometerfloat GetSpeedometer()Sebesseg km/h-ban

Folyadékok (Car)

MetodusSzignaturaLeiras
GetFluidCapacityfloat GetFluidCapacity(CarFluid fluid)Maximalis kapacitas
GetFluidFractionfloat GetFluidFraction(CarFluid fluid)Toltottsegi szint 0.0-1.0
Fillvoid Fill(CarFluid fluid, float amount)Folyadek hozzaadasa
Leakvoid Leak(CarFluid fluid, float amount)Folyadek eltavolitasa
LeakAllvoid LeakAll(CarFluid fluid)Osszes folyadek leeresztese

CarFluid enum: FUEL, OIL, BRAKE, COOLANT

Vezerles (Car)

MetodusSzignaturaLeiras
SetBrakevoid SetBrake(float value, int wheel = -1)0.0-1.0, -1 = mind
SetHandbrakevoid SetHandbrake(float value)0.0-1.0
SetSteeringvoid SetSteering(float value, bool analog = true)Kormanyzas bemenet
SetThrustvoid SetThrust(float value, int wheel = -1)0.0-1.0 gaz

Idojaras metodusok

Teljes referencia: 6.3. fejezet: Idojaras rendszer

Hozzaferes

MetodusSzignaturaLeiras
GetGame().GetWeather()Weather GetWeather()Idojaras singleton lekerdezese

Jelensegek (Weather)

MetodusSzignaturaLeiras
GetOvercastWeatherPhenomenon GetOvercast()Felhozet
GetRainWeatherPhenomenon GetRain()Eso
GetFogWeatherPhenomenon GetFog()Kod
GetSnowfallWeatherPhenomenon GetSnowfall()Havazas
GetWindMagnitudeWeatherPhenomenon GetWindMagnitude()Szelsebesseg
GetWindDirectionWeatherPhenomenon GetWindDirection()Szelirany
GetWindvector GetWind()Szelirany vektor
GetWindSpeedfloat GetWindSpeed()Szelsebesseg m/s
SetStormvoid SetStorm(float density, float threshold, float timeout)Villam konfiguracio

WeatherPhenomenon

MetodusSzignaturaLeiras
GetActualfloat GetActual()Jelenlegi interpolalt ertek
GetForecastfloat GetForecast()Cel ertek
GetDurationfloat GetDuration()Hatralevo idotartam (masodpercben)
Setvoid Set(float forecast, float time = 0, float minDuration = 0)Cel beallitasa (csak szerver)
SetLimitsvoid SetLimits(float min, float max)Ertekhatar korlatok
SetTimeLimitsvoid SetTimeLimits(float min, float max)Valtozasi sebesseg korlatok
SetChangeLimitsvoid SetChangeLimits(float min, float max)Valtozas mertek korlatok

Fajl I/O metodusok

Teljes referencia: 6.8. fejezet: Fajl I/O es JSON

Utvonal prefixek

PrefixHelyIrhato
$profile:Szerver/kliens profil konyvtarIgen
$saves:Mentes konyvtarIgen
$mission:Jelenlegi misszio mappaAltalaban csak olvasas
$CurrentDir:MunkaskonyvtarFugg

Fajlmuveletek

MetodusSzignaturaLeiras
FileExistbool FileExist(string path)Fajl letezik-e
MakeDirectorybool MakeDirectory(string path)Konyvtar letrehozasa
OpenFileFileHandle OpenFile(string path, FileMode mode)Fajl megnyitasa (0 = sikertelen)
CloseFilevoid CloseFile(FileHandle fh)Fajl bezarasa
FPrintvoid FPrint(FileHandle fh, string text)Szoveg irasa (ujsor nelkul)
FPrintlnvoid FPrintln(FileHandle fh, string text)Szoveg irasa + ujsor
FGetsint FGets(FileHandle fh, string line)Egy sor olvasasa
ReadFilestring ReadFile(FileHandle fh)Teljes fajl olvasasa
DeleteFilebool DeleteFile(string path)Fajl torlese
CopyFilebool CopyFile(string src, string dst)Fajl masolasa

JSON (JsonFileLoader)

MetodusSzignaturaLeiras
JsonLoadFilevoid JsonFileLoader<T>.JsonLoadFile(string path, T obj)JSON betoltese objektumba (void-ot ad vissza)
JsonSaveFilevoid JsonFileLoader<T>.JsonSaveFile(string path, T obj)Objektum mentese JSON-kent

FileMode enum

ErtekLeiras
FileMode.READMegnyitas olvasasra
FileMode.WRITEMegnyitas irasra (letrehozza/felulirja)
FileMode.APPENDMegnyitas hozzafuzesre

Timer es CallQueue metodusok

Teljes referencia: 6.7. fejezet: Idozitok es CallQueue

Hozzaferes

KifejezesVisszateresi ertekLeiras
GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY)ScriptCallQueueJatekmenet hivasi sor
GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM)ScriptCallQueueRendszer hivasi sor
GetGame().GetCallQueue(CALL_CATEGORY_GUI)ScriptCallQueueGUI hivasi sor
GetGame().GetUpdateQueue(CALL_CATEGORY_GAMEPLAY)ScriptInvokerFramenkenti frissitesi sor

ScriptCallQueue

MetodusSzignaturaLeiras
CallLatervoid CallLater(func fn, int delay = 0, bool repeat = false, param1..4)Kesleltetett/ismetlodo hivas utemezese
Callvoid Call(func fn, param1..4)Vegrehajtas a kovetkezo frame-ben
CallByNamevoid CallByName(Class obj, string fnName, int delay = 0, bool repeat = false, Param par = null)Metodus hivasa nev alapjan
Removevoid Remove(func fn)Utemezett hivas torlese
RemoveByNamevoid RemoveByName(Class obj, string fnName)Torles nev alapjan
GetRemainingTimefloat GetRemainingTime(Class obj, string fnName)CallLater hatralevo ideje

Timer osztaly

MetodusSzignaturaLeiras
Timer()void Timer(int category = CALL_CATEGORY_SYSTEM)Konstruktor
Runvoid Run(float duration, Class obj, string fnName, Param params = null, bool loop = false)Timer inditasa
Stopvoid Stop()Timer megallitasa
Pausevoid Pause()Timer szuneteltetese
Continuevoid Continue()Timer folytatas
IsPausedbool IsPaused()Timer szunetel?
IsRunningbool IsRunning()Timer aktiv?
GetRemainingfloat GetRemaining()Hatralevo masodpercek

ScriptInvoker

MetodusSzignaturaLeiras
Insertvoid Insert(func fn)Callback regisztralasa
Removevoid Remove(func fn)Callback torlese
Invokevoid Invoke(params...)Osszes callback hivasa
Countint Count()Regisztralt callbackok szama
Clearvoid Clear()Osszes callback eltavolitasa

Widget letrehozo metodusok

Teljes referencia: 3.5. fejezet: Programozott letrehozas

MetodusSzignaturaLeiras
GetGame().GetWorkspace()WorkspaceWidget GetWorkspace()UI munkaterulet lekerdezese
CreateWidgetsWidget CreateWidgets(string layout, Widget parent = null).layout fajl betoltese
FindAnyWidgetWidget FindAnyWidget(string name)Gyermek keresese nev alapjan (rekurziv)
Showvoid Show(bool show)Widget megjelenitese/elrejtese
SetTextvoid TextWidget.SetText(string text)Szoveges tartalom beallitasa
SetImagevoid ImageWidget.SetImage(int index)Kep index beallitasa
SetColorvoid SetColor(int color)Widget szin beallitasa (ARGB)
SetAlphavoid SetAlpha(float alpha)Atlatszosag beallitasa 0.0-1.0
SetSizevoid SetSize(float x, float y, bool relative = false)Widget meret beallitasa
SetPosvoid SetPos(float x, float y, bool relative = false)Widget pozicio beallitasa
GetScreenSizevoid GetScreenSize(out float x, out float y)Kepernyo felbontas
Destroyvoid Widget.Destroy()Widget eltavolitasa es megsemmisitese

ARGB szin segedo

FuggvenySzignaturaLeiras
ARGBint ARGB(int a, int r, int g, int b)Szin letrehozasa (0-255 mindegyik)
ARGBFint ARGBF(float a, float r, float g, float b)Szin letrehozasa (0.0-1.0 mindegyik)

RPC / halozati metodusok

Teljes referencia: 6.9. fejezet: Halozat es RPC

Kornyezet ellenorzesek

MetodusSzignaturaLeiras
GetGame().IsServer()bool IsServer()True a szerveren / listen-server gazdagepe
GetGame().IsClient()bool IsClient()True a kliensen
GetGame().IsMultiplayer()bool IsMultiplayer()True tobbszereployos modban
GetGame().IsDedicatedServer()bool IsDedicatedServer()True csak dedikalt szerveren

ScriptRPC

MetodusSzignaturaLeiras
ScriptRPC()void ScriptRPC()Konstruktor
Writebool Write(void value)Ertek szerializalasa (int, float, bool, string, vector, array)
Sendvoid Send(Object target, int rpc_type, bool guaranteed, PlayerIdentity recipient = null)RPC kuldese
Resetvoid Reset()Beirt adatok torlese

Fogadas (Override az Object-en)

MetodusSzignaturaLeiras
OnRPCvoid OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)RPC fogadasi handler

ParamsReadContext

MetodusSzignaturaLeiras
Readbool Read(out void value)Ertek deszerializalasa (ugyanazok a tipusok mint Write)

Regebbi RPC (CGame)

MetodusSzignaturaLeiras
RPCSingleParamvoid GetGame().RPCSingleParam(Object target, int rpc, Param param, bool guaranteed, PlayerIdentity recipient = null)Egyetlen Param objektum kuldese
RPCvoid GetGame().RPC(Object target, int rpc, array<Param> params, bool guaranteed, PlayerIdentity recipient = null)Tobb Param objektum kuldese

ScriptInputUserData (ellenorzott bemenet)

MetodusSzignaturaLeiras
CanStoreInputUserDatabool ScriptInputUserData.CanStoreInputUserData()Van-e hely a sorban
Writebool Write(void value)Ertek szerializalasa
Sendvoid Send()Kuldes a szerverre (csak kliens)

Matematikai konstansok es metodusok

Teljes referencia: 1.7. fejezet: Matematika es vektorok

Konstansok

KonstansErtekLeiras
Math.PI3.14159...Pi
Math.PI26.28318...2 * Pi
Math.PI_HALF1.57079...Pi / 2
Math.DEG2RAD0.01745...Fok-radian szorzo
Math.RAD2DEG57.2957...Radian-fok szorzo
int.MAX2147483647Maximalis int
int.MIN-2147483648Minimalis int
float.MAX3.4028e+38Maximalis float
float.MIN1.175e-38Minimalis pozitiv float

Veletlen

MetodusSzignaturaLeiras
Math.RandomIntint RandomInt(int min, int max)Veletlen int [min, max)
Math.RandomIntInclusiveint RandomIntInclusive(int min, int max)Veletlen int [min, max]
Math.RandomFloat01float RandomFloat01()Veletlen float [0, 1]
Math.RandomBoolbool RandomBool()Veletlen true/false

Kerekites

MetodusSzignaturaLeiras
Math.Roundfloat Round(float f)Kerekites a legkozelebbire
Math.Floorfloat Floor(float f)Lefele kerekites
Math.Ceilfloat Ceil(float f)Felfele kerekites

Szukites es interpolacio

MetodusSzignaturaLeiras
Math.Clampfloat Clamp(float val, float min, float max)Szukites tartomanyra
Math.Minfloat Min(float a, float b)Ketto minimuma
Math.Maxfloat Max(float a, float b)Ketto maximuma
Math.Lerpfloat Lerp(float a, float b, float t)Linearis interpolacio
Math.InverseLerpfloat InverseLerp(float a, float b, float val)Inverz lerp

Abszolut ertek es hatvany

MetodusSzignaturaLeiras
Math.AbsFloatfloat AbsFloat(float f)Abszolut ertek (float)
Math.AbsIntint AbsInt(int i)Abszolut ertek (int)
Math.Powfloat Pow(float base, float exp)Hatvanyozas
Math.Sqrtfloat Sqrt(float f)Negyzetgyok
Math.SqrFloatfloat SqrFloat(float f)Negyzet (f * f)

Trigonometria (radian)

MetodusSzignaturaLeiras
Math.Sinfloat Sin(float rad)Szinusz
Math.Cosfloat Cos(float rad)Koszinusz
Math.Tanfloat Tan(float rad)Tangens
Math.Asinfloat Asin(float val)Arkusz szinusz
Math.Acosfloat Acos(float val)Arkusz koszinusz
Math.Atan2float Atan2(float y, float x)Szog osszetevokbol

Sima csillapitas

MetodusSzignaturaLeiras
Math.SmoothCDfloat SmoothCD(float val, float target, inout float velocity, float smoothTime, float maxSpeed, float dt)Siman csillapit a cel fele (mint Unity SmoothDamp)
c
// Sima csillapitas hasznalata
// val: jelenlegi ertek, target: cel ertek, velocity: ref sebesseg (hivasok kozott megorzott)
// smoothTime: simitas ideje, maxSpeed: sebesseg korlat, dt: delta ido
float m_Velocity = 0;
float result = Math.SmoothCD(current, target, m_Velocity, 0.3, 1000.0, dt);

Szog

MetodusSzignaturaLeiras
Math.NormalizeAnglefloat NormalizeAngle(float deg)Normalizalas 0-360 tartomanyra

Vektor metodusok

MetodusSzignaturaLeiras
vector.Distancefloat Distance(vector a, vector b)Tavolsag ket pont kozott
vector.DistanceSqfloat DistanceSq(vector a, vector b)Tavolsag negyzete (gyorsabb)
vector.Directionvector Direction(vector from, vector to)Iranyvektor
vector.Dotfloat Dot(vector a, vector b)Skalaris szorzat
vector.Lerpvector Lerp(vector a, vector b, float t)Poziciok interpolacioja
v.Length()float Length()Vektor nagysaga
v.LengthSq()float LengthSq()Nagysag negyzete (gyorsabb)
v.Normalized()vector Normalized()Egysevektor
v.VectorToAngles()vector VectorToAngles()Irany yaw/pitch-re
v.AnglesToVector()vector AnglesToVector()Yaw/pitch iranyra
v.Multiply3vector Multiply3(vector mat[3])Matrix szorzas
v.InvMultiply3vector InvMultiply3(vector mat[3])Inverz matrix szorzas
Vector(x, y, z)vector Vector(float x, float y, float z)Vektor letrehozasa

Globalis fuggvenyek

FuggvenySzignaturaLeiras
GetGame()CGame GetGame()Jatek peldany
GetGame().GetPlayer()Man GetPlayer()Lokalis jatekos (csak KLIENS)
GetGame().GetPlayers(out arr)void GetPlayers(out array<Man> arr)Osszes jatekos (szerver)
GetGame().GetWorld()World GetWorld()Vilag peldany
GetGame().GetTickTime()float GetTickTime()Szerver ido (masodpercben)
GetGame().GetWorkspace()WorkspaceWidget GetWorkspace()UI munkaterulet
GetGame().SurfaceY(x, z)float SurfaceY(float x, float z)Terep magassag a pozicion
GetGame().SurfaceGetType(x, z)string SurfaceGetType(float x, float z)Felszini anyag tipusa
GetGame().GetObjectsAtPosition(pos, radius, objects, proxyCargo)void GetObjectsAtPosition(vector pos, float radius, out array<Object> objects, out array<CargoBase> proxyCargo)Objektumok keresese pozicio kornyeken
GetScreenSize(w, h)void GetScreenSize(out int w, out int h)Kepernyo felbontas lekerdezese
GetGame().IsServer()bool IsServer()Szerver ellenorzes
GetGame().IsClient()bool IsClient()Kliens ellenorzes
GetGame().IsMultiplayer()bool IsMultiplayer()Tobbszereployos ellenorzes
Print(string)void Print(string msg)Iras a script logba
ErrorEx(string)void ErrorEx(string msg, ErrorExSeverity sev = ERROR)Hiba logolasa sulyossagi szinttel
DumpStackString()string DumpStackString()Hivasverem lekerdezese stringkent
string.Format(fmt, ...)string Format(string fmt, ...)String formatazas (%1..%9)

Misszio hookok

Teljes referencia: 6.11. fejezet: Misszio hookok

Szerver oldal (modded MissionServer)

MetodusLeiras
override void OnInit()Menedzserek inicializalasa, RPC regisztralasa
override void OnMissionStart()Miutan minden mod betoltodott
override void OnUpdate(float timeslice)Framenkenti (hasznalj akkumulatort!)
override void OnMissionFinish()Singletonok takaritasa, esemenyek leregisztralasa
override void OnEvent(EventType eventTypeId, Param params)Chat, hang esemenyek
override void InvokeOnConnect(PlayerBase player, PlayerIdentity identity)Jatekos csatlakozott
override void InvokeOnDisconnect(PlayerBase player)Jatekos killepett
override void OnClientReadyEvent(int peerId, PlayerIdentity identity)Kliens kesz az adatokra
override void PlayerRegistered(int peerId)Identitas regisztralva

Kliens oldal (modded MissionGameplay)

MetodusLeiras
override void OnInit()Kliens menedzserek inicializalasa, HUD letrehozasa
override void OnUpdate(float timeslice)Framenkenti kliens frissites
override void OnMissionFinish()Takaritas
override void OnKeyPress(int key)Billentyu lenyomva
override void OnKeyRelease(int key)Billentyu elengedve

Akcio rendszer

Teljes referencia: 6.12. fejezet: Akcio rendszer

Akciok regisztralasa egy targyra

c
override void SetActions()
{
    super.SetActions();
    AddAction(MyAction);           // Egyeni akcio hozzaadasa
    RemoveAction(ActionEat);       // Vanilla akcio eltavolitasa
}

ActionBase fontos metodusok

MetodusLeiras
override void CreateConditionComponents()CCINone/CCTNone tavolsagi feltetelek beallitasa
override bool ActionCondition(...)Egyeni validacios logika
override void OnExecuteServer(ActionData action_data)Szerver oldali vegrehajtas
override void OnExecuteClient(ActionData action_data)Kliens oldali effektek
override string GetText()Megjeleno nev (#STR_ kulcsokat tamogat)

Teljes dokumentacio: Fooldal | Puska | Entitas rendszer | Jarmuvek | Idojaras | Idozitok | Fajl I/O | Halozat | Misszio hookok | Akcio rendszer

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