Issue with bmap_for_entity [SOLVED]

Posted By: Dooley

Issue with bmap_for_entity [SOLVED] - 06/27/19 05:22

UPDATE:This was not a problem with bmap_for_entity, but a problem with not setting the level_ent min_x/max_x correctly. See below for more details.



In my previous version of the game (A7) I was able to use bmap_for_entity to display a VIEW onto a model skin.

Now with A8, it works sporadically. It will usually work the first time I load a level, but if I leave and return to it, then the bitmap will appear black for a long time. Sometimes it "kicks in" and starts working after a few moments.

I got one error that said "Error E1516: Invalid memory area" but this does not happen every time, even when the problem appears.

This problem happens in both the published game and when run through WED.

Any ideas or similar experiences would be helpful, I do not really know where to look for a solution (other than the manual of course) but so far I have not been able to find anything that can explain it.
Posted By: Dooley

Re: Issue with bmap_for_entity - 06/27/19 06:39

In addition to this, sometimes the whole screen seems to freeze. However, panels with variable readouts still update while the view is frozen, so it's like the camera is not updating, but the game is not frozen...
Posted By: txesmi

Re: Issue with bmap_for_entity - 06/27/19 09:30

Hi, I would use 'ent_getskin' instead.

Code
_cam.bmap = ent_getskin(_ent, 1); //set the first skin of '_ent' as render target of '_cam'
Posted By: Dooley

Re: Issue with bmap_for_entity - 06/27/19 15:53

Nice! I will try this to see if it makes a difference.
Posted By: Dooley

Re: Issue with bmap_for_entity - 06/27/19 16:01

Having the same issue this way. I am thinking of re-writing the whole script for this object. A lot of this stuff is like 6 years old...
Posted By: Dooley

Re: Issue with bmap_for_entity [SOLVED] - 06/27/19 17:28

I have figured it out. I had a similar error when I first upgraded to A8. When I turned my spaceship too far in either direction, the screen would go black. I fixed it by setting the level_ent size to maximum dimensions:

Code
vec_set(level_ent.min_x, vector(-999999, -999999, -999999));
vec_set(level_ent.max_x, vector(999999, 999999, 999999));


So in this latest case, the screen was not going black, but apparently "freezing" so I did not recognize it as the same problem.

It turns out that when I load my space level from the main menu, it uses one function, but when I load the same level when returning from a planet, it uses a different function. This second function did not include the level_ent command, so the same problem was happening. I'm not sure why it presented a frozen screen instead of a black one, but I don't really care now that it's working laugh

Glad it is solved!
© 2024 lite-C Forums