structs in qc?
Moderator: InsideQC Admins
5 posts
• Page 1 of 1
structs in qc?
Hey, i was just messing around with my code and tested for fun to see how would fteqccgui like structs. It actually allowed me to initialize both typedef struct's and structs. also allowed me to put strings and floats in them. And it compiled fine. But when i tried to use them. Well got error something about Opcode.
Is this just half finished feature or am i doing something wrong here?
Is this just half finished feature or am i doing something wrong here?
- Jukki
- Posts: 214
- Joined: Wed Apr 07, 2010 4:59 am
Re: structs in qc?
Are you using FTEQW or Darkplaces to run your code ?
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
Re: structs in qc?
well, dakplaces and proquake psp
and the error comes from the compiler, not ingame
and the error comes from the compiler, not ingame
- Jukki
- Posts: 214
- Joined: Wed Apr 07, 2010 4:59 am
Re: structs in qc?
fteqcc supports structs, but DP/proquake don't support the extra opcodes required to actually make proper use of them.
#pragma target fte
will tell fteqcc that its okay to generate potentially incompatible code.
#pragma target id
will tell fteqcc that its no longer okay to generate those extra opcodes.
which means that you can have parts of a mod that use extended opcodes while other parts do not, but the qc coder has to ensure that incompatible engines (ie: everything other than FTE) does not execute the extension code because they'll crash if they do.
#pragma target fte
will tell fteqcc that its okay to generate potentially incompatible code.
#pragma target id
will tell fteqcc that its no longer okay to generate those extra opcodes.
which means that you can have parts of a mod that use extended opcodes while other parts do not, but the qc coder has to ensure that incompatible engines (ie: everything other than FTE) does not execute the extension code because they'll crash if they do.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: structs in qc?
ooh, nice. I gues it wont be easy to add thouse opcodes to otherengines (at least for noob like me)
- Jukki
- Posts: 214
- Joined: Wed Apr 07, 2010 4:59 am
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest