Extending the generic property system

@DH: Could you please add links to all of AIAndy's Extended Property System tutorials in the stickied Modders Documentation thread? I'm pretty sure that these will soon get buried, and it would be nice to have links to them in one convienent location. Thanks.

Done three hours ago for the latest. The other one was done on the day it was posted too :D To be honest if I don't do the link when I first see it I forget so now I make sure I do. ;)
 
Lets try to get crime done before the freeze.

For sources I'd say use a source that adds 1 per population in addition to the crime that crime buildings add.

Have you decided which buildings you want to autobuild depending on crime in a city yet (which then apply the negative effects), Hydro?

The change of all the current crime and law buildings to being property sources needs to be somewhat one step as the way it is now is incompatible to a drain/source property.
Maybe we should use SVN branching here so the main branch is not disturbed while the crime property is transferred to the new system step by step.
 
Lets try to get crime done before the freeze.

I am still confused on what exactly I would put for the code. Take for isntance the Chief's Hut. It has a Crime value of -10.

Code:
			<Properties>
				<Property>
					<PropertyType>PROPERTY_CRIME</PropertyType>
					<iPropertyValue>-10</iPropertyValue>
				</Property>
			</Properties>

How would I convert it to your new system? Please just give a converted version. I am still not exactly sure what to put in each field. Especially the decay part.
 
I am still confused on what exactly I would put for the code. Take for isntance the Chief's Hut. It has a Crime value of -10.

Code:
			<Properties>
				<Property>
					<PropertyType>PROPERTY_CRIME</PropertyType>
					<iPropertyValue>-10</iPropertyValue>
				</Property>
			</Properties>

How would I convert it to your new system? Please just give a converted version. I am still not exactly sure what to put in each field. Especially the decay part.
Code:
<PropertyManipulators>
  <PropertySource>
    <PropertySourceType>PROPERTYSOURCE_CONSTANT</PropertySourceType>
    <PropertyType>PROPERTY_CRIME</PropertyType>
    <iAmountPerTurn>-10</iAmountPerTurn>
  </PropertySource>
</PropertyManipulators>

That means it will now generate -10 crime each turn.
The building itself does not need to care about decay unless you want to change it so instead of being a constant source of law (or negative crime) it should instead reduce crime by a percentage each turn.
 
So besides updating all my building schemas I just need to replace the old code (<Properties>) with the new code (<PropertyManipulators>). Correct?

And for a "crime" building it works just the same but without a negative value right?

If so I will start on it and try to get them all converted before the freeze.
 
So besides updating all my building schemas I just need to replace the old code (<Properties>) with the new code (<PropertyManipulators>). Correct?

And for a "crime" building it works just the same but without a negative value right?

If so I will start on it and try to get them all converted before the freeze.
Correct, but don't upload the changes to the SVN until all are changed and at the same time the few additions to the property info need to be done then.
 
@AIAndy

I ran into a problem. What do i do for ...

Code:
			<PropertiesAllCities>
				<Property>
					<PropertyType>PROPERTY_CRIME</PropertyType>
					<iPropertyValue>-5</iPropertyValue>
				</Property>
			</PropertiesAllCities>
For now I'd say replace it by the same source as the others, probably stronger because it no more influences all cities directly.
Currently the code requires for all game objects to be able to find all the sources that influence it and that would not be the case with this one at the moment. I will allow buildings to add global manipulators at some point.
 
For now I'd say replace it by the same source as the others, probably stronger because it no more influences all cities directly.
Currently the code requires for all game objects to be able to find all the sources that influence it and that would not be the case with this one at the moment. I will allow buildings to add global manipulators at some point.

Well we have the following buildings ...

- Police Academy = -25 Crime and -5 Crime in All Cities
- Ordinance - Neighborhood Watch = -10 Crime in All Cities
- Ordinance - Youth Curfew = -5 Crime in All Cities

Also ...

- Alcatraz = -75 Crime and -20 in All Cities

So what should be done? Especially with ones that have both a local and national crime.

EDIT: Should a "Good" be added to them so a free building is added to every city? In other words if you pass the "Youth Curfew" you get a free building in every city that gives -5 Crime per turn?
 
Well we have the following buildings ...

- Police Academy = -25 Crime and -5 Crime in All Cities
- Ordinance - Neighborhood Watch = -10 Crime in All Cities
- Ordinance - Youth Curfew = -5 Crime in All Cities

Also ...

- Alcatraz = -75 Crime and -20 in All Cities

So what should be done? Especially with ones that have both a local and national crime.

EDIT: Should a "Good" be added to them so a free building is added to every city? In other words if you pass the "Youth Curfew" you get a free building in every city that gives -5 Crime per turn?
That is actually the easiest solution. And a good one.
 
Ok I will remove the old <PropertiesAllCities> code for now on those 3 buildings and then add the "Goods" later. That way I can upload to the SVN.

Note that Vokarya will still need to do Alcatraz and the Vegas strip. But all he core and my buildings should be converted.

EDIT: Ok. Pushed to the SVN. I will do the goods later when I have some more time. Thanks for your help. Cya!
 
Ok I will remove the old <PropertiesAllCities> code for now on those 3 buildings and then add the "Goods" later. That way I can upload to the SVN.

Note that Vokarya will still need to do Alcatraz and the Vegas strip. But all he core and my buildings should be converted.

Do you really need a good. Why not just the free building?
 
Have you decided which buildings you want to autobuild depending on crime in a city yet (which then apply the negative effects), Hydro?

I have some ideas for new ones that cannot be built (based off sc4) ...

- TPing = +1:mad:
- Graffiti = +1:mad:
- Pie Throwing = +1:), -1:food:
- Flashing = +1:mad:
- Solicitation = +2:mad:
- Purse Snatching = +2:mad:, -1:gold:
- Fighting = +2:mad:, +1:yuck:
- Car Theft = +2:mad:, -2:gold:
- Drugs = +2:mad:, +2:yuck:
- Stick Up = +3:mad:, +1:yuck:
- Assault = +3:mad:, +2:yuck:
- Arson = +3:mad:, +3:yuck:, +10 Flammability
- Bank Robbery = +3:mad:, -3:gold:

What do you think? We would have to assign tech requirements and crime levels, but it should give a variety of crimes.
 
Top Bottom