Page 1 of 1

CAPS, movement class

Posted: 12 Apr 2006, 02:44
by FoeOfTheBee
If I read this code correctly, BOAT, HOVER, SHIP, and TANK all need to be in caps in the FBI file. Is this right?

Code: Select all

if(name.find("BOAT")!=string::npos || name.find("SHIP")!=string::npos){
			md->moveType=MoveData::Ship_Move;
			md->depth=atof(parser.SGetValueDef("10",class_name+"\\MinWaterDepth").c_str());
//			info->AddLine("class %i %s boat",num,name.c_str());
			md->moveFamily=3;
		} else if(name.find("HOVER")!=string::npos){
			md->moveType=MoveData::Hover_Move;
			md->maxSlope=1-cos(atof(parser.SGetValueDef("10",class_name+"\\MaxSlope").c_str())*1.5*PI/180);
			md->moveFamily=2;
//			info->AddLine("class %i %s hover",num,name.c_str());
		} else {
			md->moveType=MoveData::Ground_Move;	
			md->depthMod=0.1;
			md->depth=atof(parser.SGetValueDef("0",class_name+"\\MaxWaterDepth").c_str());
			md->maxSlope=1-cos(atof(parser.SGetValueDef("60",class_name+"\\MaxSlope").c_str())*1.5*PI/180);
//			info->AddLine("class %i %s ground",num,name.c_str());
			if(name.find("TANK")!=string::npos)
				md->moveFamily=0;
			else
				md->moveFamily=1;
		}

Posted: 12 Apr 2006, 04:18
by FLOZi
It depends how the find method works, but probably, yes - i think it is from modding experience, of course, I could be wrong. :wink:

Posted: 12 Apr 2006, 17:05
by Tobi
yeah, std::string::find is case sensitive, so they have to be in uppercase in the file apparently.