View previous topic :: View next topic |
Author |
Message |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Mon Mar 10, 2008 2:53 pm Post subject: 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? _________________ Look out for Twigboy |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Mon Mar 10, 2008 4:26 pm Post subject: |
|
|
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). _________________ What's a signature? |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Mon Mar 10, 2008 7:40 pm Post subject: |
|
|
Ah, well that works for me! _________________ Look out for Twigboy |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Mon Mar 17, 2008 12:24 pm Post subject: |
|
|
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? _________________ Look out for Twigboy |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Mon Mar 17, 2008 5:49 pm Post subject: |
|
|
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 _________________ What's a signature? |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Tue Mar 18, 2008 2:16 pm Post subject: |
|
|
/me curses the grace period
Why does it exist? _________________ Look out for Twigboy |
|
Back to top |
|
 |
frag.machine

Joined: 25 Nov 2006 Posts: 728
|
Posted: Tue Mar 18, 2008 11:04 pm Post subject: |
|
|
From what I remember to avoid problems with interpolation I guess. _________________ frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/ |
|
Back to top |
|
 |
|