One component that requires another? |
I want to add nuclear engines to the game. Nuclear engines would provide more thrust than Ion Engines but use a similar amount of supplies. The drawback? It requires a certain amount of tonnage before it becomes effective. I was planning on doing this by adding a component "Nuclear Shielding". A ship only needs one Nuclear Shielding component to use Nuclear engines, so it only becomes useful once a certain number of nuclear engines are being used, and thus it fits the bill of being more useful for bigger ships than smaller ships.
I tried mimicking how Ships require Crew Quarters and such, but it seems when I set the "Requirements Evaluation Allows Placement" to the check for "Get_Design_Ability_Component_Count("Nuclear Shielding") = 1", the engine never shows up in the design window, not even after the shielding has been added.
Anyone know any other means?
Re: One component that requires another?
*Double post*
Re: One component that requires another?
Use the Get_Design_Specific_Component_Count function( only works in vehiclesizes ).
I.e.:
iif(Get_Design_Specific_Component_Count("Nuclear Engine") > 0, iif(Get_Design_Specific_Component_Count("Nuclear Shielding") > 0, 1, 0), 1)

Re: One component that requires another?
Nuclear - fusion engines, or fission?
I will pay you money to replace quantum with that.
should hi-energy be a perq to that tech?
and last but not least,
when you say requires tonnage, do you MORE than 10,000 TONS?
Do you REALLY think you will subvert System Vampyre before it subverts YOU?
Re: One component that requires another?
But this formula does not seem to be evaluated. I see the descriptive part of this requirement, but when I add a Nuclear Engine to the design, a warning does not appear as it should, and I can complete the design.
You do it the wrong way...
Requirements Evaluation Availability := 1
Requirements Evaluation Allows Placement := 2, 3
Requirements Evaluation Allows Usage := TRUE
Requirement 1 Description := Empire must have bla bla bla
Requirement 1 Formula := *the tech you need*
Requirement 2 Description := Need more than one nuclear engine.
Requirement 2 Formula := (Get_Design_Ability_Component_Count("Nuclear Engine") >= 1 )
Requirement 3 Description := Need one nuclear shielding.
Requirement 3 Formula := (Get_Design_Ability_Component_Count("Nuclear Shielding") = 1)
Re: One component that requires another?
Won't work the way he wants. That will just require nuclear engines AND nuclear shielding; what he wants to do is IF you use a nuclear engine you need nuclear shielding. But you don't have to use either.
The iif statement should work if phrased correctly. You need to use Component count, NOT ability count, because there is no such thing as "nuclear engine" ability.
Try:
iif(Get_Design_Component_Count("Nuclear Engine") >= 1, (Get_Design_Component_Count("Nuclear Shielding") = 1), 1)
Re: One component that requires another?
The iif statement should work if phrased correctly. You need to use Component count, NOT ability count, because there is no such thing as "nuclear engine" ability.
Try:
iif(Get_Design_Component_Count("Nuclear Engine") >= 1, (Get_Design_Component_Count("Nuclear Shielding") = 1), 1)
Oups, i overlooked the ability count thing...




I did not specify whether they were fusion or fission engines. They actually have no tech requirement (other than propulsion, same as ion engines). Heck, Humans almost developed nuclear engines. Development stopped because of a silly no-nuclear-weapons-in-space treaty that also happened to cover these very engines.
Re: One component that requires another?
I have also attempted editing the vehicle to add the requirement: "iif(Get_Design_Ability_Component_Count("Nuclear Engine") >= 1, Get_Design_Ability_Component_Count("Nuclear Shielding") = 1, TRUE)"
But this formula does not seem to be evaluated. I see the descriptive part of this requirement, but when I add a Nuclear Engine to the design, a warning does not appear as it should, and I can complete the design.