Mod I would like to make but need help starting.

For discussion and help on modding and customizing the game
FomarTHain
Posts: 160
Joined: Mon Oct 02, 2006 6:44 am

Mod I would like to make but need help starting.

Postby FomarTHain » Sun Dec 02, 2007 7:46 pm

I just started a game with the Maintenance Mod and I think it is on the right track, though I think the 5% should be upped. What I would like to do is create a mod that takes away money production for buildings that shouldn't give money. For instance you can make money through the Police Station. That doesn't make sense to me. I'd like to change that. I looked in the xml for that building but nothing jumped out at me.

Here are the contents of the file SC5B Police Station:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<Building ID="Police Station">
  <Type>Workplace</Type>
  <Cost>1200</Cost>
  <portrait>SC5BP_PoliceStation</portrait>
  <PortraitCard>SC5BPC_PoliceStation</PortraitCard>
  <Special_hours>Workday</Special_hours>
  <Special_days>Full_Week</Special_days>
  <Visit_Duration>Full_Day</Visit_Duration>
  <Sim_cash_pay>100</Sim_cash_pay>
  <Happiness_effects>0</Happiness_effects>
  <Max_population>8</Max_population>
  <Spawn class="SC5 Class Police" />
  <Operational_Priority>0</Operational_Priority>
  <IdeaXPAmount>0</IdeaXPAmount>
  <!--Add Any new Data above this line-->
  <!--Objects Table Data-->
  <Ability type="ImmuneToRogues" param="immunityflag=Protesting" />
  <FigureBubbleZOffset>3</FigureBubbleZOffset>
  <TileWidth>5</TileWidth>
  <TileHeight>5</TileHeight>
  <InnerCollisionSphere>7</InnerCollisionSphere>
  <MiniMapColor>Workplace</MiniMapColor>
  <UISelectionSet>SC5BuildingCardView</UISelectionSet>
  <Model>sc5b_Police_Station</Model>
  <RecycleRefund>600</RecycleRefund>
  <CanBeDeleted>True</CanBeDeleted>
  <Ground_texture>1</Ground_texture>
  <ObjectSoundSet>police_station</ObjectSoundSet>
  <RubbleModelFinal>SC5BC_10x10</RubbleModelFinal>
  <BurntModel>SC5BC_10x10</BurntModel>
  <BuildingAction type="activated_cooldown" Resource="money" amount="1000" action_object_name="BACT_RiotControl" param="state=Furious|Hooligan|Burglar|Pickpocket|Arsonist|Vigilante;amount=5;bringtohere=false" />
  <BuildonElevation>true</BuildonElevation>
  <BuildingBase model="SC5BB_Urban_10x10x2" mindif="0" maxdif="1" />
  <BuildingBase model="SC5BB_Urban_10x10x4" mindif="1" maxdif="2" />
  <BuildingBase model="SC5BB_Urban_10x10x6" mindif="2" maxdif="6" />
  <PropSet>Police_Station</PropSet>
  <Resource resource="Obedience" quantity="-3" />
  <Resource resource="Power" quantity="-10" />
</Building>


Is there anoher place I should look?

Here is the building data in game.

Image

Any nays about this idea?

Grumpus
Posts: 366
Joined: Wed May 05, 2004 9:36 pm
Contact:

Postby Grumpus » Sun Dec 02, 2007 7:57 pm

Just a guess:

Delete or alter the line:

<Sim_cash_pay>100</Sim_cash_pay>

That's where the weekly income comes from: 8 sims x 100 x 7 days = 5600

FomarTHain
Posts: 160
Joined: Mon Oct 02, 2006 6:44 am

Postby FomarTHain » Sun Dec 02, 2007 8:00 pm

Grumpus wrote:Just a guess:

Delete or alter the line:

<Sim_cash_pay>100</Sim_cash_pay>


That's what I was thinking too until I looked at the building stats in game. The building produces $5600 a week for 8 workers so what is that 100? A multiplier? What is multiplying?

Grumpus
Posts: 366
Joined: Wed May 05, 2004 9:36 pm
Contact:

Postby Grumpus » Sun Dec 02, 2007 8:10 pm

The 100 figure is not a multiplier. It represents the amount each worker at the station pays in taxes each day. So 8 employees x 100 simoleons per day x 7 days per week = 5600. I'll bet that if you reduce that 100 to 0, you'll stop getting any income from the station.

PsYChoWaTrMelon
Posts: 42
Joined: Mon Nov 26, 2007 11:06 pm
Location: IL, USA

Postby PsYChoWaTrMelon » Sun Dec 02, 2007 8:27 pm

<Sim_cash_pay>: Numerical value, defines the amount of money Sims earn for the player each
day at work.
Ex. <Sim_cash_pay>10</Sim_cash_pay>



From \Data\XMLDb\Game\Objects\Buildings\XML Building.txt

so i concur with grumpus.


you may want to add a negative value if you wish to have a cost per sim
working kinda like an upkeepper Sim.

FomarTHain
Posts: 160
Joined: Mon Oct 02, 2006 6:44 am

Postby FomarTHain » Sun Dec 02, 2007 8:52 pm

Thanks guys.

I have changed the value and placed it in :

<dive>All Users\Application Data\SimCity Societies\Data\XMLDb\Game\Objects\Buildings

Is that correct place? It doesn't seem to be working. I will play with it some more.

I started thinking though what if another mod wants to edit this building. How can the two files be placed in the same directory?

EDIT: I tried changing the portrait attribute just to see if my change was registering in the game and its not. The portrait remained that of the police station. Perhaps as I asked above I have this placed in the wrong directory? Or maybe I need to change another value in another file?
Last edited by FomarTHain on Sun Dec 02, 2007 8:56 pm, edited 1 time in total.

PsYChoWaTrMelon
Posts: 42
Joined: Mon Nov 26, 2007 11:06 pm
Location: IL, USA

Postby PsYChoWaTrMelon » Sun Dec 02, 2007 8:56 pm

FomarTHain wrote:Thanks guys.

I have changed the value and placed it in :

<dirve>All Users\Application Data\SimCity Societies\Data\XMLDb\Game\Objects\Buildings

Is that correct place? It doesn't seem to be working. I will play with it some more.

I started thinking though what if another mod wants to edit this building. How can the two files be placed in the same directory?


actually from what i have read is must be in the <drive>%SC5install%\Data\XMLDb\Game\Objects\Buildings
but that would overwite the original. unless i am wrong about where it should be placed.
unless someone found a way to just put them in the import folder like a scspack

FomarTHain
Posts: 160
Joined: Mon Oct 02, 2006 6:44 am

Postby FomarTHain » Sun Dec 02, 2007 9:09 pm

PsYChoWaTrMelon wrote:actually from what i have read is must be in the <drive>%SC5install%\Data\XMLDb\Game\Objects\Buildings
but that would overwite the original. unless i am wrong about where it should be placed.
unless someone found a way to just put them in the import folder like a scspack


That is odd then as the "extra" buildings that came with the patch are in the directory that I placed my file and they have the same properties. Also the SC5B Maintenance Center building from the Maintenance Mod is in that directory as well. Oddly enough the Savings and Loan Building is in there as well and not in the SCS main building directory.

So there must be someway to mash it in there.

PsYChoWaTrMelon
Posts: 42
Joined: Mon Nov 26, 2007 11:06 pm
Location: IL, USA

Postby PsYChoWaTrMelon » Sun Dec 02, 2007 9:21 pm

well i'd say drop it in there then lol and see what happens haha
i have yet to even mess with it i have been looking so i can
see what i want to add.

TreyNutz2
Posts: 33
Joined: Mon Nov 19, 2007 4:26 pm

Postby TreyNutz2 » Sun Dec 02, 2007 9:32 pm

That is odd then as the "extra" buildings that came with the patch are in the directory that I placed my file and they have the same properties. Also the SC5B Maintenance Center building from the Maintenance Mod is in that directory as well. Oddly enough the Savings and Loan Building is in there as well and not in the SCS main building directory.

So there must be someway to mash it in there.


There are some tags in the xml files that are not properly read from xml files in the mod directory. I know venue times are not, but <Cost>1200</Cost> is. I would assume your issue is just another example of the modding needing to be fixed. You seem to be doing everything right. See this post:

http://www.tiltedmill.com/forums/showpost.php?p=174996&postcount=9

Particularly the last line.

For now, rename your edited xml and begin the name with 'z' and just add it to the install directory (and keep the original there). The mod will work and you won't have to worry about where the original is. Later, after this gets patched, you can move all your edited xmls to the mod directory. This is working for me for the time changes I've made to a few venues.

Oh, I'm pretty sure the Savings and Loan is from the first update (along with the hydrogen power plant).
Last edited by TreyNutz2 on Sun Dec 02, 2007 9:35 pm, edited 1 time in total.

FomarTHain
Posts: 160
Joined: Mon Oct 02, 2006 6:44 am

Postby FomarTHain » Sun Dec 02, 2007 9:49 pm

I replaced the master file and it worked. At least the values changed. But it still calculated the money made as if it wasn't changed. I think the changes I made were just cosmetic. It says $0 dollars on the card after my changes (and the portrait changed) but like I said it still claculates.

Plus and even more odd though I managed to change the value and the portrait the building disappeared from the build menu. I had one already built when I saved the game so that one was ok. But when I deleted it to place another and see if that changed anything there wasn't a police building in the list anymore that I could place. I sorted, scrolled and looked and it definately wasn't there.

When I exited and moved a copy of the orginal building xml file the changes were reversed and the building appeared in the list again.

Any thoughts?

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

Postby Tinkerbell » Sun Dec 02, 2007 11:46 pm

I will add something here, part from what I think I know & part from the game guide (that may no longer be correct).

Your $100/worker/day.

This is affected by the happines of the working Sim & the game card display is based on the "content" Sim. The amount we actually get ranges from $50 for a sad Sim up to $125 for an "estatic" Sim. this is from my Labs & also verified in the game guide. The card doesn't change. However, there are actions & special Sim effects that can also change the money we get & these ARE displayed on the building card.

Now, here's the interesting part. The game guide indicates that the standard amount on the building card doesn't change with difficulty setting, but it really does change the per worker (in addition thus the amount also determined by happiness of the worker) amount. (pg 8-9)

The happiness number on the building card also doesn't change with difficulty (Homes for example), but it really does in the game (pg 8-9 & 23). Again, however, happiness on Venues can change by actions or special Sims & this is something different. A Decorator (Special Sim) visit, for example can change the Happiness of a venue & this DOES show on the building card.

Anyway, if you are playing using slum homes on challenging, +3 happiness venues are just not good enough. +7s are VERY kewl, especially if you make them desirable by adding to their appeal with Baroque Fountain decorations. ;)

FomarTHain
Posts: 160
Joined: Mon Oct 02, 2006 6:44 am

Postby FomarTHain » Mon Dec 03, 2007 12:45 am

Tinkerbell wrote:I will add something here, part from what I think I know & part from the game guide (that may no longer be correct).

Your $100/worker/day.

This is affected by the happines of the working Sim & the game card display is based on the "content" Sim. The amount we actually get ranges from $50 for a sad Sim up to $125 for an "estatic" Sim. this is from my Labs & also verified in the game guide. The card doesn't change. However, there are actions & special Sim effects that can also change the money we get & these ARE displayed on the building card.

Now, here's the interesting part. The game guide indicates that the standard amount on the building card doesn't change with difficulty setting, but it really does change the per worker (in addition thus the amount also determined by happiness of the worker) amount. (pg 8-9)

The happiness number on the building card also doesn't change with difficulty (Homes for example), but it really does in the game (pg 8-9 & 23). Again, however, happiness on Venues can change by actions or special Sims & this is something different. A Decorator (Special Sim) visit, for example can change the Happiness of a venue & this DOES show on the building card.

Anyway, if you are playing using slum homes on challenging, +3 happiness venues are just not good enough. +7s are VERY kewl, especially if you make them desirable by adding to their appeal with Baroque Fountain decorations. ;)


Lotta info there. I will have to think about that for a while.

Maybe what I need to do is just lower the amount the building makes vs. null it completely and leave it to that to get the (relatively) same effect.

Still need to figure out why my settings aren't working in the over-ride folder. Maybe Mike can tell me whats up and what I am doing wrong. *hint hint* ;)

FomarTHain
Posts: 160
Joined: Mon Oct 02, 2006 6:44 am

Postby FomarTHain » Mon Dec 03, 2007 1:06 am

I've been looking over the Maintenance Mod and it appears you define the building in the import directory and specify where the needed files are located. So I tried to create my own definition.

Is this right? It is a hybrid Maintenance Mod definition and mine since the category attributes are the same.

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<Package>
<FileAdd name="Localization\en_us\PSNoIncomeText.xml" />
<FileAdd name="Localization\en_us\ObjectText\PSNoIncomeText.xml" />
<FileAdd name="Data\XMLDb\Categories\SCM All.xml" />
<FileAdd name="Data\XMLDb\Game\Metrics\SCM Capitalist Metric.xml" />
<FileAdd name="Data\XMLDb\Game\Metrics\SCM Small Town Metric.xml" />
<FileAdd name="Data\XMLDb\Game\Metrics\SCM Contemplative Metric.xml" />
<FileAdd name="Data\XMLDb\Game\Metrics\SCM Cyberpunk Metric.xml" />
<FileAdd name="Data\XMLDb\Game\Metrics\SCM Fun City Metric.xml" />
<FileAdd name="Data\XMLDb\Game\Metrics\SCM Industrial Metric.xml" />
<FileAdd name="Data\XMLDb\Game\Metrics\SCM Orwellian Metric.xml" />
<FileAdd name="Data\XMLDb\Game\Metrics\SCM Romantic Metric.xml" />
<FileAdd name="Data\XMLDb\Game\Metrics\SCM Normal Metric.xml" />
<FileAdd name ="Data\XMLDb\Game\Objects\Buildings\SC5B Police Station.xml" />
</Package>


Does this mean buildings are handled like classes? That is if you don't explicitly give values to a buildings attribute the default values kick in for those/that attribute(s)?

TreyNutz2
Posts: 33
Joined: Mon Nov 19, 2007 4:26 pm

Postby TreyNutz2 » Mon Dec 03, 2007 1:14 am

I just did some experimenting. I copied the police station file, renamed it to zTest Police Station.xml and left it in the install directory.

I set up a small town with one police station (8 jobs), 1 pueblo house (2 workers), 1 trailer park house (6 workers), a few venues and enough decorations to make everything work. I ran the game for a day or so then saved at about 5am just before everyone started to go to work. 6 sims were happy, and 2 were elated. I modified the <Sim_cash_pay>100</Sim_cash_pay> line and loaded up the game, let sims go to work and noted how much money I made, exited without saving, and repeated with different values.

Results:

100 - +365 and +545 for a total of +910. I have no idea why I got 2 separate numbers, maybe each number was for each class of sims (happy vs elated) or one was the base and the 2nd a bonus? Dunno.

10 - +81 and +11 for a total of +92. Some rounding going on I guess, but it's almost 1/10th of the 100 setting.

1 - +12 and +4 in one case, +8 and +8 in another. Both times +16 total. Maybe rounding errors explain why it's not +9

200 - +1600 and +220 for a total of +1820 (exactly double the 100 setting)

0 - no cash added to the funds.

-100 - no numbers popped up to show anything was taken away, but the cash was reduced by 910. Negative numbers seem to work in this tag, but they do not cause a nice red -910 to pop up above the treasury number.

Then I moved the file to the mod directory, which in Vista is C:\Program Data\SimCity Societies\Data\XMSDb\Game\Objects\Buildings and set the value to 0.

The game did not read the changed tag, but this isn't much of a surprise from what FomarTHain has said and from Mike Lattiak's comments in the post I linked to. The values I got in multiple reloads was odd though:

+800 +110
+455 +455
+365 +545

All add up to +910. Why the amount is given as 2 different numbers and different every time? I have no idea.

edit: the info card did show the correct amounts. Like §0 when I set the amount to 0 and §-5600 when I set it to -100.
Last edited by TreyNutz2 on Mon Dec 03, 2007 1:30 am, edited 1 time in total.

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

Postby Tinkerbell » Mon Dec 03, 2007 1:24 am

FomarTHain wrote:Lotta info there. I will have to think about that for a while.


All I was try to do was add information for you to consider. There is a lot more. ;)

Sometimes things are simple & sometimes not. Your $5600 might just be a label & this is why it doesn't change, as it doesn't change with difficulty as per the game guide (If the game guide is correct here. This part I haven't checked).

I am not a modder, but I used to do some coding in a prior life.

Good Luck!

TreyNutz2
Posts: 33
Joined: Mon Nov 19, 2007 4:26 pm

Postby TreyNutz2 » Mon Dec 03, 2007 1:45 am

FomarTHain wrote:Does this mean buildings are handled like classes? That is if you don't explicitly give values to a buildings attribute the default values kick in for those/that attribute(s)?


I deleted the entire <Sim_cash_pay>100</Sim_cash_pay> line and the game showed §0 on the info card and I got no money at the end of the day. It doesn't seem like there is any default value if you don't explicitly state one (or the default value is 0).

Also, you don't need to make a package xml file and place it in the Import folder to get a mod to work. That's only necessary if you are creating an SCSpack file. (To create the SCSpack file you put your package xml in the Export directory.) To install, you put the SCSpack file in the Import directory and the game uses your package xml file to tell it where to put the files of your mod so they go into the proper folders in the mod folder. It leaves a copy of the package xml in the Import directory but that file is not required for the mod to work. (For clarification, the 'package xml' I'm referring to in the one with the package and FileAdd name tags. I don't know what else to call it.)

It's good to see that you are attempting to mod. I thought about creating a mod so than no government buildings would generate any income, or better yet cost money. But until the game is properly patched I'm not really motivated.

I think you could clone the police station though, and get your modified version to work in the mod directory that way. I haven't tried to do that so I'm not sure how involved that is.

FomarTHain
Posts: 160
Joined: Mon Oct 02, 2006 6:44 am

Postby FomarTHain » Mon Dec 03, 2007 2:00 am

Tinkerbell wrote:Sometimes things are simple & sometimes not. Your $5600 might just be a label & this is why it doesn't change, as it doesn't change with difficulty as per the game guide (If the game guide is correct here. This part I haven't checked).


It does change based on my experiments but until TreyNutz2 ran his calculations I wasn't sure it was actually affecting the cash made. Seems now that it is.

The info is always welcome. But you are a hard core number cruncher so it takes me a while to catch up. When I had questions in CotN you had those numbers ready as well. :p

Something else needs to be done to curtail the money in the game. You still get way way to much to fast to easily. I am using the maintenance mod and its still to much. I boosted that one up to 10% and it was better. But the problem is once you start rolling with some positive cash flow it adds up so quick. And you can start rolling in the cash very early. Until late in the game (scenario) I felt like you always had to watch your money in CotN and CIV. I think the game should feel like that. Course that is just my opinion.

Would be interested to hear what others think though.

FomarTHain
Posts: 160
Joined: Mon Oct 02, 2006 6:44 am

Postby FomarTHain » Mon Dec 03, 2007 2:01 am

TreyNutz2 wrote:I think you could clone the police station though, and get your modified version to work in the mod directory that way. I haven't tried to do that so I'm not sure how involved that is.


*nods* That is what I was thinking as well. Since the Sim_cash_pay attribute requires some calculations I tried a more simple change. I tried again to just change the portrait on the card. I got it to work changing the master police xml file. Trying to duplicate the file in the mod directory didn't do it though.

Did you have any problems with the building not appearing in the build list? I had it disappeared as I said above. When I changed it back it showed up again.

Dunno. Didn't think about the patch changing the modding process. That's a good point. Probably need to hold off as well.

I was wondering how you create a SCSPack file. Thanks for that.

TreyNutz2
Posts: 33
Joined: Mon Nov 19, 2007 4:26 pm

Postby TreyNutz2 » Mon Dec 03, 2007 2:35 am

The police station was in the build list when I had the Sim_cash_pay line set to 10. I didn't check every setting though. I did not make any other edits to the file.

I am starting to think that it's probably better to clone buildings anyway if all we want to do is change some of the properties, especially if we are going do distribute our mods. That way our mod won't conflict with anyone else's mod that tries to change different properties, or the same properties in a different way.

Also, people who install our mod won't be locked into using it but will be able to use the game's default version if they want. Removing mods isn't easy at the moment (although this could change) so it might be better not to change the default buildings but to clone them instead and then change the properties in the cloned version. Having duplicate buildings with different properties doesn't sound too great but it might be the better way to go in the long run.

I'm not quite sure what the best approach is, although at this time it's almost a moot point.


Return to “Mods (Discussion)”

Who is online

Users browsing this forum: No registered users and 1 guest