CSQC ReadEntity
Moderator: InsideQC Admins
7 posts
• Page 1 of 1
CSQC ReadEntity
There's a WriteEntity builtin in ssqc, but no ReadEntity in csqc. Does anyone know how I'm supposed to read WriteEntity calls in CSQC_Ent_Update, or is that perhaps just not possible?
I was once a Quake modder
-

Urre - Posts: 1109
- Joined: Fri Nov 05, 2004 2:36 am
- Location: Moon
ssqc doesn't expose entity numbers to the ssqc, thus it requires a writeentity.
csqc doesn't have access to the ssqc entities, thus a readentity will not always work (if its not known, you would get world, and you would not be able to re-read it).
Entities are sent as shorts, thus to read an entity, call ReadShort. it will return the entity number on the server. This can be matched to the entnum field from entities read from the server.
The ommision is intentional. Any logical behaviour would likely be too unreliable (a ReadEntityNumber builtin would make sense at least, but it would be identical to ReadShort).
csqc doesn't have access to the ssqc entities, thus a readentity will not always work (if its not known, you would get world, and you would not be able to re-read it).
Entities are sent as shorts, thus to read an entity, call ReadShort. it will return the entity number on the server. This can be matched to the entnum field from entities read from the server.
The ommision is intentional. Any logical behaviour would likely be too unreliable (a ReadEntityNumber builtin would make sense at least, but it would be identical to ReadShort).
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
I haven't been able to test my code for quite some time, as it's going through quite an overhaul with making everything work in csqc and all, so I'm trying to Do Things Right(tm) from the beginning... One thing that struck me, would this method ever fail? I'm currently having a separate entity with a think function, which assigns entities to the assigned fields on the targeted entity based on edict numbers, as it might not have turned up in csqc yet (packetloss or whatever). That's all fine, but could it possibly ever assign the wrong entity? Could it for some reason get the wrong edict number? Like perhaps, if entities are added/removed?
I was once a Quake modder
-

Urre - Posts: 1109
- Joined: Fri Nov 05, 2004 2:36 am
- Location: Moon
if an entity is removed()ed, there is a 2-second grace period where that entity will not be re-spawn()ed as something else.
So yes, its possible that your entity will come out as something else in extreeme cases, so yes, you should ensure that its the sort of entity that you meant for it to be.
The entity number itself will always be correct, but you may get the wrong instance of that entity number. :P
So yes, its possible that your entity will come out as something else in extreeme cases, so yes, you should ensure that its the sort of entity that you meant for it to be.
The entity number itself will always be correct, but you may get the wrong instance of that entity number. :P
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
From what I remember to avoid problems with interpolation I guess.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: Bing [Bot] and 1 guest