Maintenance Mod v1.0

Post or download mods and height maps here!
Mike Lattiak
Posts: 126
Joined: Thu Jun 07, 2007 8:20 pm
Location: Framingham, MA

Maintenance Mod v1.0

Postby Mike Lattiak » Tue Nov 20, 2007 7:15 pm

Greetings!

Welcome to the Maintenance Mod v1.0!

What is the Maintenance Mod?

This is a slight modification to the current game, which gives the wonderful gift of upkeep costs to all buildings in your city. By simply placing the maintenance center anywhere in your city, each building will be forced to pay 5% of its total building cost in fees at 9 AM every morning. So, if the building cost 100 Simoleons to place, it'll be charged 5 Simoleons each morning.

It is setup to add a bit more challenge to creating your city. The 5% is a start and can easily be modded to a higher value.

Well, what if it can’t pay the fee?
Simple, the building falls apart. It becomes damaged for 12 hours, making it useless to your city for the remainder of the day. It’ll also show the damaged texture on the building, to give your city a more “oh god what happened here?” look.

Wait, are ALL buildings charged?
Pretty much. Even your decorations need some love now and then.

What is this “maintenance center” you speak of?

The maintenance center is a modified version of the public safety building – a very small workplace that produces work crews. The building is free to place, but you can only have one in your entire city. It also comes with a building action, which will spawn some work crews quickly in order to repair any buildings that suddenly took damage from lack of payment.

You must have this building somewhere in your city for the maintenance fees to operate.

I don’t want to have to place the maintenance center to get this to occur, any way around that?
Yes, but it’ll require a bit of work. You’ll need to go into every building XML you want this fee to be part of and add the tag:
<Ability type="Property Maintenance" />.
This will permanently attach the maintenance ability to the building.

So, how did you make this mod?
This mod is an example of how you can use the scripts and XMLs together to create a new gameplay mechanic. In this case, we created the script Ability_Maintenance.cs while adding a new ability in the XMLs. I have already seen several people post methods they used to reduce the treasury in their city, so this is an expansion of that. The script mainly takes a look at your treasury and decides to damage a building if you cannot afford the fee.

Anything else I can mess with?
The sky is the limit on this one. Hopefully this mod will inspire you to make your own additions to the game. For example, you can create an ability for your power plants that has a small radius -- any building that does not get this ability is shut down (to simulate the power plants of the past games). Here is a tip on how you can quickly edit this mod to your liking:

Go to C:\Documents and Settings\All Users\Application Data\SimCity Societies\Data\XMLDb\Game\Abilities
Open up Maintenance Abilities.XML
Look at the tag: <Ability type= /> under property maintenance.
-- You can change the amount of damage done, the time of day the fee takes place, and the percentage amount the fee costs.
Look at the tag: <Ability type= /> under maintenance aura.
--You can change the radius to something larger, if you have modded a bigger map size. You can also limit which buildings are affected by the maintenance by using categories and types.

We strongly encourage you to add on to this mod and make it your own.
You do not have the required permissions to view the files attached to this post.

Alex Mullins
Posts: 21
Joined: Thu Jun 07, 2007 8:50 pm

Postby Alex Mullins » Tue Nov 20, 2007 7:19 pm

The scripting behind the ability is fairly simple.

First, the ability registers it's AtHour event to be called every day at the specified hour:

Code: Select all

public override void OnActivate()
{
    mBuilding.GetBuildingAbilityScript().RegisterAtHour(mHour, mScriptData);
}


Then, when that event is called it first checks to see if the building is functional (if not we don't want to charge a maintenance fee); next it gets the cash value of the building and calculates the maintenance fee based off of the specified percentage. Then if the player can't afford the fee it damages the building; otherwise it just deducts the fee from the player's treasury.

Code: Select all

public override void AtHour()
{
    if (!mBuilding.Functional)
        return;

    int amount = (int)(DisasterControl.GetCashValue(mBuilding) * mPercentage / 100.0f);
    if (CS_Player.GetCurrentMoney() - amount < 0)
        mBuilding.ModifyDamage(mDamage);
    else
        CS_Player.ModifyCurrentMoney(amount, false, TTreasuryType.kTreasuryTypeConstruction);
}


The init function of the ability is used to get parameters from the xml:

Code: Select all

public override void Init(CS_UnitBuilding inBuilding, AbilityScriptData inScriptData)
{
    base.Init(inBuilding, inScriptData);

    AbilityParametersMap paramMap = new AbilityParametersMap(mScriptData.mParamsDict);
    mHour = paramMap.GetParamAsInt(AbilityParametersTypes.sHour, sDefaultHour);
    mPercentage = paramMap.GetParamAsInt(AbilityParametersTypes.sPercent);
    mDamage = paramMap.GetParamAsInt(AbilityParametersTypes.sAmount);
}


This grabs the corresponding values from the xml file so that the percentage of the building's cost to use as the maintenance fee, the amount of damage to deal when the player can't pay, and the hour at which to do the check can all be changed in the xml and allows for multiple abilities to use this script which have differing effects.

Code: Select all

<Ability type="Maintenance" params="amount = 12;hour = 9;percent = 5" />
Last edited by Alex Mullins on Tue Nov 20, 2007 7:29 pm, edited 1 time in total.

bloodystump
Posts: 6
Joined: Mon Nov 19, 2007 7:45 pm

Postby bloodystump » Tue Nov 20, 2007 7:20 pm

Lol excellent. I just wish this had appeared before i altered the 100+ building files :D

King Faticus
Posts: 4230
Joined: Tue Sep 20, 2005 1:20 am

Postby King Faticus » Tue Nov 20, 2007 7:26 pm

Hahaha :D

Pat D.
Posts: 531
Joined: Wed Nov 10, 2004 5:56 pm
Location: Pennsylvania, USA

Postby Pat D. » Tue Nov 20, 2007 7:41 pm

So how does one install this file into the game? And what specific file are we looking for to 'back-up' in order to be able to archive the original game's settings/files?

thanks, this is AWESOME!!

pat!

Mike Lattiak
Posts: 126
Joined: Thu Jun 07, 2007 8:20 pm
Location: Framingham, MA

Postby Mike Lattiak » Tue Nov 20, 2007 7:44 pm

Pat D. wrote:So how does one install this file into the game? And what specific file are we looking for to 'back-up' in order to be able to archive the original game's settings/files?

thanks, this is AWESOME!!

pat!


Place the .SCS file that is included within this .zip file in the folder:

\Documents and Settings\All Users\Application Data\SimCity Societies\Import"

Run the game and you'll be all set!

Morpheus121073
Posts: 186
Joined: Fri Nov 16, 2007 10:14 pm

Postby Morpheus121073 » Tue Nov 20, 2007 7:47 pm

will this work without the known problems we all encounter with installing mods ? See the thing is that there a few mods around that adds buildings to the game such as the gamestop and the ninja academy but they both will not work, for some reason the older files are read first and will not allow the new mods to appear, i had the same thing happening to my roads mod, i can make it appear in the game when modifying the original files but when adding it as a mod they do not work, so there is something wrong with the game not reading the mod files correctly.

WolfwoodSama
Posts: 32
Joined: Sat Oct 20, 2007 7:28 am

Postby WolfwoodSama » Tue Nov 20, 2007 7:57 pm

Yes, beside the sheer awesomeness of this mod I can presume two things: One, that this maintenance center uses a custom texture that wont conflict with ours, and two, that you know just a little more about the game's workings than we do ;)

Mike Lattiak
Posts: 126
Joined: Thu Jun 07, 2007 8:20 pm
Location: Framingham, MA

Postby Mike Lattiak » Tue Nov 20, 2007 8:17 pm

Morpheus121073 wrote:will this work without the known problems we all encounter with installing mods ? See the thing is that there a few mods around that adds buildings to the game such as the gamestop and the ninja academy but they both will not work, for some reason the older files are read first and will not allow the new mods to appear, i had the same thing happening to my roads mod, i can make it appear in the game when modifying the original files but when adding it as a mod they do not work, so there is something wrong with the game not reading the mod files correctly.


I just did a test of all the files and found no conflicts here: I was able to have the Ninja Academy, Gamestop, and the Maintenance Center at once. Although I almost missed the Ninja Academy (who would have guessed?) since it is set as locked to begin.

If you are still having this problem, would you like to send me a more detailed report of the problem? I'd like to get all the information regarding this problem in one basket.

Morpheus121073
Posts: 186
Joined: Fri Nov 16, 2007 10:14 pm

Postby Morpheus121073 » Tue Nov 20, 2007 8:28 pm

see the problem is that i can get them to work, if i place them in the game installtion folder, with only 1 exception that the ninja's show up as white square boxes (blocks), the same problem i also have if i use the spawn cheat on frat guys and children they then also spawn as those white squares (blocks).


Now when i install those 2 mods (gamestop & ninja academy) in the normal folder for mods which is in the program data folder on vista then they do not work, the gamestop shows up as a butcher shop i think it is and the Ninja Academy shows up as a one of the other standard buildings.

Again i have the same problem with my roads mod, as a reference i attached my roads mod, which includes the normal files but also the installer pack i made. Maybe you can take a look at it and see what's going on. This roads mod simply makes it so you have all roads available and you can mix and match different road styles.
You do not have the required permissions to view the files attached to this post.

LadyCrimson
Posts: 362
Joined: Fri Oct 20, 2006 5:37 am
Location: The chair in front of my computer
Contact:

Postby LadyCrimson » Tue Nov 20, 2007 8:39 pm

Welcome to the Maintenance Mod v1.0!

OMG, I luvs you. :D

Thanks, TM, very wonderful.

Tinkerbell
Posts: 5415
Joined: Fri Sep 07, 2007 3:42 am
Location: San Diego, California
Contact:

Postby Tinkerbell » Tue Nov 20, 2007 8:56 pm

TM rocks! :)

I'm not a modder, but definitely will try this after playing the vanilla game for awhile!

Pat D.
Posts: 531
Joined: Wed Nov 10, 2004 5:56 pm
Location: Pennsylvania, USA

Postby Pat D. » Tue Nov 20, 2007 9:04 pm

Mike Lattiak wrote:Place the .SCS file that is included within this .zip file in the folder:

\Documents and Settings\All Users\Application Data\SimCity Societies\Import"

Run the game and you'll be all set!



Thanks Mike! Is there a like named file in the Import folder that I need to back-up or will simply removing said .scs file from the Import folder do the trick of returning the game to original state? Sorry for this, I'm a geek about original state of games!

Thanks again for a great game!

pat!

Tinkerbell
Posts: 5415
Joined: Fri Sep 07, 2007 3:42 am
Location: San Diego, California
Contact:

Postby Tinkerbell » Tue Nov 20, 2007 9:09 pm

There is already an XML document in that folder Mike said & it looks from the creation date that it is from the Patch.

Pat D.
Posts: 531
Joined: Wed Nov 10, 2004 5:56 pm
Location: Pennsylvania, USA

Postby Pat D. » Tue Nov 20, 2007 9:11 pm

I can NOT for the life of me find that Import folder (that entire string actually)...I'm running XP...

pat!

Agamemnus
Posts: 2081
Joined: Mon Feb 20, 2006 4:21 am

Postby Agamemnus » Tue Nov 20, 2007 9:14 pm

You have to start the game first. Then it will unpack the pack and create all the necessary files.

Pat D.
Posts: 531
Joined: Wed Nov 10, 2004 5:56 pm
Location: Pennsylvania, USA

Postby Pat D. » Tue Nov 20, 2007 9:15 pm

So do I need to physically create the folder string Mike mentioned?

pat!

Kuplo
Posts: 1041
Joined: Wed Sep 01, 2004 10:45 pm
Location: CityBuilderGames.com
Contact:

Postby Kuplo » Tue Nov 20, 2007 9:16 pm

Is this the folder you are looking for Pat!?

C:\Documents and Settings\All Users\Application Data\SimCity Societies\Import

That's where the xml files get put after installing an SCSPack file which I install simply by double clicking on them wherever they reside on my hard drive. But they remain as .spspack files until the game is launched at which time it unpacks them and installs all the included files to where they need to go and just leaves behind the xml file in the C:\Documents and Settings\All Users\Application Data\SimCity Societies\Import folder.

Tinkerbell
Posts: 5415
Joined: Fri Sep 07, 2007 3:42 am
Location: San Diego, California
Contact:

Postby Tinkerbell » Tue Nov 20, 2007 9:18 pm

Pat!, "Application Data" is a hidden folder. I am computer stupid, so don't necessarily trust what I post about this stuff.

Last year, I was told how to turn them on so I can see them. Hope this helps.

EDIT ~ My pathway is exactly the same as Kuplo's. XP Home for me.
Last edited by Tinkerbell on Tue Nov 20, 2007 9:22 pm, edited 1 time in total.

Pat D.
Posts: 531
Joined: Wed Nov 10, 2004 5:56 pm
Location: Pennsylvania, USA

Postby Pat D. » Tue Nov 20, 2007 9:19 pm

Kuplo, I swear i don't have that folder :eek: I feel like an idiot, I'm searching for a folder that HAS to be there but damn!!!!
pat!


Return to “Mods (Files)”

Who is online

Users browsing this forum: No registered users and 2 guests