ValveSoftware / source-sdk-2013

The 2013 edition of the Source SDK
https://developer.valvesoftware.com/wiki/SDK2013_GettingStarted
Other
3.77k stars 2k forks source link

Spawning Particles Server Side #432

Closed Mine228 closed 7 years ago

Mine228 commented 7 years ago

So I'm trying to spawn a particle system on the server side using the multiplayer code base, but it doesn't seem to be doing anything. If I remember correctly when I was working on the single player branch, you needed to include particle_parse.h into the server code and it should work, but it doesn't seem to be the case for multiplayer, or perhaps no longer. So I was wondering is there a way to spawn particle systems through the server side or is the code broken or something?

BerntA commented 7 years ago

You can still use DispatchParticleEffect in MP, however sometimes if you spawn stuff on the server you need to call: IPredictionSystem::SuppressHostEvents(NULL); before dispatching the particle, due to prediction preventing the player who initially called the dispatch from seeing it. (Assuming it was created client side/or shared code)

Mine228 commented 7 years ago

Oh, now I remember this. But I also remember that when using this command the game seems to start glitching out, like emitting particle effects 2 times and some other visual glitching.

Mine228 commented 7 years ago

Well, I've tried calling my desired code right after I set the suppressed entity to null and then reset it back to "this". And it seems to work. I'm just hoping this wont have any glitching at some point. But for now I guess it will have to do. Thanks for the tip.

kisak-valve commented 7 years ago

Hello @Mince228, I'm going to close this as your issue appears to be resolved. If this is not the case let me know and I can re-open this issue report.