existential crisis in csqc
Moderator: InsideQC Admins
2 posts
• Page 1 of 1
existential crisis in csqc
Since the stats are limited in darkplaces I decided to use entities to replace that information I need in csqc.
so
1-i spawn a temp entity in ssqc with some data and i send it to csqc
2- I use that data to display images in player GUI
2- the entity is deleted in csqc and ssqc
this works very well, but as you will immediately notice the problem: that data is used by all players!! Then I felt like an idiot when I saw that in multiplayer all the players were shown messages on the screen.
In csqc_updateview i have
And the "draw2d" is what does the work (the work of display images in screen). I thought about assigning an owner to that entity, but this is possible? i mean
1-the entity spawns in ssqc with a player as "owner" and is sent to csqc
2- ONLY the player-owner of the entity can use that data
It is possible?
What I want to do, basically it is to use entities in csqc but that only affect one player, the original owner in ssqc of those entities.
thank you very much
so
1-i spawn a temp entity in ssqc with some data and i send it to csqc
2- I use that data to display images in player GUI
2- the entity is deleted in csqc and ssqc
this works very well, but as you will immediately notice the problem: that data is used by all players!! Then I felt like an idiot when I saw that in multiplayer all the players were shown messages on the screen.
In csqc_updateview i have
- Code: Select all
entity e;
e = self;
for(self = world; (self = nextent(self)); )
if(self.draw2d)
self.draw2d();
self = e;
And the "draw2d" is what does the work (the work of display images in screen). I thought about assigning an owner to that entity, but this is possible? i mean
1-the entity spawns in ssqc with a player as "owner" and is sent to csqc
2- ONLY the player-owner of the entity can use that data
It is possible?
What I want to do, basically it is to use entities in csqc but that only affect one player, the original owner in ssqc of those entities.
thank you very much
hi, I am nahuel, I love quake and qc.
-
Nahuel - Posts: 492
- Joined: Wed Jan 12, 2011 8:42 pm
- Location: mar del plata
Re: existential crisis in csqc
if you don't care about splitscreen (which dp doesn't support anyway) then you can just use drawonlytoclient and only that player will receive a copy of the ent. alternatively you can tweak the return value of your .SendEntity function, which does similar but with more control.
or you can network the .colormap field and compare that to player_localentnum in your csqc (which is one way to deal with splitscreen properly).
alternatively use writebytes. DP has no proper svc so you'll need to either hack tempentities to parse it, or to send it via stuffcmds. both of which can be sent using reliables without needing to depend on SendEntity callbacks at some vaguely defined later time.
and do you really have 256 player-specific stats?
why can you not compress them a little?
or you can network the .colormap field and compare that to player_localentnum in your csqc (which is one way to deal with splitscreen properly).
alternatively use writebytes. DP has no proper svc so you'll need to either hack tempentities to parse it, or to send it via stuffcmds. both of which can be sent using reliables without needing to depend on SendEntity callbacks at some vaguely defined later time.
and do you really have 256 player-specific stats?

why can you not compress them a little?
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest