MantisManMike wrote:Instead of selecting just one blueprint, I'd like to select several, and have the changes applied to all of them. I tried using <mod:findComposite>, but couldn't get it to work. Any ideas?
I could just keep copying & pasting the code, but it's getting pretty long.
hopefully I am not too late with this reply,
mod:findComposite format looks like this
Code: Select all
<mod:findComposite>
<mod:par op="OR">
<mod:findName type="shipBlueprint" name="MANTIS_SCOUT" />
<mod:findName type="shipBlueprint" name="REBEL_FAT" />
<!-- works for any find... tags. note that mod:selector can be placed within find... tags here. -->
</mod:par>
<!-- (Make some changes to the Mantis Scout blueprint here) -->
</mod:findComposite>
my "Change all crew to one race" mod does just what you said except to all player ships (
viewtopic.php?f=11&t=30267#p107866, there is a code snippet at the top).
you may have been getting confused by the "AND" used in the readme_modders.txt. it's logical AND (Vhati explains an incorrect usage here:
viewtopic.php?f=12&t=17102&p=114922#p114932). so in most cases you'll want to use OR logic because you want to make the same changes for multiple different things.
I think a possible usage of AND could be to do the same thing to different ships or weapons that share similar attributes. maybe ships that have a certain threshold of health (6 to 9) and a certain power threshold (6 to 9) should have certain systems buffed:
Code: Select all
<mod:findComposite>
<mod:par op="AND">
<mod:par op="OR">
<mod:findWithChildLike type="shipBlueprint" child-type="health"><mod:selector amount="6" /></mod:findWithChildLike>
<mod:findWithChildLike type="shipBlueprint" child-type="health"><mod:selector amount="7" /></mod:findWithChildLike>
<mod:findWithChildLike type="shipBlueprint" child-type="health"><mod:selector amount="8" /></mod:findWithChildLike>
<mod:findWithChildLike type="shipBlueprint" child-type="health"><mod:selector amount="9" /></mod:findWithChildLike>
</mod:par>
<mod:par op="OR">
<mod:findWithChildLike type="shipBlueprint" child-type="maxPower"><mod:selector amount="6" /></mod:findWithChildLike>
<mod:findWithChildLike type="shipBlueprint" child-type="maxPower"><mod:selector amount="7" /></mod:findWithChildLike>
<mod:findWithChildLike type="shipBlueprint" child-type="maxPower"><mod:selector amount="8" /></mod:findWithChildLike>
<mod:findWithChildLike type="shipBlueprint" child-type="maxPower"><mod:selector amount="9" /></mod:findWithChildLike>
</mod:par>
</mod:par>
<mod:findLike type="systemList">
<mod:findLike type="shields">
<mod:setAttributes power="3" />
</mod:findLike>
<mod:findLike type="weapons">
<mod:setAttributes power="3" />
</mod:findLike>
</mod:findLike>
</mod:findComposite>
yeah this looks incredibly verbose but I tried to come up with an example with utility. "multiple nested <par > tags" is basically this combination of AND and OR. it would be great if we could get functionality for logical NOT, because then we could form all the other various logical operators. findWithoutChildLike (negate findWithChildLike) would go such a long way imo. anyways, I hope this answered some questions?