-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a mod friendly way to manipulate loot tables #275
Comments
Musashi1584
added a commit
to Musashi1584/X2CommunityHighlander
that referenced
this issue
Aug 13, 2017
Musashi1584
added a commit
to Musashi1584/X2CommunityHighlander
that referenced
this issue
Aug 14, 2017
… remove helper methods
Musashi1584
added a commit
to Musashi1584/X2CommunityHighlander
that referenced
this issue
Aug 17, 2017
Musashi1584
added a commit
to Musashi1584/X2CommunityHighlander
that referenced
this issue
Aug 18, 2017
Musashi1584
added a commit
to Musashi1584/X2CommunityHighlander
that referenced
this issue
Aug 19, 2017
…l for bulk add and recalc at the end
Musashi1584
added a commit
to Musashi1584/X2CommunityHighlander
that referenced
this issue
Aug 21, 2017
…t remainder method
MalucoMarinero
pushed a commit
that referenced
this issue
Aug 31, 2017
* Added generic helper for loot tables. * Issue #275 Provide a loot helper class * Only recalculate changes when chances exceed 100% * #275 Moves loot helper methods to X2LootTable and adds remove helper methods * #275 Use self for instance methods, CDO for static methods * #275 Removes InitLootTable calls and fixes RemoveEntry * #275 Refactored and fixes. Makes recalculating optional for bulk add and recalc at the end * #275 even out round based differences using the largest remainder method * Fixes typo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Although loot tables are already deprivatized there is no common way to add/remove loot.
There are some caveats involved,e.g. loot chances must be recalculated per rollgroup when a loot table is edited.
A simple helper class with static methods would go a long way in providing a unified interface for mods to interact with loot tables without the hassle of ini entry manipulating.
For pre start state manipulation of loot tables use the static methods in
OnPostTemplatesCreated
like thisclass'X2LootTableManager'.static.AddEntryStatic(LootTableName, LootTableEntry);
At runtime you can use the singleton instance like
LootManager = class'X2LootTableManager'.static.GetLootTableManager();
LootManager.AddEntry(LootTableName, LootTableEntry);
LootManager.InitLootTables();
this will also reinitialise the loot tables.
For bulk add to loot tables you can move the chance recalculation to the end:
LootManager.AddEntry(TableName, EntryToAdd, false);
LootManager.AddEntry(TableName, EntryToAdd, false);
LootManager.AddEntry(TableName, EntryToAdd, false);
LootManager.RecalculateLootTableChance(TableName);
This way your chance ratio is preserved.
The text was updated successfully, but these errors were encountered: