Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Objects not always fully removed from client-side. #291

Closed
Stuyk opened this issue Sep 22, 2022 · 6 comments
Closed

Objects not always fully removed from client-side. #291

Stuyk opened this issue Sep 22, 2022 · 6 comments

Comments

@Stuyk
Copy link
Owner

Stuyk commented Sep 22, 2022

This bug is really difficult to reproduce; but also fix. We've tried dozens of solutions with no fix in sight.

The simplest way to reproduce the bug is to give yourself a full inventory of single items.

Drop all of the items in one place.

Then pick them all back up.

If reproduced correctly you will see 1 object with no text label above it.

@OlegGulevskyy
Copy link

OlegGulevskyy commented Sep 23, 2022

I had the same issue when created a "farming" kind of system, where you spawn objects randomly in different pos on the map and a player has to interact with the object. Once interacted - object gets removed. Each object has label, interaction point and object model itself.
Sometimes, absolutely randomly, label and interactions get destroyed but the object remains. So it awfully sounds like the issue described, meaning it's not directly linked to an implementation of an inventory but something more underlying than that.
p.s. haven't found any solution though, unfortunately

@Stuyk
Copy link
Owner Author

Stuyk commented Sep 23, 2022

@OlegGulevskyy Yea. It's a very strange but. I've tried investigating it for a long time and have rewritten object streamers and all sorts of things in hopes it would resolve the issue; but I think the only solution that is left is waiting for the alt:V Object API to come out of the dev branch. Until then this sits in the backlog.

@gotgameio
Copy link
Contributor

gotgameio commented Oct 12, 2022

@Stuyk Xm, i had same issue in one of my plugins. Object didn't removed from world after calling all of natives which can delete entity, i even tried copy natives from streamer remove method, object was still there, and actually only 1 of 10 objects weren't removed while the others were removed fine all the time.
To fix this i actually had to call setEntityVisible after entity deletion, may be this will help in this case? Because i didnt used any athena function, clean natives from altv, i think issue may be not related to athena at all.

game.setEntityVisible(entity, false, false);

@Stuyk
Copy link
Owner Author

Stuyk commented Oct 12, 2022

@gotgameio Definitely not a great solution since all you're doing is hiding the object. Eventually client-side will run out objects and hit limitations because they're simply hidden and not fully deleted.

@gotgameio
Copy link
Contributor

@gotgameio Definitely not a great solution since all you're doing is hiding the object. Eventually client-side will run out objects and hit limitations because they're simply hidden and not fully deleted.

I think if we hide entity after we delete it successfully isn't it a problem? If there is only one entity left which somewhy not being deleted we can hide it as i did for such case? i mean hidding deleted entity will not cause some limitations problem cause its deleted and for last one limit will reach only with big entity spawn delete each second i think or no?

@Stuyk
Copy link
Owner Author

Stuyk commented Dec 12, 2022

The alt.Object api is now available on client-side. Just need to convert the object streamer over to utilize it.

@Stuyk Stuyk closed this as completed Mar 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants