RageLeague Posted August 14, 2021 Share Posted August 14, 2021 Title. Under "content/combat_parties", this is defined: function AddCombatPartyDef(id, fn) if GENERATORS[id] then print (loc.format( "Combat party generator {1} is already defined. If you aren't reloading combat, look into this", id )) GENERATORS[id] = fn end end For some reason, the function is added if a function already exists, and not if the function does not exist. Link to comment Share on other sites More sharing options...
Developer rooks Posted August 17, 2021 Developer Share Posted August 17, 2021 Thanks for the heads up. This looks to be an old (strangely defined) function, as I can't find anywhere in the code that uses it. Link to comment Share on other sites More sharing options...
RageLeague Posted August 17, 2021 Author Share Posted August 17, 2021 7 hours ago, rooks said: Thanks for the heads up. This looks to be an old (strangely defined) function, as I can't find anywhere in the code that uses it. Maybe it's for modders? Either way, I'm using it for custom combat parties. Speaking of which, is there a way to make the helper function in the combat party def publicly accessible? It seems like it is applicable in many situations. Link to comment Share on other sites More sharing options...
Developer rooks Posted August 19, 2021 Developer Share Posted August 19, 2021 Ah in that case I will amend AddCombatPartyDef like this: Spoiler function AddCombatPartyDef(id, fn) if GENERATORS[id] then print (loc.format( "Combat party generator {1} is already defined. If you aren't reloading combat, look into this", id )) end GENERATORS[id] = fn end As for the helper functions, the best I can do is make them global. Which ones were you referring to specifically? PickTeams, FindValidTeams, etc.? Link to comment Share on other sites More sharing options...
RageLeague Posted August 21, 2021 Author Share Posted August 21, 2021 Yeah, it would be helpful for PickTeams and FindValidTeams be global. PT_RANGES and COUNT_RANGES might also be helpful to make global. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.