Opps. You're right.Geoff the Medio wrote:You need to have a newline at the end of the file.
OK, how can i write and effect to make a certain species' ships 25% more destructive in battle, or is that possible?
Moderator: Oberlus
Opps. You're right.Geoff the Medio wrote:You need to have a newline at the end of the file.
I don't think that's possible at the moment, for several reasons:eleazar wrote:OK, how can i write and effect to make a certain species' ships 25% more destructive in battle, or is that possible?
Code: Select all
Species
name = "SP_LAENFA"
description = "SP_LAENFA_DESC"
Playable
CanProduceShips
CanColonize
foci = [
[[HAS_FARMING_FOCUS]]
[[HAS_MINING_FOCUS]]
[[HAS_INDUSTRY_FOCUS]]
[[HAS_RESEARCH_FOCUS]]
[[HAS_ADVANCED_FOCI]]
]
effectsgroups = [
[[GREAT_DETECTION]]
[[ULTIMATE_STEALTH]]
[[TERRIBLE_FARMING]]
[[TERRIBLE_MINING]]
[[TERRIBLE_INDUSTRY]]
[[TERRIBLE_RESEARCH]]
[[ADVANCED_FOCUS_EFFECTS]]
[[TERRIBLE_GROUND_TROOPS]]
[[NO_FOOD_USE]]
[[STANDARD_HEALTH_AND_POPULATION]]
]
[[OCEAN_STANDARD_EP]]
graphic = "icons/species/laenfa.png"
Is there a reason species effects can't be applied last instead?Geoff the Medio wrote:I don't think that's possible at the moment, for several reasons:eleazar wrote:OK, how can i write and effect to make a certain species' ships 25% more destructive in battle, or is that possible?
...
More generally, even if effects could usefully modify ship part meters, there's an issue with order of effects being applied... When deciding what effects get applied to what objects, currently the order is: species, specials, techs, buildings, ships (hull of a ship, then parts of the ship). That means all effects related to species in the universe get applied, then all effects related to specials, then techs, etc. For ships, it's the hull of ship 1, then the parts of ship 1, then the hull of ship 2, parts of ship 2, etc.
The consequence of this is that if effects were determining the actual stats of ship parts, there would still be no way to have a species give a 25% boost to those stats because the ship part effects come after the species effects, and thus at the time the species effect could be applied, all ship part meters would be 0.
Effects from various types of sources can be done in any order. I put species first just because it seemed like the "baseline" effects would arise from them, which would be modified by subsequent things like techs or buildings.eleazar wrote:Is there a reason species effects can't be applied last instead?
You can have each tech or building modification have two or more cases, with one case for typical species, and another case for species that are better at whatever the effect is about. This will make the effects breakdown a bit more understandable, rather than +X, +Y, and +Z from various buildings or techs, and then +(X+Y+Z) attributed to the species due to a multiplier.Multiplication seems like the only way to give a species bonus to species that doesn't quickly become nearly irrelevant due to tech increases.
It might be possible to put species (or whatever content type) property references into stringtable entries in some manner, but I'm not sure how this would be useful.Is there something clever with macros and/or code that can make the species description depend on what happens in species.txt with these various distinguishing effects and so-forth?
That's not really possible right now without listing all the species in each effects group (is it?). Could there perhaps be a way to attach arbitrary flags to species such as "HasAwesomeFarming" such that the condition for a building or tech effect could be something like "Species HasAwesomeFarming"?Geoff the Medio wrote:You can have each tech or building modification have two or more cases, with one case for typical species, and another case for species that are better at whatever the effect is about. This will make the effects breakdown a bit more understandable, rather than +X, +Y, and +Z from various buildings or techs, and then +(X+Y+Z) attributed to the species due to a multiplier.Multiplication seems like the only way to give a species bonus to species that doesn't quickly become nearly irrelevant due to tech increases.
You'd presently need to list every affected species, though I think the species-matching condition can take a list of species to check for, so it's not a separate condition for each species.Bigjoe5 wrote:That's not really possible right now without listing all the species in each effects group (is it?).
"Tags" have been proposed to serve a purpose similar to what you describe. There'd presumably be a HasTag name ="WHATEVER_TAG" type condition added.Could there perhaps be a way to attach arbitrary flags to species such as "HasAwesomeFarming" such that the condition for a building or tech effect could be something like "Species HasAwesomeFarming"?
Your prophesy has been fulfilled. I just glanced over shiphulls.txt with the intention of macro-ifying space monster movement, and found that most of the movement effectsgroups are identical except for the probability of moving.Geoff the Medio wrote:Once you get a build of FO that allows recursive macros and start using them, see if you find yourself wanting to use parameters. I suspect they'll be felt necessary quite quickly...
Bigjoe5 wrote:Your prophesy has been fulfilled.Geoff the Medio wrote:Once you get a build of FO that allows recursive macros and start using them, see if you find yourself wanting to use parameters. I suspect they'll be felt necessary quite quickly...
Your situation appears to be a simple case.Geoff the Medio wrote:There's a potential workaround without parameters, which would be to have two macros, one of which has all the text up to the place where the 2 appears, and another that has all the text after that, and then you'd use [[MACRO_BEFORE_NUMBER]]2[[MACRO_AFTER_NUMBER]] to effectively create your own parametrized macros without built-in support for it, but that would be awkward in anything but simple cases.
The classic Alkiri bonus (and it's opposite) seems to be the most important species differentiation we currently can't do. If/once you add the effects, i'll add in species that are better/worse at combat.Geoff the Medio wrote:The whole effects system of FreeOrion has a limitation or incompatibility with modifications of this type (+25%). This is notable because lots of people seem to want to default to using percentage based modifications, when really the FreeOrion effects work better for fixed modifications like +5, or modifications that vary based on things other than the meter being modified and that are persistent between turns. So, +2*population is OK, but +2*target_population is not, as the population is roughly persistent between turns, but target population is recalculated from 0 each turn by adding up all relevant effects. Similarly, +0.25*current_meter_value works differently depending on what other effects have already acted on a particular meter that turn.
That said, if / once part meter effects have been implemented, you could do something in the part itself to give certain species a bonus. For example, the part could have a base damage of 8, and then there could be an effectsgroup for the part to give +2 to the damage if the species of the ship is one of those in a list.