Restrict a research after its been made available?


(GOLIATH Mod) #1

Hello internet friends,

Does anybody have an idea on how to make either/or research elements? You know, like two items are available to be researched, and when you complete one, the other one is no longer available.

I tried this as a test, but it super didn’t work:

base_research = nil 
base_research = {

	{
		Name =			"ProximitySensor",
		RequiredResearch =	"",
		RequiredSubSystems =	"Research",
		Cost = 			250,
		Time = 			40,
		DisplayedName =		"$11552",
		ShortDisplayedName =	"$11552",
		DisplayPriority =		51,
		Description =		"$11553",
		Icon = 			Icon_Build,
		TargetName =		"Tai_ProximitySensor",

			research_restrict = "SensorArray",	

	},
	{
		Name =			"SensorArray",
		RequiredResearch =	"",
		RequiredSubSystems =	"Research",
		Cost = 			350,
		Time = 			80,
		DisplayedName =		"$11554",
		ShortDisplayedName =	"$11554",
		DisplayPriority =		52,
		Description =		"$11555",
		Icon = 			Icon_Build,
		TargetName =		"Tai_SensorArray",
	},
	{
		Name =			"GravityGenerator",
		RequiredResearch =	"CapitalShipDrive",
		RequiredSubSystems =	"Research",
		Cost = 			500,
		Time = 			100,
		DisplayedName =		"$11556",
		ShortDisplayedName =	"$11556",
		DisplayPriority =		53,
		Description =		"$11557",
		Icon = 			Icon_Build,
		TargetName =		"Tai_GravWellGenerator",
	},

If you know of a mod that has something like this in there let me know, and I could pick that apart as well. Thanks!


(Taiidan Republic Mod) #2

This is doable. In fact it is done in the base game. For instance Hiigaran shipyard upgrades:

	{
		Name =				"ShipyardHealthUpgrade1",
		RequiredResearch =		"",                                                    -- <list of prerequisite research items>
		RequiredSubSystems =		"Research | AdvancedResearch & Hyperspace",                               -- <list of prerequisite sub systems>
		Cost = 					1000,
		Time = 					60,
		DisplayedName =			"$7619",
		DisplayPriority =			1200,                                                    -- <display priority (used to sort on screen)>,
		Description =			"$7620",
		UpgradeType =			Modifier,
		TargetType =			Ship,
		TargetName =			"Hgn_Shipyard",
        	UpgradeName =			"MAXHEALTH",
        	UpgradeValue =			1.4,
		Icon = 				Icon_Health,
		ShortDisplayedName = 		"$7271",
	},

You can research this item if you have (Research Module or Advanced Research Module) and Hyperspace Module. The | is the “or” operator.

EDIT:

Actually, sorry I completely misunderstood your question, so the above does not help… However I believe that making a research item disappear is also possible. I think the answer would be to automatically grant the item that you want to disappear via scripting…


(Taiidan Republic Mod) #3

It turns out that this is what you want:


(GOLIATH Mod) #4

Ah okay, I was wondering what that line meant. Thanks.

With the granting by means of a script, if you give the player the research then he would also have the effects of it though. And I guess the script would also still need to be placed in the research lua so that it would be triggered by completing the other research. I think I still don’t really get it. Could you give me an example of what you mean?

Your answer does give me an idea though. I going to go have a look in the campaign files to see how they make research available at times. Maybe I can use that to take it away as well.


(GOLIATH Mod) #5

COOL - I’m gonna go try it out!


(GOLIATH Mod) #6

Yep! it works, THANKS!!