-
Hey Saul; sorry to bug you with this rabbit hole - do you know if there's an event or something I could track to catch when players destroy items like windows or vases etc? I was hoping one of 🙇♂️ |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hi @n1c Could you record a really small demo where the only thing that you do is break a prop, and then upload it to this issue? Thanks |
Beta Was this translation helpful? Give feedback.
-
So it looks like vases (in Inferno at least) are client-side props, and so aren't networked at all. On the other hand, breakable surfaces like windows (that break completely when shot) can be determined by listening for entity deletion, and checking if the entity's model name starts with a demoFile.entities.on('beforeremove', e => {
if (e.entity.modelName[0] != '*')
return;
console.log('Breakable brush broken!');
}); However you won't be able to determine who broke it - unfortunately that isn't something that is networked either. |
Beta Was this translation helpful? Give feedback.
-
Great, thanks so much for taking a look! So does that mean (and please excuse my ignorance) that when re-watching a demo the game engine would just be looking at where people are shooting to determine if a vase/window is shot all in the client? |
Beta Was this translation helpful? Give feedback.
-
So the game client definitely knows to break the props, even if a bot is the one that shoots them. I still can't figure out how as I can't see it networked at all. I think the game client may be simulating each player around it (e.g. doing the shot client-side, seeing what it collides with, and breaking any props, as you suggest). Window breaks are not client-only - the window is removed from the gameworld and 'broken glass' tempents are spawned. The library support tempents, but unfortunately you're not able to determine who broke the window. |
Beta Was this translation helpful? Give feedback.
So the game client definitely knows to break the props, even if a bot is the one that shoots them. I still can't figure out how as I can't see it networked at all.
I think the game client may be simulating each player around it (e.g. doing the shot client-side, seeing what it collides with, and breaking any props, as you suggest).
Window breaks are not client-only - the window is removed from the gameworld and 'broken glass' tempents are spawned. The library support tempents, but unfortunately you're not able to determine who broke the window.