OpenXcom Forum
Modding => Help => Topic started by: yhe1 on June 02, 2020, 03:01:00 pm
-
So I want to make a submod for TWoTS, to restore the ranges for the rifles and cannon weapons. I figure out how to edit the ruleset. But I know this is not the "proper way" to do it. I want to make a mod I can turn on and off. What is the proper way? Is there a guide somewhere?
-
1. create a new folder for your mod (in the "mods" directory)
2. create a metadata.yml file in the root folder of your mod with ID and name attributes identifying your mod
3. add a Ruleset folder
4. in the Ruleset folder, create a new *.rul file
5. put the changes in this *.rul file
When activating your mod on the GUI, make sure it is BELOW the twots mod in the list.
-
so I tried to make my mod by removing a bunch of ranges, but now TWOTS crashes. Can somebody take a look and tell me what I did wrong? Thanks!
https://www.dropbox.com/s/pvh8j322b856idv/twots_morevanilla.rar?dl=0
-
Mods don't share sprites, you can't just use the same numbers let's say for bigobs in your mod as in twots... those number don't exist in your mod.
For example:
- type: STR_HARP
categories: [STR_DUALENV_WEAPONS]
size: 0.1
costBuy: 2000
costSell: 1700
weight: 4
bigSprite: 130 # <------------- this sprite doesn't exist in your mod
floorSprite: 132
handSprite: 1119
Options you have:
1. don't override twots sprites in your mod, just leave them be... only override what needs to be overridden
2. copy all the sprites from twots to your mod too
3. reference the sprites across mods, see: https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Negative_indices_and_cross-referencing_other_mods
All three options work, I'd recommend option 1.
-
But all I did was remove a bunch of maxrange and other range statements, why would this affect the sprites?
-
Difference is linked below
https://www.diffchecker.com/kJm4FC6r
-
But all I did was remove a bunch of maxrange and other range statements, why would this affect the sprites?
1/ As I said, (for example) sprite 130 exists in TWOTS, but doesn't exist in your mod.
If you specify "bigSprite: 130" in your mod, you are telling the game to use a sprite that doesn't exist.... and the game will crash.
2/ Also, removing the ranges from the file will NOT work... the ranges from TWoTS will still be used. If you want the vanilla ranges back, you NEED to explicitly override those ranges back to whatever numbers you need.
-
Got it. So If I want unlimited ranges (same as the vanilla game), I should set the number to 200?
-
yes
-
I think my problem lies in my metadata file, because If I straight up replaced the files in TWOTS, it works
This is what I currently have
https://www.dropbox.com/s/4mcwi9lprk0anua/metadata.rar?dl=0
How do I properly tell my mod to use TWOTS as a master?
-
I think my problem lies in my metadata file, because If I straight up replaced the files in TWOTS, it works
If you replace the files directly in twots, then you are not making a submod of twots, you're simply just changing twots.
It's same as if author of twots made the changes himself.
How do I properly tell my mod to use TWOTS as a master?
Twots is not a master mod, so you can't use it as master mod.
And even if twots was a master mod, it would still not change anything for you... the sprites would still NOT be shared.
Proper way of doing a submod is changing only what you need to change, and leave everything else unchanged.
WRONG example:
items:
- type: STR_HARP
categories: [STR_DUALENV_WEAPONS]
size: 0.1
costBuy: 2000
costSell: 1700
weight: 4
bigSprite: 130
floorSprite: 132
handSprite: 1119
fireSound: 84
accuracySnap: 65
accuracyAimed: 85
tuSnap: 35
tuAimed: 75
compatibleAmmo:
- STR_HARP_CLIP
- STR_HARP_CLIP_E
- STR_HARP_CLIP_ST
bulletSprite: 12
bulletSpeed: -1
battleType: 1
twoHanded: true
invWidth: 1
invHeight: 3
armor: 30
listOrder: 1906
recover: true
CORRECT example:
items:
- type: STR_HARP
maxRange: 200 # was 20
aimRange: 200 # was 18
snapRange: 15 # was 10
-
got it, does the file name of the ruleset matter? Or will it be read regardless?
-
got it, does the file name of the ruleset matter? Or will it be read regardless?
the file name doesn't matter