Problem with CSQC
Moderator: InsideQC Admins
5 posts
• Page 1 of 1
Problem with CSQC
I released this modified csqc HUD in quakeone.com http://quakeone.com/forums/quake-mod-releases/finished-works/7189-custom-hud-csqc.html Well, now i am trying to adapt the code to the Mission pack 1 (hipnotic) but the value
"float IT_LASER_CANNON = 8388608;" doesn´t work
8388608 is a too high number for csqc??
I do not think that, really. I tested the HUD changing the values and the icon of the laser canon works, this number is problematic....
any suggestion?
Thanks in advance!
"float IT_LASER_CANNON = 8388608;" doesn´t work
8388608 is a too high number for csqc??
I do not think that, really. I tested the HUD changing the values and the icon of the laser canon works, this number is problematic....
any suggestion?
Thanks in advance!
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: Problem with CSQC
I did find the solution with my hipnotic´s HUD
, making strange things and codes, I do not know why these float doesn´t work!!!!!!!!
hi, I am nahuel, I love quake and qc.
-

Nahuel - Posts: 492
- Joined: Wed Jan 12, 2011 8:42 pm
- Location: mar del plata
getstatbits is able to retrieve any descrete bit within an integer stat (STAT_ITEMS is such a stat as the engine merges .items with .items2 or serverflags) to get a full 32bit int value.
floats are unable to hold a full 32bit integer value without forgetting parts of it. getstatbits can do bit shifts on the original int before giving a float result to csqc.
if the engine can see it, getstatbits can retrieve it.
floats are unable to hold a full 32bit integer value without forgetting parts of it. getstatbits can do bit shifts on the original int before giving a float result to csqc.
if the engine can see it, getstatbits can retrieve it.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Spike wrote: (STAT_ITEMS is such a stat as the engine merges .items with .items2 or serverflags)
thank you Spike, I have another problem.... hipnotic uses "item2".
I really need to use the "float STAT_ITEMS2" ??
.¿what number i can use for this?
Aniway I think that what you said, I do not need to use a new "STAT" but the STAT_ITEMS doesn´t work with items2 in my csqc. You know "HIP_IT_WETSUIT" it´s not a "item", it is a "item2".
any suggestion ?
Thanks!
hi, I am nahuel, I love quake and qc.
-

Nahuel - Posts: 492
- Joined: Wed Jan 12, 2011 8:42 pm
- Location: mar del plata
like I said, getstatbits.
From csqctest:
items = getstatbits(STAT_ITEMS, 0, 23);
items2 = getstatbits(STAT_ITEMS, 23, 9);
side note:
if a mod doesn't define items2, then the upper bits contain the runes instead, thus
serverflags = getstatbits(STAT_ITEMS, 28, 4);
of course, it'll reveal only the lower 4 bits, which is sufficient for the 4 runes in quake.
Due to the way it gets munged together, (self.items & (1<<23)) is effectively the same as (self.items2 & 1) at least as far as csqc can tell.
It should be safe enough to just do:
items = getstatbits(STAT_ITEMS, 0, 24);
instead, however, more bits will degrade the fpu precision and give strange results if you pick up a wetsuit.
Note that it is for a reason that mods are not able to munge additional fields together to form unholy monsters like STAT_ITEMS, and thus getstatbits should only be used for STAT_ITEMS.
From csqctest:
items = getstatbits(STAT_ITEMS, 0, 23);
items2 = getstatbits(STAT_ITEMS, 23, 9);
side note:
if a mod doesn't define items2, then the upper bits contain the runes instead, thus
serverflags = getstatbits(STAT_ITEMS, 28, 4);
of course, it'll reveal only the lower 4 bits, which is sufficient for the 4 runes in quake.
Due to the way it gets munged together, (self.items & (1<<23)) is effectively the same as (self.items2 & 1) at least as far as csqc can tell.
It should be safe enough to just do:
items = getstatbits(STAT_ITEMS, 0, 24);
instead, however, more bits will degrade the fpu precision and give strange results if you pick up a wetsuit.
Note that it is for a reason that mods are not able to munge additional fields together to form unholy monsters like STAT_ITEMS, and thus getstatbits should only be used for STAT_ITEMS.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest