Page 1 of 1

Mod dependency in (tips and (tricks or (Info)))

Posted: Mon Feb 17, 2025 2:01 pm
by S_gamez
Want to suggest a way to allow tips and tricks to be enable by Mods or NotMods in mod. Should a mod change some that would only be relevant if both mods or not mods are there?

My case is that i change a lot of things Power armour MK 3 mod but i don't see why trigger my tips/info regarding that mod if the mod isn't there.
Please let me know if a prototype section for this can be made unless it is a API function already.


kinda what i would like is 2 lines added to

Code: Select all

type = "tips-and-tricks-item",
which my example would be

Code: Select all

notmods_dependencies = {""}, or/and
mods_dependencies = {""},
--similar to the current
dependencies = {""} that has to do with depending on a different tips and tricks, not mods.

Re: Mod dependency in (tips and (tricks or (Info)))

Posted: Mon Feb 17, 2025 3:06 pm
by Muche
Tips & tricks are already part of prototypes.
See TipsAndTricksItemCategory and TipsAndTricksItem.

Re: Mod dependency in (tips and (tricks or (Info)))

Posted: Mon Feb 17, 2025 4:37 pm
by S_gamez
Muche wrote: Mon Feb 17, 2025 3:06 pm Tips & tricks are already part of prototypes.
See TipsAndTricksItemCategory and TipsAndTricksItem.
That does not answer the question nor does it help me make it have If mods["modname"] specifics. just in a tips and tricks way.

Re: Mod dependency in (tips and (tricks or (Info)))

Posted: Mon Feb 17, 2025 5:13 pm
by Muche
You can still do (somewhere in data-updates, I'd guess)

Code: Select all

if mods["othermod"] then
  data.raw["tips-and-tricks-item"]["powerarmormk3"].dependencies = ["othermod-armors"] -- depend on othermod's tip&trick
else
  data.raw["tips-and-tricks-item"]["powerarmormk3"].dependencies = ... -- default dependencies
end

Re: Mod dependency in (tips and (tricks or (Info)))

Posted: Mon Feb 17, 2025 6:37 pm
by S_gamez
Found a functional solution but still wish it could be simplified with suggested function under prototype for

Code: Select all

types = "tips-and-tricks-item"

Code: Select all

--Current solution
if mods["Power Armor MK3"] then
	data:extend({
		{
			type = "tips-and-tricks-item",
			name = "par_power_armor_mk3-info",
			category = "power-armour-replacer",
			dependencies = {"par_cas-info"},
			starting_status = "unlocked",
			order = "3AA",
			indent = 2,
		},
	})
end