Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Editing Valid Disguises?  (Read 976 times)

Roobanguy

  • Escaped Lunatic
    • View Profile
Editing Valid Disguises?
« on: August 11, 2013, 09:21:49 pm »

After around an hour of google-fu'ing, I can't seem to find out how to alter an areas Valid disguises. I already looked through all the XML files in the art folder, but they don't seem to hold it. I'm trying to make it so standard body armor can be used as a disguise for any area that uses normal clothes (business suits, work clothes and the like).  Can anyone tell me how to mod them? I would appreciate any help.
« Last Edit: August 11, 2013, 09:27:05 pm by Roobanguy »
Logged

FinetalPies

  • Bay Watcher
  • Even on the battlefield.
    • View Profile
Re: Editing Valid Disguises?
« Reply #1 on: August 12, 2013, 06:26:06 am »

That gives me the idea of like, brigand armour. Which is essentially metal plates and such concealed under normal clothes.
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Editing Valid Disguises?
« Reply #2 on: August 12, 2013, 09:24:34 am »

After around an hour of google-fu'ing, I can't seem to find out how to alter an areas Valid disguises. I already looked through all the XML files in the art folder, but they don't seem to hold it. I'm trying to make it so standard body armor can be used as a disguise for any area that uses normal clothes (business suits, work clothes and the like).  Can anyone tell me how to mod them? I would appreciate any help.

It's in the source code. Specifically, it's in the "sitemode" directory of the source code, in the file "stealth.cpp", in the hasdisguise() function. Here, I'll show you the current text of this function, which determines which disguises are valid at which locations:

Code: [Select]
/* checks if a creature's uniform is appropriate to the location */
char hasdisguise(Creature &cr)
{
   short type = -1;
   if(cursite>=0)type = location[cursite]->type;
   char uniformed=0;

   // Never uniformed in battle colors
   //if(activesquad->stance==SQUADSTANCE_BATTLECOLORS)
   //   return 0;

   if(location[cursite]->siege.siege)
   {
      switch(location[cursite]->siege.siegetype)
      {
         case SIEGE_CIA:
         {
            if(cr.get_armor().get_itemtypename()=="ARMOR_BLACKSUIT")uniformed=1;
            break;
         }
         case SIEGE_CORPORATE:
         {
            if(cr.get_armor().get_itemtypename()=="ARMOR_MILITARY")uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_ARMYARMOR")uniformed=1;
            break;
         }
         case SIEGE_HICKS:
         {
            if(cr.get_armor().get_itemtypename()=="ARMOR_CLOTHES")uniformed=2;
            if(cr.get_armor().get_itemtypename()=="ARMOR_OVERALLS")uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_WIFEBEATER")uniformed=1;
            break;
         }
         case SIEGE_CCS:
         {
            // CCS has trained in anticipation of this tactic
            // There is no fooling them
            // (They pull this shit all the time in their own sieges)
            uniformed=0;
            break;
         }
         case SIEGE_POLICE:
         {
            if(cr.get_armor().get_itemtypename()=="ARMOR_SWATARMOR"&&
               location[cursite]->siege.escalationstate==0)uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_MILITARY"&&
               location[cursite]->siege.escalationstate>0)uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_ARMYARMOR"&&
               location[cursite]->siege.escalationstate>0)uniformed=1;
            break;
         }
         case SIEGE_FIREMEN:
         {
            if(cr.get_armor().get_itemtypename()=="ARMOR_BUNKERGEAR")uniformed=1;
            break;
         }
      }
   }
   else
   {
      if((!cr.is_naked()||cr.animalgloss==ANIMALGLOSS_ANIMAL)
         &&cr.get_armor().get_itemtypename()!="ARMOR_HEAVYARMOR")uniformed=1;

      switch(type)
      {

         case SITE_INDUSTRY_WAREHOUSE:
         case SITE_RESIDENTIAL_SHELTER:
            uniformed=1;
            break;
         case SITE_LABORATORY_COSMETICS:
         case SITE_LABORATORY_GENETIC:
            if(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED)
            {
               uniformed=0;
               if(cr.get_armor().get_itemtypename()=="ARMOR_LABCOAT")uniformed=1;
               if(location[cursite]->highsecurity)
               {
                  if(cr.get_armor().get_itemtypename()=="ARMOR_SECURITYUNIFORM")uniformed=1;
               }
               else
               {
                  if(cr.get_armor().get_itemtypename()=="ARMOR_SECURITYUNIFORM")uniformed=2;
               }
            }
            break;
         case SITE_GOVERNMENT_POLICESTATION:
            if(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED)
            {
               uniformed=0;
               if(law[LAW_POLICEBEHAVIOR]==-2 && law[LAW_DEATHPENALTY]==-2 &&
                  cr.get_armor().get_itemtypename()=="ARMOR_DEATHSQUADUNIFORM")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_POLICEUNIFORM")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_POLICEARMOR")uniformed=1;
            }
            break;
         case SITE_GOVERNMENT_WHITE_HOUSE:
            if(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED)
            {
               uniformed=0;
               if(cr.get_armor().get_itemtypename()=="ARMOR_BLACKSUIT")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_BLACKDRESS")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_CHEAPSUIT")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_CHEAPDRESS")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVESUIT")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVEDRESS")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_MILITARY")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_ARMYARMOR")uniformed=1;
            }
            break;
         case SITE_GOVERNMENT_COURTHOUSE:
            if(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED)
            {
               uniformed=0;
               if(cr.get_armor().get_itemtypename()=="ARMOR_BLACKROBE")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_BLACKSUIT")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_BLACKDRESS")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_CHEAPSUIT")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_CHEAPDRESS")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVESUIT")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVEDRESS")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_POLICEUNIFORM")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_POLICEARMOR")uniformed=1;
               if(law[LAW_POLICEBEHAVIOR]==-2 && law[LAW_DEATHPENALTY]==-2 &&
                  cr.get_armor().get_itemtypename()=="ARMOR_DEATHSQUADUNIFORM")uniformed=1;
            }
            break;
         case SITE_GOVERNMENT_PRISON:
            if(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED)
            {
               uniformed=0;
               if(law[LAW_DEATHPENALTY]==-2&&
                   law[LAW_POLICEBEHAVIOR]==-2)
               {
                  if(cr.get_armor().get_itemtypename()=="ARMOR_LABCOAT")uniformed=1;
               }
               else if(cr.get_armor().get_itemtypename()=="ARMOR_PRISONGUARD")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_PRISONER")uniformed=1;
            }
            break;
         case SITE_GOVERNMENT_ARMYBASE:
            if(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED)
            {
               uniformed=0;
               if(cr.get_armor().get_itemtypename()=="ARMOR_MILITARY")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_ARMYARMOR")uniformed=1;
            }
            break;
         case SITE_GOVERNMENT_INTELLIGENCEHQ:
            if(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED)
            {
               uniformed=0;
               if(cr.get_armor().get_itemtypename()=="ARMOR_BLACKSUIT")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_BLACKDRESS")uniformed=1;
            }
            break;
         case SITE_GOVERNMENT_FIRESTATION:
            if(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED)
            {
               uniformed=0;
               if(cr.get_armor().get_itemtypename()=="ARMOR_BUNKERGEAR")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_WORKCLOTHES")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_OVERALLS")uniformed=1;
               if(location[cursite]->highsecurity)
               {
                  if(cr.get_armor().get_itemtypename()=="ARMOR_POLICEUNIFORM")uniformed=1;
                  if(cr.get_armor().get_itemtypename()=="ARMOR_POLICEARMOR")uniformed=1;
               }
            }
            break;
         case SITE_BUSINESS_BANK:
            if(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED)
            {
               uniformed=0;
               if(cr.get_armor().get_itemtypename()=="ARMOR_CHEAPSUIT")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVESUIT")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_SECURITYUNIFORM")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_POLICEUNIFORM")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_POLICEARMOR")uniformed=1;
               if(location[cursite]->highsecurity)
               {
                  if(cr.get_armor().get_itemtypename()=="ARMOR_CIVILLIANARMOR")uniformed=1;
               }
            }
            break;
         case SITE_BUSINESS_CIGARBAR:
            uniformed=0;
            if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVESUIT")uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_CHEAPSUIT")uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVEDRESS")uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_CHEAPDRESS")uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_BLACKSUIT")uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_BLACKDRESS")uniformed=1;
            break;
         case SITE_INDUSTRY_SWEATSHOP:
            uniformed=0;
            if(cr.is_naked())uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_SECURITYUNIFORM")uniformed=1;
            break;
         case SITE_INDUSTRY_POLLUTER:
            uniformed=0;
            if(cr.get_armor().get_itemtypename()=="ARMOR_WORKCLOTHES")uniformed=1;
            if(location[cursite]->highsecurity)
            {
               if(cr.get_armor().get_itemtypename()=="ARMOR_SECURITYUNIFORM")uniformed=1;
            }
            break;
         case SITE_INDUSTRY_NUCLEAR:
            if(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED)
            {
               uniformed=0;
               if(cr.get_armor().get_itemtypename()=="ARMOR_LABCOAT")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_SECURITYUNIFORM")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_CIVILLIANARMOR")uniformed=1;
            }
            break;
         case SITE_CORPORATE_HEADQUARTERS:
            uniformed=0;
            if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVESUIT")uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_CHEAPSUIT")uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_SECURITYUNIFORM")uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVEDRESS")uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_CHEAPDRESS")uniformed=1;
            break;
         case SITE_CORPORATE_HOUSE:
            uniformed=0;
            if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVESUIT")uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVEDRESS")uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_SECURITYUNIFORM")uniformed=1;
            if(cr.get_armor().get_itemtypename()=="ARMOR_SERVANTUNIFORM")uniformed=1;
            if(location[cursite]->highsecurity)
            {
               if(cr.get_armor().get_itemtypename()=="ARMOR_MILITARY")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_ARMYARMOR")uniformed=1;
            }
            break;
         case SITE_MEDIA_AMRADIO:
            if(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED)
            {
               uniformed=0;
               if(cr.get_armor().get_itemtypename()=="ARMOR_SECURITYUNIFORM")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVESUIT")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_CHEAPSUIT")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVEDRESS")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_CHEAPDRESS")uniformed=1;
            }
            break;
         case SITE_MEDIA_CABLENEWS:
            if(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED)
            {
               uniformed=0;
               if(cr.get_armor().get_itemtypename()=="ARMOR_SECURITYUNIFORM")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVESUIT")uniformed=1;
               if(cr.get_armor().get_itemtypename()=="ARMOR_EXPENSIVEDRESS")uniformed=1;
            }
            break;
         case SITE_RESIDENTIAL_TENEMENT:
         case SITE_RESIDENTIAL_APARTMENT:
         case SITE_RESIDENTIAL_APARTMENT_UPSCALE:
            if(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED)uniformed=0;
            break;
         default:
            break;
      }
   }

   if(!uniformed)
   {
      if(cr.get_armor().get_itemtypename()=="ARMOR_POLICEUNIFORM"||
         cr.get_armor().get_itemtypename()=="ARMOR_POLICEARMOR")
      {
         uniformed=2;
      }
      if(law[LAW_POLICEBEHAVIOR]==-2 && law[LAW_DEATHPENALTY]==-2 &&
            cr.get_armor().get_itemtypename()=="ARMOR_DEATHSQUADUNIFORM")
      {
         uniformed=2;
      }
   }

   return uniformed;
}

Anyway, right there's your list of which disguises work at which locations and when. Oh, and if uniformed is set to 2 instead of 1, those are less-effective disguises for those locations, while when uniformed is set to 1, those are all effective disguises for those locations.

If you want to mod this in the current version, your only option is to edit this file in the source code and then compile and build the project to get a new .exe file based on your modded source code. If you don't have Microsoft Visual C++, I'd recommend using Code::Blocks (choose "codeblocks-12.11mingw-setup.exe", the 3rd of the 4 options on their download page here... you want one that has "mingw" in its name but DOESN'T have "user" in its name). Once that's installed on your computer, get the Liberal Crime Squad source code here (click the thingy that says "Download Snapshot" and you'll get the source code as a .zip file). Then you can open up the project by going into the "trunk" folder, then the "workspaces" folder, and double-clicking on the file "game.cbp" (.cbp is the file extension for Code::Blocks Project). Once you open that up, you can go to the left side of the screen and browse the files in the source code and edit and save them. Then to compile and build them into .exe files of Liberal Crime Squad, you select the Build Target near the top of the screen in a little drop-down menu (either "Debug" or "Release") and then go to the "Build" menu at the top of the screen and click the menu item that says "Build". If it succeeds, you'll get a new .exe file for Liberal Crime Squad in either the Debug or Release subdirectory of your workspaces directory, and you can copy and paste that .exe file to the directory where you keep Liberal Crime Squad (since it needs the "init.txt" file and the files in the "art" directory to run properly).

Anyway there's loads of neat things you can mod by editing the source code directly, this is just one of them. Maybe someday in a future version we might change it so that stuff like this isn't hardcoded into the .exe but is stored in the "art" directory in .xml files that you can mod, without having to mess with the source code. But currently this is how it works, if you want the ability to mod which disguises work without editing source code you should ask for it here as a feature request. Anyway editing source code to mod the game is just as easy as editing .xml files to mod the game... OK not QUITE as easy, but ALMOST as easy, once you get used to it and have a compiler like Code::Blocks up and running.

Well, I hope that was helpful and hopefully you'll try out this option for modding the game. Or if you don't feel like doing it if it requires modifying the source code, that's fine too. I'm just here to help.
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL

Roobanguy

  • Escaped Lunatic
    • View Profile
Re: Editing Valid Disguises?
« Reply #3 on: August 12, 2013, 03:30:38 pm »

Thanks dude! I was able to get it working with cubeblocks. Appreciate the help!
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Editing Valid Disguises?
« Reply #4 on: August 12, 2013, 11:42:28 pm »

Thanks dude! I was able to get it working with cubeblocks. Appreciate the help!

Awesome! Glad I could be of help. I looked up where that was in the source code by doing a search of all the source code for the word "disguise", using the built-in search feature of Code::Blocks. And I made sure to set the search to NOT be case-sensitive and NOT be whole-word-only, to get more results.
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL

NES630

  • Bay Watcher
    • View Profile
Re: Editing Valid Disguises?
« Reply #5 on: August 16, 2013, 09:27:57 pm »

Quote
// CCS has trained in anticipation of this tactic
            // There is no fooling them
            // (They pull this shit all the time in their own sieges)

Am I the only one who finds this note hilarious?

Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki
Re: Editing Valid Disguises?
« Reply #6 on: August 18, 2013, 10:23:07 pm »

Quote
// CCS has trained in anticipation of this tactic
            // There is no fooling them
            // (They pull this shit all the time in their own sieges)

Am I the only one who finds this note hilarious?

Yes I noticed that too. It's always good to put explanatory comments in source code to explain the bits that might not make sense to folks reading it, and sometimes a bit of humor helps. Plus comments are ignored by the compiler. Some people actually put jokes into the names of their functions and variables, and not just the comments. There have even been humorous programming languages developed so that every program written in them is one big joke. One example is the programming language LOLCODE, which is epic. Not very useful though.
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL