Here's an update on my current progress. Right now as I said in my previous post I created another code besides the one I posted here. The following image is how it looks currently when it runs and also I created a simply GUI to change the height of the buildings.
I also went back and made all the corrections of the code that I posted here before. Yet it still has 4 errors:
// Warning: New procedure definition for "Bld1" has a different argument list and/or return type. //
// Error: pickABld(blockLocX[i],blockLocZ[i]);
//
// Error: Line 59.29: Invalid use of Maya object "i". //
// Error: pickABld(blockLocX[i],blockLocZ[i]);
//
// Error: Line 59.42: Invalid use of Maya object "i". //
And here is how the code currently looks like
proc Bld1(float $myX, float $myZ){ //proc for building 1
polyCylinder ;
move -a $myX 0 $myZ;
}
proc Bld2(float $myX, float $myZ){ //proc for buiilding 2
polyCube;
move -a $myX 0 $myZ;
}
proc Bld3(float $myX, float $myZ){ //proc for building 3
polyCone;
move -a $myX 0 $myZ;
}
proc Bld4(float $myX, float $myZ){ //proc for building 4
polySphere;
move -a $myX 0 $myZ;
}
proc Bld5(float $myX, float $myZ){ //proc for building 5
polyPlane;
move -a $myX 0 $myZ;
}
float $blockLocX[]={1,2,3,4,5};
float $blockLocZ[]=$blockLocX;
for ($i=0; $i<5; $i++){
int $chanceRes = rand(0,100);
if($chanceRes <= 60){
pickABld(blockLocX[i],blockLocZ[i]);
}
}
proc pickABld(float $thisX, float $thisZ){ //in this proc were going to set parameters for each of the buildings
int $wBld = rand(0,100); //set random variable to determine which building will appear
if($wBld <= 20){ //each building will have a 20% chance of appearing in scene
Bld1($thisX, $thisZ);
}
else if ($wBld <= 40){
Bld2 ($thisX, $thisZ);
}
else if ($wBld <= 60){
Bld3 ($thisX, $thisZ);
}
else if ($wBld <= 80){
Bld4 ($thisX, $thisZ);
}
else if ($wBld <= 100){
Bld5 ($thisX, $thisZ);
}
}