BF2.US bf2-rsdeveloper wiki Parity Discord bf2.us
generated from the code
On this page

Objects (omgr_)

3 functions of the host module. Generated from the bf2-rs sources; see the reference index for the cross-game table.

omgr_getObjectsOfType#

BF22142Heroes
python
host.omgr_getObjectsOfType(typeName)
FactDetail
Arguments (as parsed)s@0
Returnstuple(host.Object)
ErrorsTypeError (wrong arg type),missing arg,"unknown object type"
Original codebf2_w32ded.exe!0x00535c00, BF2.exe!0x005929d0, BFHeroes.exe (1.89)!0x0066f705
bf2-rscrates/bf2-server/src/hostfns.rs:504

What it does (from the original code). Class id from DAT_00892d58 vt+0x28(name,&id); on failure sets RuntimeError but still builds and returns the (empty) tuple. Objects from ObjectManager (DAT_0089ae48) vt+0x34 whose template class id matches.

Shipped scripts use it like this:

BF2: python/bf2/ObjectManager.py:9
return host.omgr_getObjectsOfType(type)
2142: python/bf2/ObjectManager.py:9
return host.omgr_getObjectsOfType(type)
Heroes: python/bf2/ObjectManager.py:9
return host.omgr_getObjectsOfType(type)

omgr_getObjectsOfTemplate#

BF22142Heroes
python
host.omgr_getObjectsOfTemplate(templateName)
FactDetail
Arguments (as parsed)s@0
Returnstuple(host.Object)
ErrorsTypeError (wrong arg type),missing arg
Original codebf2_w32ded.exe!0x00535cc0, BF2.exe!0x00592ad0, BFHeroes.exe (1.89)!0x0066f7a8
bf2-rscrates/bf2-server/src/hostfns.rs:520

What it does (from the original code). Lower-cases name (0x0040c250); objects whose lower-cased template name equals it.

Shipped scripts use it like this:

BF2: python/bf2/ObjectManager.py:12
return host.omgr_getObjectsOfTemplate(templ)
2142: python/bf2/ObjectManager.py:12
return host.omgr_getObjectsOfTemplate(templ)
Heroes: python/bf2/ObjectManager.py:12
return host.omgr_getObjectsOfTemplate(templ)

omgr_getNetworkId#

Heroes
python
host.omgr_getNetworkId(...)
FactDetail
Original codeBFHeroes.exe (1.89)!0x0066ef0c
bf2-rscrates/bfh-server/src/lib.rs:417

What it does (from the bf2-rs port). host.Object.getNetworkId(obj) (BFHeroes.exe!0x0066e530): argObject(0), the networkable's id, 0 without one. host.omgr_getNetworkId(obj) (BFHeroes.exe!0x0066ef0c) is the same except that it returns NULL with no exception set when the object has no networkable (Python's SystemError).

Shipped scripts use it like this:

Heroes: python/bf2/ObjectManager.py:23
return host.omgr_getNetworkId(object)
Source: tools/devwiki/refs_python.py · built from bf2-rs e3b4f05 · part of the Battlefield 2 / 2142 / Heroes reimplementation. Not affiliated with EA or DICE.