Build Item Availability Question
I want my 15 rapid-fire quantum torpedo launchers Uber-Defiant now! - Get help from modders. Share your work. Discuss modifications.
posted on February 15th, 2015, 6:52 pm
Is there some way to set multiple parents on a builditem? For instance, could I set it so that builditem0 stops being available when either builditem1 or builditem2 becomes available?
posted on February 15th, 2015, 7:35 pm
Either-or functionality is only really 'easily' doable with V4 techtree functionality.
You can do either or functionality in V3 with some replaceweapon tricks, but it's ugly. E.g. have your builditem0 depend on objectZ, which is automatically brought into existence when builditem1 or builditem2's tech requirement object is built.
In other words, builditem1 or builditem2's tech requirement object has a replaceweapon which calls objectZ into your game, on which builditem0 is reliant.
You can do either or functionality in V3 with some replaceweapon tricks, but it's ugly. E.g. have your builditem0 depend on objectZ, which is automatically brought into existence when builditem1 or builditem2's tech requirement object is built.
In other words, builditem1 or builditem2's tech requirement object has a replaceweapon which calls objectZ into your game, on which builditem0 is reliant.
posted on February 15th, 2015, 8:52 pm
Not pretty, but a neat trick. Thanks. I was actually asking about it as a single component of a larger problem in the project I'm working on and your suggestion gave me the idea of how to do the whole thing.
The basic idea is that upgrades would be applied via replace weapon (with resource cost) on existing ships as a retro-fitting mechanic rather than magically propagating upgrades to units as in traditional RTS mechanics while making new ships include the upgrades for free. Basically, realism. My plan was to hopefully do this via builditemavailability, but probably by upgrading/replacing the yards themselves.
What I currently have down, though have not tested yet, is this:
builditem0 = shipA_00
builditem1 = shipA_10
builditem2 = shipA_01
builditem3 = shipA_11
builditem4 = resflag00
builditem5 = resflag10
builditem6 = resflag01
The _XX is upgrade status. _00 is with no upgrades, _10 is with one upgrade, _01 is with the other upgrade, and _11 is with both upgrades.
resflag00 is granted via replace weapon from both the upgrade10 and upgrade 01 pods
resflag00 has fleetcap of 1
resflag10 is granted via replace weapon from upgrade10
resflag10 has upgrade10 as tech prerequisite
resflag01 is granted via replace weapon from upgrade01
resflag01 has upgrade01 as tech prerequisite
resflag10 and 01 are in same fleetcap with limit 2
builditem0availability = 32 //hide when resflag00 cap met, ie: item1 or item2 is available
builditem0availabilityparent = 4
builditem1availability = 40 //hide when tech reqs not met (8) and hide when resflag10/01 cap met (32)
builditem1availabilityparent = 5
builditem2availability = 40 //hide when tech reqs not met (8) and hide when resflag10/01 cap met (32)
builditem2availabilityparent = 6
builditem3availability = 8 //hide until requirements met
builditem4availability = 12 //always hide research flags
builditem5availability = 12
builditem6availability = 12
So it should start with just shipA_00 available, then show only either shipA_10 or shipA_01 when either upgrade10 or upgrade01 is researched, then, after both are researched, it would show only shipA_11. That's the plan, anyway. It will take a bit to implement and test.
The basic idea is that upgrades would be applied via replace weapon (with resource cost) on existing ships as a retro-fitting mechanic rather than magically propagating upgrades to units as in traditional RTS mechanics while making new ships include the upgrades for free. Basically, realism. My plan was to hopefully do this via builditemavailability, but probably by upgrading/replacing the yards themselves.
What I currently have down, though have not tested yet, is this:
builditem0 = shipA_00
builditem1 = shipA_10
builditem2 = shipA_01
builditem3 = shipA_11
builditem4 = resflag00
builditem5 = resflag10
builditem6 = resflag01
The _XX is upgrade status. _00 is with no upgrades, _10 is with one upgrade, _01 is with the other upgrade, and _11 is with both upgrades.
resflag00 is granted via replace weapon from both the upgrade10 and upgrade 01 pods
resflag00 has fleetcap of 1
resflag10 is granted via replace weapon from upgrade10
resflag10 has upgrade10 as tech prerequisite
resflag01 is granted via replace weapon from upgrade01
resflag01 has upgrade01 as tech prerequisite
resflag10 and 01 are in same fleetcap with limit 2
builditem0availability = 32 //hide when resflag00 cap met, ie: item1 or item2 is available
builditem0availabilityparent = 4
builditem1availability = 40 //hide when tech reqs not met (8) and hide when resflag10/01 cap met (32)
builditem1availabilityparent = 5
builditem2availability = 40 //hide when tech reqs not met (8) and hide when resflag10/01 cap met (32)
builditem2availabilityparent = 6
builditem3availability = 8 //hide until requirements met
builditem4availability = 12 //always hide research flags
builditem5availability = 12
builditem6availability = 12
So it should start with just shipA_00 available, then show only either shipA_10 or shipA_01 when either upgrade10 or upgrade01 is researched, then, after both are researched, it would show only shipA_11. That's the plan, anyway. It will take a bit to implement and test.
Who is online
Users browsing this forum: No registered users and 1 guest