Forum

New guy alert! Custom key values?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

New guy alert! Custom key values?

Postby Willem » Wed Jan 30, 2008 11:23 am

This is probably obvious but here goes...

I'm getting my feet wet in QuakeC lately and I'm wondering if it's possible to read custom key/values from the entity? Like if I define a custom combo:

"mykey" "123"

Can I get that value out somehow when I'm in QuakeC? What is the function call I would use?
Willem
 
Posts: 73
Joined: Wed Jan 23, 2008 10:58 am

Postby Spike » Wed Jan 30, 2008 12:18 pm

.float mykey;

then read mykey to find out what the mapper stored in it.
At load time the engine looks for the field with that name and stores its value into it. Its just a regular field.

Don't create too many special fields for every single different sort of entity because the field takes memory for every single entity (in dp thats up to 4*32767=128kb of memory per new field). Also don't make the names too long because qbsp has entity segment limits too (depends on the compiler).
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Willem » Wed Jan 30, 2008 1:25 pm

Ahh OK, that makes sense then. Thanks!
Willem
 
Posts: 73
Joined: Wed Jan 23, 2008 10:58 am


Return to QuakeC Programming

Who is online

Users browsing this forum: Bing [Bot] and 1 guest