• PostPlayerDraw question/help.
    4 replies, posted
So I've been playing around with a few cosmetic items, such as showing a backpack when people have items in there inventory and such. No plans, just learning how the system works currently. But it appears that I can't think of a way to remove these client side models whenever the player is no longer been drawn, be it from teleporting or disconnecting etc. I was after a way of detecting IF the player can still be drawn? I mean I can hook disconnects and deaths and such, but no sure fired way to detect if they can be drawn still.
-snip-
Entity:Visible() might be what you are looking for. That checks the PVS visibility, not line of sight. Basically "could I be rendering this" for the entity. What I did to render items was to put all entities whom have cosmetic items and put them into a table. You check if those entities are no longer valid with an EntityRemoved hook, if they aren't remove all associated entities. Then I checked about every second or so if the entities in that table had left the PVS, if not I disabled the "updating" code of the entity and made it RenderMode none until it returns into the client's PVS, in which is is made visible and updates again.
[QUOTE=OzymandiasJ;42372130]Entity:Visible() might be what you are looking for. That checks the PVS visibility, not line of sight. Basically "could I be rendering this" for the entity. What I did to render items was to put all entities whom have cosmetic items and put them into a table. You check if those entities are no longer valid with an EntityRemoved hook, if they aren't remove all associated entities. Then I checked about every second or so if the entities in that table had left the PVS, if not I disabled the "updating" code of the entity and made it RenderMode none until it returns into the client's PVS, in which is is made visible and updates again.[/QUOTE] Hmm, I thought of a similar method using a timer. I'm normally against repeated timers like this but 1 or 2 in client side code wouldn't hurt ;).
[QUOTE=Pantho;42372612]Hmm, I thought of a similar method using a timer. I'm normally against repeated timers like this but 1 or 2 in client side code wouldn't hurt ;).[/QUOTE] I would actually really love a hook like "EntityLeftPVS" or something.
Sorry, you need to Log In to post a reply to this thread.