Jump to content
catty-cb

Add a Mediterranean Climate by Slink

1 post in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Go to Resource\Game\Climate.

Make a copy of Mild.rsc.
Rename the copy to Mediterranean.rsc.
Edit Mediterranean.rsc with an editor that has Administrator's privileges.

Harsh and Mild climate files contain only changes relative to the Fair climate file, so we have to add some additional changes if we want to change the climate very much.  Edit Mediterranean.rsc so that it is as follows.  What you will have done is edited the string name, and also changed the average temperature from temperate to sub-tropical by adding changes from Fair to the base temperature and the range of temperatures.

ClimateGenerator resource : "Fair.rsc"
{
	String _text = "Mediterranean";

	// base range for temperature over the year
	float _baseTemperature = 60.0;
	float _temperatureRange = 20.0;

	// normal temperature swing
	float _temperatureTolerance = 2.0;

	// normal distribution range of base temperature change (biyearly?)
	float _temperatureVariance = 20.0;

	// normal distribution range of weather chance
	float _weatherVariance = 0.1;
}

Save the file. 

Now open ClimateList.rsc in the same editor.  Add a line to tell the game to include the new climate file.  It will look as follows, when you are done.

ExternalList resource
{
	External _resources
	[
		"Game/Climate/Mediterranean.rsc",
		"Game/Climate/Mild.rsc",
		"Game/Climate/Fair.rsc",
		"Game/Climate/Harsh.rsc",
	]
}

Save the file.

Now you need to add a display string to another file.  This file is in the Resource\Dialog directory, and it is named StringTable.rsc.  Open that file in your editor.  Search for the string table for climate, and add a line so that section appears as follows.

StringTable climate
{
	Entry _strings
	[
		{ String _name = "Mediterranean";	        String _text = "Mediterranean"; }
		{ String _name = "Mild";			String _text = "Mild"; }
		{ String _name = "Fair";			String _text = "Fair"; }
		{ String _name = "Harsh";			String _text = "Harsh"; }
	]
}

Save your change and run the debug program.  If you make a new world you should see Mediterranean as a choice.  Creating a world with that climate will give you a world that never sees snow.  The temperature ranges from 40(F) in winter to 80(F) in summer, with slight variations.

This does not add the new climate to your ordinary game.  That is a different lesson.

 

  • Like 1

Share this post


Link to post
Share on other sites

×

Thank You for the Continued Support!

Simtropolis depends on donations to fund site maintenance costs.
Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

Make a Donation, Get a Gift!

Expand your city with the best from the Simtropolis Exchange.
Make a Donation and get one or all three discs today!

STEX Collections

By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

Each donation helps keep Simtropolis online, open and free!

Thank you for reading and enjoy the site!

More About STEX Collections