Quantcast
Channel: Homeworld Mods and Modding - The Official Gearbox Software Forums
Viewing all articles
Browse latest Browse all 663

Parsing required subsystems logic

$
0
0

Here’s an example of what a vaygr research item might look like:

{
	Name =					"ShipyardBUILDSPEEDUpgrade1",
	RequiredResearch =		"",
	RequiredSubSystems =	"Research | CapShipProduction & Hyperspace",
	RequireTag = 			"VaygrBuilder",  
	Cost = 					1000,
	Time = 					95,
	DisplayedName =			"$7825",
	DisplayPriority =		65,
	Description =			"$7826",
	UpgradeType =			Modifier,
	TargetType =			Ship,
	TargetName =			"Vgr_ShipYard",
	UpgradeName =			"BUILDSPEED",
	UpgradeValue =			1.3,
	Icon =					Icon_Build,
	ShortDisplayedName =	"$7240",
}

A gamerule in my mod disables certain modules, but not others. How do I parse out using a script the requirement for a module in the RequiredSubSystems field? I need to be able to do this no matter what other modules are listed in that field, no matter the order, and no matter what logical operators (& and |) are used. Has anyone attempted this in the past? I suspect it may be enough to strip the module name and the immediately-preceding operator since they are meant to be read from left to right. Is this correct? Thanks.

PS. Does the game ever use parentheses to group items together?

2 posts - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 663

Trending Articles