Forum

Confusing error with FTEQCC...

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Confusing error with FTEQCC...

Postby drm_wayne » Fri Oct 19, 2012 5:26 am

Hi,

i have added a function to the frikbots to select a weaponclass i added to my mod...
it compiled fine with FrikQC but not with FTEQCC, FTEQCC give me this errormessage:

in function botConnect (line 132),
frikbot/bot.qc:728: error: "=" - not a name

The code looks like this and is inside bot.qc in botconnect....

Code: Select all
local float class;

   class = ceil(random() * 10);

   if (class == 1)
      self.impulse = 120;
   else if (class == 2)
      self.impulse = 121;
   else if (class == 3)
      self.impulse = 122;
   else if (class == 4)
      self.impulse = 123;
   else if (class == 5)
      self.impulse = 124;
   else if (class == 6)
      self.impulse = 125;
   else if (class == 7)
      self.impulse = 126;
   else if (class == 8)
      self.impulse = 127;
   else if (class == 9)
      self.impulse = 128;
   else
      self.impulse = 129;
   
   PreImpulse();




Did i anything wrong? it works with FrikQC, an the bots are getting their class but i need FTEQCC for some things like the vweapon code...

Thanks and greetings :D
User avatar
drm_wayne
 
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm

Re: Confusing error with FTEQCC...

Postby wjbr » Fri Oct 19, 2012 9:44 am

Class is a keyword in FTEQCC.

line: 445

http://git.xonotic.org/?p=xonotic/fteqc ... 638b90f3ab

Change it to something else and it will work.

Code: Select all
    local float bot_class;

   bot_class = ceil(random() * 10);

   if (bot_class == 1)
      self.impulse = 120;
   else if (bot_class == 2)
      self.impulse = 121;
   else if (bot_class == 3)
      self.impulse = 122;
   else if (bot_class == 4)
      self.impulse = 123;
   else if (bot_class == 5)
      self.impulse = 124;
   else if (bot_class == 6)
      self.impulse = 125;
   else if (bot_class == 7)
      self.impulse = 126;
   else if (bot_class == 8)
      self.impulse = 127;
   else if (bot_class == 9)
      self.impulse = 128;
   else
      self.impulse = 129;
   
   PreImpulse();
wjbr
 
Posts: 2
Joined: Sat Oct 06, 2012 12:57 am

Re: Confusing error with FTEQCC...

Postby drm_wayne » Fri Oct 19, 2012 12:29 pm

ahh thanks for the link :)
renamed then now... I just switched to FTEQCC 2 months ago, only worked with frikqcc before 8)
User avatar
drm_wayne
 
Posts: 232
Joined: Sat Feb 11, 2012 5:47 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest