Important correction: to add a building one should use the code:
Event:CreateBuilding(tmpCity, BuildingDB(IMPROVE_DROUGHT));
So with 'Event:' in front of the eventname. I don't know how that could fallen away. To destroy it the function DestroyBuilding will work, as Radical mentioned earlier.
To get non-global floods, you could use the Terraform function. My suggestion would be: check all squares in a 3 tile radius (or something similar) and if a tile is swamp, plain or grassland either adjacent to sea or with a river running through it, terraform it to beach/shallow water (whatever turns out to work best), do the same for all squares adjacent to it. (To get an adjacent tile, use a for loop and GetNeighbor). If a tile is of any other terraintype or doesn't have a river or sea near it, check the next tile. A good way to cycle through tiles could be to use a double for-loop with MakeLocation that has variables x and y(which range from location.x - 3 to location.x + 3, similar for y) as arguments, which come from the for-loops.
Event:CreateBuilding(tmpCity, BuildingDB(IMPROVE_DROUGHT));
So with 'Event:' in front of the eventname. I don't know how that could fallen away. To destroy it the function DestroyBuilding will work, as Radical mentioned earlier.
To get non-global floods, you could use the Terraform function. My suggestion would be: check all squares in a 3 tile radius (or something similar) and if a tile is swamp, plain or grassland either adjacent to sea or with a river running through it, terraform it to beach/shallow water (whatever turns out to work best), do the same for all squares adjacent to it. (To get an adjacent tile, use a for loop and GetNeighbor). If a tile is of any other terraintype or doesn't have a river or sea near it, check the next tile. A good way to cycle through tiles could be to use a double for-loop with MakeLocation that has variables x and y(which range from location.x - 3 to location.x + 3, similar for y) as arguments, which come from the for-loops.
Comment