Hi Esenthel,
Ahhh that explains it. I did not even think of that, but yes, that fixed it in the tutorials. How do the character controllers see the HM then if it is not loaded in correctly; the character is not walking through the terrain?
Actually, my real problem was not the tutorials, I just used those to see I I had the right approach or not. I created a brand new world and loaded it in with
Code:
Game.World.New(WorldID);
from there i was trying to use Game.World.hmHeight but always getting 0.000.
I tried everything to be able to get the height at a point, with no success. At what point does the HM get initialized? I am doing this all at the init() phase of Main.
Here are some of the things i tried
Setting the area states manually to every state possible with
Code:
Game.World.mode(Game.WORLD_MANUAL);
Memc<Game.WorldManager.AreaState> areastates;
areastates.New().set(a, Game.AREA_ACTIVE);
Game.World.areaSetState(areastates);
Game.Area* the_area = Game.World.areaActive(a);
I tried getting the actual HM from the area, but this crashed
Code:
the_area.data().height().pixel(hx, hy)
At first I though that my world was not loaded correctly but things like the_area.state() and Game.world.areaSize() and Game.World.areaActive(a) all seem to return the correct results. I just can't get the hmHeight for some reason.
Thanks again for your quick response and any additional insight you or anybody else has would be awesome!
**EDIT**
Also, i just tried the_area.getData().height().is() and it returned false so it does seem like the HM has not been loaded. Not sure when that happens though or how to force it. Essentially, i am just trying to read the HM data from the world I created in the editor. Maybe there is an easier way to do that then all the ways I have tried above.