Author Topic: Some %client CityRPG error's  (Read 712 times)

Now, before any of you start flaming 'The CityRPG code is horrible and it can never be fixed', I know, and I dont care.  Thats my problem, not yours. 


The problem that's not related to that ^:
When I was editing my version of CityRPG, an error came up in one part of the code.  The 'GameConnection::setGameBottomPrint' function.  It had to do with the %client variable, specifcally the %'s inside
Code: [Select]
commandToClient(%client, 'bottomPrint', %client.CityRPGPrint, 0, true); And
Code: [Select]
return %client.CityRPGPrint;
This is a part in the function that I didn't edit. >_>

The Code and Error Markings (#):
Quote
function gameConnection::setGameBottomPrint(%client)
{
   // Font
   %mainFont = "<font:Impact:24>";
   %mainFontPosition = "<just:center>";
   %client.CityRPGPrint2 = %mainFontPosition @ %mainFont;
   
   // Money
   %client.CityRPGPrint2 = %client.CityRPGPrint2 @ "\c6Money:" SPC %client.getCashString();
   
   // Job
   if(getWord(CityRPGData.getData(%client.bl_id).valueJailData, 1))
      %jobName = "Convict";
   else if(CityRPGData.getData(%client.bl_id).valueStudent)
      %jobName = "Student" SPC %client.getJobSO().name;
   else
      %jobName = %client.getJobSO().name;
   
   %client.CityRPGPrint2 = %client.CityRPGPrint2 SPC "\c6Job: \c3" @ %jobName;
   
   // Salary
   if(CityRPGData.getData(%client.bl_id).guistyle $= "1") //Retro
   {
      if(%client.getSalary() > 0)
      {
         if(%client.brickGroup.taxes > 0)
         {
            %client.CityRPGPrint2 = %client.CityRPGPrint2 SPC "\c6Income: \c3$" @ %client.getSalary() SPC "-" SPC %client.brickGroup.taxes SPC "(Taxes)";
         }
         else
         {
            %client.CityRPGPrint2 = %client.CityRPGPrint2 SPC "\c6Income: \c3$" @ %client.getSalary();
         }
      }
   }
   else //Classic
   {
      if(%client.getSalary() > 0)
      {
         %client.CityRPGPrint2 = %client.CityRPGPrint2 SPC "\c6Income: \c3$" @ %client.getSalary();
      }
   }
   
   //Hunger
   if(CityRPGData.getData(%client.bl_id).guistyle $= "2") //Classic
   {
      %hexColor = $CityRPG::food::color[CityRPGData.getData(%client.bl_id).valueHunger];
      %hungerName = $CityRPG::food::state[CityRPGData.getData(%client.bl_id).valueHunger];
      %client.CityRPGPrint2 = %client.CityRPGPrint2 NL "\c6Hunger: <color:" @ %hexColor @ ">" @ %hungerName;
   }
   
   //Taxes
   if(CityRPGData.getData(%client.bl_id).guistyle $= "2") //Classic
   {
      if(%client.brickGroup.taxes > 0)
      {
         %client.CityRPGPrint2 = %client.CityRPGPrint2 SPC "\c6Taxes: \c3$" @ %client.brickGroup.taxes;
      }
   }
   
   //Resources
   if(CityRPGData.getData(%client.bl_id).guistyle $= "1") //Retro
   {
      %client.CityRPGPrint2Lumber = "\c6Lumber: \c3" @ (strlen(getWord(CityRPGData.getData(%client.bl_id).valueResources, 0)) > 0 ? getWord(CityRPGData.getData(%client.bl_id).valueResources, 0) : 0);
      %client.CityRPGPrint2Ore = "\c6Ore: \c3" @ (strlen(getWord(CityRPGData.getData(%client.bl_id).valueResources, 1)) > 0 ? getWord(CityRPGData.getData(%client.bl_id).valueResources, 1) : 0);
      %client.CityRPGPrint2Fish = "\c6Fish: \c3" @ (strlen(getWord(CityRPGData.getData(%client.bl_id).valueResources, 2)) > 0 ? getWord(CityRPGData.getData(%client.bl_id).valueResources, 2) : 0);
   }
   %client.CityRPGPrint2 = %client.CityRPGPrint2 NL %client.CityRPGPrint2Lumber SPC %client.CityRPGPrint2Ore SPC %client.CityRPGPrint2Fish
   
   // Lot Info
   //if(#is#Object(%client.CityRPGLotBrick)) %client.CityRPGPrint2 = %client.CityRPGPrint2 SPC "<just:right><font:Arial:16><color:fff000>" @ getBrickGroupFromObject(%client.CityRPGLotBrick).name;   
   //if(isObject(%client.CityRPGIndLotBrick)) %client.CityRPGPrint2 = %client.CityRPGPrint2 SPC "<just:right><font:Arial:16><color:E50000>" @ getBrickGroupFromObject(%client.CityRPGIndLotBrick).name;
   ^^ Commented out but still showed errors when tried with it not commented out.  I didn't make ANY edits to that, which is what puzzles me.


   // Printing
   commandToClient(#%#client, 'bottomPrint', %client.CityRPGPrint2, 0, true);
   
   return #%#client.CityRPGPrint2;
}

Any help is appreciated.  Thanks

Code: [Select]
   %client.CityRPGPrint2 = %client.CityRPGPrint2 NL %client.CityRPGPrint2Lumber SPC %client.CityRPGPrint2Ore SPC %client.CityRPGPrint2Fish
Looks like this line misses a ;

Code: [Select]
   %client.CityRPGPrint2 = %client.CityRPGPrint2 NL %client.CityRPGPrint2Lumber SPC %client.CityRPGPrint2Ore SPC %client.CityRPGPrint2Fish
Looks like this line misses a ;
Haha, I must be more tired than I thought.  Thanks for catching that obvious mistake.  Since that line restated %client.CityRPGPrint2, it broke 
Quote
Code: [Select]
commandToClient(%client, 'bottomPrint', %client.CityRPGPrint, 0, true);And
Code: [Select]
return %client.CityRPGPrint;
Right?  Sorry, i'm still getting my feet wet in programming.

Haha, I must be more tired than I thought.  Thanks for catching that obvious mistake.  Since that line restated %client.CityRPGPrint2, it broke  Right?  Sorry, i'm still getting my feet wet in programming.
Most compile errors are cause by something before them

If only Torque would display the error's better.

If only Torque would display the error's better.
It shows them fine, it's how it's parsed that causes it to show errors afterwards like that.