Logo Platform
logo amplifiers simplified

Per Pop - how to do it?

Reply
Copied to clipboard!
12 years ago
Aug 6, 2012, 9:25:42 PM
Gun and Roses - Civil War - indeed, good music



I've since tried adding the ability to structures and again no joy. I have no idea why, since the coding works for alien esteem tech.
0Send private message
12 years ago
Aug 2, 2012, 3:31:13 PM
I don't know if it is correct but the way I understood bindonsource was that by default it was always on and always true. It adds a property to that specific object when true (which is default) ie the issue I was having with giving a hero a +approval rating base on population is that a hero doesn't have a pop and there while it would display correctly in the description, it wont have any effect. Therefore when I added the false modifier, it then checked for pop base on the object it was assigned to - the planet. Additionally, I sortof confirmed this when I added the same modifiers to supermarket building without the false modifier (I'll double check that when I get home tonight)
0Send private message
12 years ago
Aug 2, 2012, 3:53:52 PM
I don't think that is correct. The difference between the two examples is that the first one uses wit and the second one uses food. They both store their effect into the same place (system). I guess bindonsource=true means to get the value (food) from the destination object (system) rather than the object on which the modifier appears (hero). So without bindonsource=true, it will get the value (food) from the object on which the modifier appears (hero), which results in zero.
0Send private message
12 years ago
Aug 3, 2012, 7:48:41 AM
Yes you're right davea. And by default the behavior is "BindOnSource=true"



At the very beginging of the dev, we create the whole simulation architecture and think that we need to use the "source properties" to resolve the "Value" part of the modifier. Example : The hero add his wit property to the system food.

But in the late development we start getting some request from the designers to add a way to use the "Destination properties" to resolve the "Value" in defined situation... Example : The hero has a ability which add the food of the system in the industry of the system.



So we create the "BindOnSource" attribute and set its default at "true" to avoid modifying all our already build modifiers...



[Code]











[/Code]



BindOnSource = true -> Find the "Value" property on the source object of the modifier (in the example Hero) (This is the default behavior. When you do not add the attribute "BindOnSource", we use as if you set it to "true".)

BindOnSource = false -> Find the "Value" property on the destination object of the modifier (in the example StarSystem, which won't work because star system does not have a "Wit" property.)



Is it clearer?
0Send private message
12 years ago
Aug 3, 2012, 1:43:00 PM
Yes, it is clear now. Use bindonsource=false to get the property from the destination object. Otherwise the property comes from the source object.
0Send private message
12 years ago
Aug 6, 2012, 12:45:34 AM
[CODE]







[/CODE]



Any ideas why the above isn't working? It displays correctly in the tooltip, but the effect is never applied. I've tried a variation of paths and with and without bindonsource
0Send private message
12 years ago
Aug 6, 2012, 4:04:03 AM
iblise wrote:
[CODE]







[/CODE]



Any ideas why the above isn't working? It displays correctly in the tooltip, but the effect is never applied. I've tried a variation of paths and with and without bindonsource




Uhm, I would recommend trying following things:

Try what happens if path points to entire empire, if it works you know that problem is that in solarsystem level calling function NumberofWars isn't possible.



Basically if I read what you try correctly your HeroAbilityAdminstrator04 tries to calculate number of wars in solarsystem level (you know with or without bindonsource it still should checks in this case solarsystem) and then calculates that number by 5.



My quess is that War is something what affects to empire and solarsystems just doesn't understand it. Only way to check whether I am correct or not is to do that check what I suggested.
0Send private message
12 years ago
Aug 6, 2012, 4:39:01 AM
Nope, do not collect 200, do not pass go, go directly to jail.



Classempire still results in no effect, it is so frustrating, the coding works perfectly in alien estem (deep dipolmacy tree tech) but yet refuse to work on a hero...
0Send private message
12 years ago
Aug 6, 2012, 9:36:33 AM
iblise wrote:
Nope, do not collect 200, do not pass go, go directly to jail.



Classempire still results in no effect, it is so frustrating, the coding works perfectly in alien estem (deep dipolmacy tree tech) but yet refuse to work on a hero...




What we have here is (you know that you have listened too much good music when you are about to write: failure to communicate) prime example of hardcoded stuff.



I wanted you to check that thing just because IF it works game recognizes factor called number of wars atleast in empire level.

Sadly it doesn't which means that a) there is other things what affects to it and it's not that easy or b) it's really hard to do via simple xml coding.
0Send private message
12 years ago
Aug 2, 2012, 2:18:14 PM
I still don't understand BindOnSource. In your two examples above, can you describe what would happen differently for each example if I reversed the setting?
0Send private message
12 years ago
Aug 13, 2012, 8:52:26 PM
ThorTillas wrote:


To add any properties, you will need to create or modify a descriptor declaration. You can find several example by searching for Type="ClassType". All Class descriptor define some properties. There is some other descriptor which do it, but more difficult to find.



So create a descriptor declaration or choose one to edit.

When not already define, add the descriptor section "SimulationObjectPropertyDescriptors" and fill it with all the property you need.



Name: Property name. Must be unique.

Value: Base value or initial value.

IsCompound: Define if the property must sum his children properties. (star system food must sum all planet food property before anything else)

IsCompoundMin: Define if the property must choose the minimal children properties value as initial value.

IsCompoundMax: Define if the property must choose the maximal children properties value as initial value.

IsOutput: Define if the property is a FIMS

MinValue: Define the minimal value for the property. When negative value are allowed, please set it to "Negative".

MaxValue: Define the maximal value for the property.



Then, create or edit the section "SimulationObjectPropertyModifierDescriptors" of the descriptor to use your new property.



Apparently I'm doing something wrong here.



I wanted to add two properties to "ClassStarSystemImprovement".



So i wrote this:



















Now I was thinking this is like a class-definition in C++ and that all the Improvements are Child-Classes of it.



So without modifying this value yet I thought that using

$(ClassStarSystemImprovement:BuildTime) lt 2

should fail and thus the building not be built since 5 is not less than 2.



Now what's even more strange to me is that I tried to access this value for some kind of debug-information.



I did this:





























and was hoping to see my value instead of the "1" that normally stands there.

But it actually showed me the String "ClassStarSystemImprovement:BuiltTime" when I mouseovered the Improvement. This was also true when I used other Values like $(ClassStarSystem:Industry) for instance. But since this one works correctly as , I figured this must be a different issue.



I've tried so much stuff and yet I'm not even a single step further. I mean I know exactly what I want to do but I can't because I just don't seem to understand that interface. smiley: frown
0Send private message
12 years ago
Aug 13, 2012, 10:59:59 PM
eh I think when you see String "ClassStarSystemImprovement:BuiltTime" or similar stuff, it just means the game is confused (or in some case you strung together a complicated formula and the game can't handle the tooltip display)
0Send private message
12 years ago
Aug 13, 2012, 11:56:27 PM
I don't think it was confused. I just wanted to see what value that variable has and so I replaced something that I know where to see in the game with it. But for some reason it does not display the value of the variable but the name.

It probably does not recognize that this is a variable and thinks it's plain-text.



Or what I think is pretty likely: you cannot access Variables in Description-files anyways.



But that still does not explain why I can't seem to access it the same way I can with $(ClassStarSystem:Industry) gt 50.
0Send private message
12 years ago
Aug 14, 2012, 1:18:20 AM
Yeah, by confused I meant that the game doesn't realize that it is a valid variable (I knew what I meant, honest!) variables seem to be defined in hardcoded files with specific hooks that we don't have access to. I spent rather a while trying to get $(NumberOfMoons) to work with nothing to show for it
0Send private message
12 years ago
Aug 14, 2012, 5:13:38 AM
I wonder, if you add:



[code]







[/code]



later add:



[code]




[/code]



notice this is bad example and doed exactly what Iblise doesn't want... in this examples it multiplies amounts of StarSystems with knowledge whether Moon is explored (and causes hilarious problems) which causes anything but wanted effect.
0Send private message
12 years ago
Aug 14, 2012, 9:56:33 AM
Now can someone confirm or deny that self-added properties can be accessed in the same way e.g. $(ClassEmpire:NumerofMoons) as the ones already existing?



I know I can define them, I know I can do math with them and add them to other values. At least the game does not complain when I try to do it.



But to me it looks like I cannot access them the same way I can with the predefined variables.

I used "Upkeep" which is a predefined in the same class as I intend my "BuildTime" to be in and when I used $(ClassStarSystemImprovement:Upkeep) eq -3 it just worked.

Whereas when I try the same thing with my BuildTime it won't.



So in order to still do what I want I might have to consider misusing one of the existing predefined properties of something else. oO
0Send private message
12 years ago
Aug 14, 2012, 1:00:23 PM
So in order to still do what I want I might have to consider misusing one of the existing predefined properties of something else. oO




mmmm, misuse *starts to drool*
0Send private message
12 years ago
Aug 14, 2012, 1:40:58 PM
When I fleshed out that post, I was kinda craving for someone like you, who has the experience and stamina of penetrating the matter of modding very deeply to come up and let his pent-up knowledge pour out on me.



I hope I managed to avoid drool-impairing ambiguities better this time!
0Send private message
12 years ago
Jul 31, 2012, 4:14:11 PM
Yeah, "simply" was perhaps a little too much ^^



To add any properties, you will need to create or modify a descriptor declaration. You can find several example by searching for Type="ClassType". All Class descriptor define some properties. There is some other descriptor which do it, but more difficult to find.



So create a descriptor declaration or choose one to edit.

When not already define, add the descriptor section "SimulationObjectPropertyDescriptors" and fill it with all the property you need.



Name: Property name. Must be unique.

Value: Base value or initial value.

IsCompound: Define if the property must sum his children properties. (star system food must sum all planet food property before anything else)

IsCompoundMin: Define if the property must choose the minimal children properties value as initial value.

IsCompoundMax: Define if the property must choose the maximal children properties value as initial value.

IsOutput: Define if the property is a FIMS

MinValue: Define the minimal value for the property. When negative value are allowed, please set it to "Negative".

MaxValue: Define the maximal value for the property.



Then, create or edit the section "SimulationObjectPropertyModifierDescriptors" of the descriptor to use your new property.



For now, I have no "out of my mind" idea to add a descriptor on every StarSystem without doing some strange stuff... At least you will be able to edit the "ClassStarSystem" descriptor to add some information in there.



But for the "cap" property, I think you can bypass it by using the build in properties.

MaxSystemPopulation: Define the current colonized max population.

MaxPopulation: Define the theoretical max population with all planet colonized.

Population: Define the current population.

-> Add a rule on all food improvement which say "When population is greater or equals to MaxPopulation * 0.6, then don't build them" for example...



I do not know if it answer to your question or not...



Thanks for reading !

Cheers,

Flo
0Send private message
12 years ago
Jul 29, 2012, 6:59:45 PM
General advice: find another ability which works in a similar way, and see how they did it.

Specific answer: For example,

[code]


OperationType="Addition"

BinaryOperationType="Multiplication"

Right="$(Population)"

Left="12"

Path="ClassEmpire/ClassStarSystem"

BindOnSource="false"/>

[/code]

Adds 12 to system defense per population in system.
0Send private message
?

Click here to login

Reply
Comment