posted 28 November 2021 12:02 PM EDT (US)   
It's me again and this time I'm asking for help because the rms I'm currently working on sometimes crashes the game when I'm trying to generate a map. In that case aom just closes without leaving a note.

I'm not sure where to find a crashlog but the last line in the startup.txt says:

EXCEPTION CAUGHT: Access Violation at 0x004A4FD8 in 0x00B8E944 at base address 0x00130000. Invalid operation: read at 0x82a91554

Is this maybe due to a mistake in calculations? I'm using a lot of math for generating the map so maybe there are some negative numbers generated or I'm deviding by 0 or something like that could be. Though I already tried excluding parts that could be problematic but it kept occurring.

Any hints would be useful, thanks!


Addition:

I figured out that the mistake must be somewehere in this section but I can't seem to find it.
for(i = 1; <= cNumberNonGaiaPlayers*3) {
id = rmCreateArea("pillar "+i);
rmAddAreaToClass(id,myLandClass);
rmSetAreaBaseHeight(id,rmRandFloat(1,2));
rmSetAreaHeightBlend(id,1);
rmSetAreaLocation(id,rmRandFloat(0.0,1.0),rmRandFloat(0.0,1.0));
rmSetAreaSize(id,rmAreaTilesToFraction(cNumberNonGaiaPlayers*2+26),rmAreaTilesToFraction(cNumberNonGaiaPlayers*3+39));
rmSetAreaTerrainType(id,"RiverGrassyC");
rmAddAreaConstraint(id,edgeConstraint);
rmAddAreaConstraint(id,myAvoidLandConstraint);
rmSetAreaWarnFailure(id,false);
rmBuildArea(id);
}

[This message has been edited by Niley (edited 11-29-2021 @ 11:18 AM).]