Logo Platform
logo amplifiers simplified

Faction traits again

Reply
Copied to clipboard!
12 years ago
Feb 3, 2013, 2:37:07 PM
I've made a faction trait that should, say, give an additional unit of Food per each system improvement built. When I look at it in customization screen, it looks okay, showing correct "+1smiley: food per improvement on star system", but, when I start playing and build an improvement to test it, no additional food is generated and nothing in system overview shows the modifier. Here's how I made this in EmpireTraitDescriptor.xml:

[CODE]


OperationType="Addition"

BinaryOperationType="Multiplication"

Right="$(StarSystemImprovement)"

Left="1"

Path="ClassEmpire/ClassStarSystem"

BindOnSource="false"/>



[/CODE]

Does anyone know what I might've done wrong?
0Send private message
12 years ago
Feb 8, 2013, 5:19:45 AM
after a few days modding i'm still not sure, but is starsystemimprovements really a number? i didn't see that anywhere, maybe that's the problem?
0Send private message
12 years ago
Feb 8, 2013, 6:02:56 AM
It's "StarSystemImprovement", not "StarSystemImprovements", a valid key from StarSystemImprovementDescriptor.xml
0Send private message
12 years ago
Feb 8, 2013, 12:42:27 PM
it's a typo~ still not see it in anywhere? are you sure it has been used as targetproperty anywhere? can you paste the code for me?
0Send private message
12 years ago
Feb 8, 2013, 1:45:31 PM
yorkgrass wrote:
it's a typo~ still not see it in anywhere? are you sure it has been used as targetproperty anywhere? can you paste the code for me?


Of course. Here, lines 22 to 32 from /Simulation/StarSystemImprovementDescriptor.xml

[CODE]























[/CODE]



From which I conclude that any type is a valid target. Anyhow, it does display the correct generated tooltip.
0Send private message
12 years ago
Feb 8, 2013, 2:22:34 PM
Hisu wrote:


From which I conclude that any type is a valid target. Anyhow, it does display the correct generated tooltip.


If it's true, then I don't know why, but from what I see, there are a lot of "type" can not be quantified for example, "TraitAlignment", and all the tech types? tooltips may understand it, becasue they just copy the word when it is a key, but whith "$()", I'm not sure it means anything to the computer?



well, I'm just a beginner in modding, so forgive me if I'm wrong¬
0Send private message
12 years ago
Feb 8, 2013, 4:13:35 PM
Unfortunately yorkgrass is correct. There are lots of examples of mods which "compile" (ie the game starts up with no error) but do not "work". There are many uses of scope which would be nice, but have no effect. Please look into some of the older threads with the word "scope" to see more examples. This is usually quite disappointing; many behaviors we would like are hardcoded, and not moddable.
0Send private message
12 years ago
Feb 8, 2013, 10:27:42 PM
Oh thats easy, the variable StarSystemImprovement isn't defined so your trait doesn't do anything. Make a Empire level variable that is defined at the ClassStarSystem level. Actually, on top of that your variable doesn't even exist so you need to define the variable at the system level and add a method of increasing said variable for every structure built.



Reference my ForwardedNumberofWars discussion with Thor



Edit2: highly recommend you forget the trait part until you can make a building work on the system level before you start carrying variables up to the empire level. Basically learn crawl before you try to run smiley: wink system -> empire is a... annoying variable chain.
0Send private message
12 years ago
Feb 8, 2013, 11:05:50 PM
iblise wrote:
Reference my ForwardedNumberofWars discussion with Thor


Can you link it here, please? Search returns this:

[code]The following words are either very common, too long, or too short and were not included in your search:

ForwardedNumberofWars[/code]
0Send private message
0Send private message
12 years ago
Feb 8, 2013, 11:48:11 PM
davea wrote:
Iblise is the one who found most of these issues. If you search for threads started by iblise, you will find many interesting things. I was also not able to find the exact thread but it is probably this one:

/#/endless-space/forum/37-modding/thread/15814-mon-cher-thortillas-2-0


So in Hisu's case, u have to create a TargetProperty "StarSystemImprovement", and let it equals the number of improvement you build on the system, but how to let the code count the number of improvements? or is there already a key stating this?
0Send private message
12 years ago
Feb 9, 2013, 12:12:45 AM
Create a variable at system level and give each build a line that increase said variable. Only way that comes to mind, I'm not aware of any method to count buildings existing in game currently. It's an ugly work around unfortunately.
0Send private message
12 years ago
Feb 9, 2013, 12:22:03 AM
iblise wrote:
Create a variable at system level and give each build a line that increase said variable. Only way that comes to mind, I'm not aware of any method to count buildings existing in game currently. It's an ugly work around unfortunately.


Very clever! I didn't think of that! But it's too much coding, and I'm too lazy. Hope Hisu will have the time and strength!
0Send private message
12 years ago
Feb 9, 2013, 4:07:07 AM
*maybe* try experimenting with $(count) in a SimulationObjectPropertyBinaryModifierDescriptor
0Send private message
?

Click here to login

Reply
Comment