I have some questions about referecing external files (sprites, sounds, ... )
I made some tests and have some answers, but ideally I would like to know opinion from some developper, to be sure...
These questions are interesting while trying to merge many mods
1) Is it allowed to use same number as reference inside two different RuleSet files ?ANSWER is : YESExample :
Mod_Crafts_Weapon1.rul
items:
- type: STR_WEAPON1
bigSprite: 10001
floorSprite: 10002
handSprite: 10003
Mod_Crafts_Weapon2.rul
items:
- type: STR_WEAPON2
bigSprite: 10001
floorSprite: 10002
handSprite: 10003
2) Is there any limit to these numbers, while referencing any of following properties ?(I mean : could I use 10000, 100000, 1000000 ?)
CF ANSWER IN YELLOWcrafts:
- type: STR_MY_NEW_CRAFT
[b]sprite[/b]: 100001
items:
- type: STR_MY_NEW_WEAPON
[b]bigSprite[/b]: 10001
[b]floorSprite[/b]: 10002
[b]handSprite[/b]: 10003
[b]bulletSprite[/b]: 10004
[b]fireSound[/b]: 10005
[b]hitSound[/b]: 10006
[b]hitAnimation[/b]: 10007
armors:
- type: STR_MY_NEW_ARMOR
[b]spriteSheet[/b]: 1001
[b]spriteInv[/b]: 1002
3) ListOrder
3a) In case two items (of same nature) having same listOrder in same RuleSet file, will they be sorted :
- alphabetically ?
- by order of appearence ?
3b) In case two items (of same nature) having same listOrder in different RuleSet files, will they be sorted :
- alphabetically ?
- by order of reading RuleSet files ?
ANSWER is : BY ORDER OF APPEARANCE (ALSO BASED ON MOD ORDER FIRST, LINE ORDER SECOND) IF LISTORDER NOT SPECIFIED, ELSE CF BELOW3c) Is there any limit to listOrder (1000, 10000, 100000, ...) ?
ANSWER is : NO
ANSWER OF SupSuper
Some clarifications:
- Every ruleset has a safe numeric ID range of 0..999. No rulesets can conflict within this range, except when modifying original resources. If you exceed this, then all bets are off (we'll probably just use string IDs for everything in the future), so don't try to guess and avoid other mod's IDs, you'll just make it worse.
- If a numeric ID matches an original resource, than it's treated as such, otherwise it's treated as a new resource. If you don't wanna keep track of where the original resources end and the new ones start for everything, it's probably safe to always start at 100.
- listOrders are different. They apply globally to every ruleset combined, and have no limit.
- Every item by default gets a listOrder based on the mod order first, line order second, unless manually specified.
- If multiple items specify the same listOrder, they'll be next to each other. Which comes first depends on how the algorithm is feeling that day, as it's not stable.
EDIT : other interesting information related to BaseBit, IntIcon or bulletSprite -> https://openxcom.org/forum/index.php?topic=2031.msg21679#msg21679