1. GetLandType is a function(!) with return value 'string' and input variable 'int'.
2. 'rmTerrainInitialize(GetLandType(Environment))' uses a function in a AOM/RMS build-in function ('rm...'), which is not good. I'm afraid you can only use constant variables in 'rm...' function.
3. Even more, 'string functions' are bad, since the program does not know how much memory to allocate for 'string'. So, better use 'int' or 'void'.
4. In your main function you choose 'Environment' random from 1-5. In your 'GetLandType' function you have a case for 'Environment=0' which will never occur. You also don't need to randomize twice!
My advice:(corrected)/*01*/ void MakeTerrainType(int AreaID, int idx=0) {
/*02*/ string str="GrassA";
/*03*/ if (idx==1) str="SnowA"; // WINTER
/*04*/ else if (idx==2) str="SavannahA"; // SPRING
/*05*/ else if (idx==3) str="GrassA"; // SUMMER
/*06*/ else if (idx==4) str="SnowGrass25"; // FALL
/*07*/ else if (idx==5) str="DirtA"; // HELL
/*08*/ rmSetAreaTerrainType(AreaID,str);
/*09*/ }
/*10*/
/*11*/ void main() {
/*12*/ int Environment = rmRandInt(1,5); // RANDOMLY SELECT AN ENVIRONMENT
/*..*/ rmTerrainInitialize("land,4"); // or rmTerrainInitialize("water",0);
/*..*/ //...
/*..*/ //... Define your basic area MyMap (whole map)...
/*..*/ MakeTerrainType(MyMap,Environment);
/*..*/ ...
/*..*/ }For Pascal9872:
If your debugger does not open in that case, you have not activated it! You do NOT do this by just clicking on the debugger checkbox. It's explained above how to activate it.[This message has been edited by M0nTy PyTh0n (edited 01-14-2003 @ 09:14 PM).]