To answer you A_Gris and all future people interested in getting static objects paired with dynamic world working in Ineisis Online. Ozmodian does an awesome job at explaining the solution to this and I want to thank him for taking the time to do so.
There are a few things that had to be revised to get this working for me and I want to share with everyone.
First things first. Game.ObjMemx -> Game.ObjMap
Secondly, I want to point out the 2 main differences it made for it to work.
*Adding*
Code:
Physics.create(EE_PHYSX_DLL_PATH, CSS_FREEZE_XZ).timestep(PHYS_TIMESTEP_VARIABLE);
directly after
Code:
ParticlesCache.mode(CACHE_DUMMY_NULL);
inside of Ineisis Server/Main.cpp
*Changing*
Code:
areastates.New().set(a, Game.AREA_LOAD);
to
Code:
areastates.New().set(a, Game.AREA_INACTIVE);
Ineisis Server/Load Static.cpp
Code:
class CustomStatic : Game :: Static
{
Game.ObjParams obj;
void create(Game.ObjParams &obj)
{
super.create(obj);
T.obj = obj;
}
C UID get_ID()
{
if (&obj)
return obj.base().id();
return UIDZero;
}
~CustomStatic()
{
obj.del();
}
CustomStatic(){};
}
Ineisis Server/World.cpp
Code:
void LoadEditorWorld(C UID &world_id)
{
Net.World &world = *Net.Worlds(world_id);
Game.ObjMap<CustomStatic> Items;
Game.ObjMap<CustomStatic> iTrees;
Game.World.mode(Game.WORLD_MANUAL);
Game.World.setObjType(Items, OBJ_STATIC)
.setObjType(iTrees, OBJ_TREE)
.New(EditorWorld);
int areas = Areas + 1;
for(int x=-areas; x<areas; x++)
for(int y=-areas; y<areas; y++)
{
VecI2 a(x, y);
Memc<Game.WorldManager.AreaState> areastates;
areastates.New().set(a, Game.AREA_INACTIVE);
Game.World.areaSetState(areastates, true); // setting true will unload all other areas, no wasted memory.
Game.Area *the_area = Game.World.areaLoaded(a);
Area *data = GetArea(world, VecI2(x, y));
Image &temp_image = the_area.getData().height;
RectI ah = RectI(VecI2(0, 0), VecI2(HmRes+1, HmRes+1)); // area heightmap
for(int hy=ah.min.y; hy<=ah.max.y; hy++) // iterate area heightmap
for(int hx=ah.min.x; hx<=ah.max.x; hx++)
data.heightmap.setHeight(hx, hy, (the_area.data().height.pixelFLinear(hx, hy)+128)); // set the custom HM to be equal to the value of the Editor HM
if(Items.elms())
{
REPA(Items)
{
VecI local(Items[i].pos().x, Items[i].pos().y, Items[i].pos().z);
SetObj(&world, local, Items[i].matrix().angle(), Items[i].get_ID());
}
}
if(iTrees.elms())
{
REPA(iTrees)
{
VecI local(iTrees[i].pos().x, iTrees[i].pos().y, iTrees[i].pos().z);
SetGroundObj(&world, local, iTrees[i].matrix().angle(), iTrees[i].get_ID());
}
}
}
Game.World.del(); // **If needed for objects, remove this*** Delete it after loading since it is no longer needed
}
Ineisis Server/World.cpp
Code:
void InitWorld()
{
Net.Worlds.replaceClass<World>();
SetWorldAreas();
LoadWorld(MainWorldID);
LoadEditorWorld(MainWorldID);
}
Shared/Constants.cpp - Insert after MainWorldID
Code:
const UID EditorWorld = UID(2821025862, 1169992174, 276167868, 3494657711);
100% working as of today with all up-to-date sources
Thanks and Enjoy