Author Topic: Previous definitions not completely overwritten when using multiple rulesets  (Read 10027 times)

Offline Align

  • Colonel
  • ****
  • Posts: 196
    • View Profile
So when I set options.cfg to load first the regular ruleset, then my own little balance mod, it doesn't clear anything defined in the first one - if I want to make Heavy Lasers capable of Auto Shots, I can do that, but I can't remove their vanilla Aimed Shot ability without modding the first file directly.

It would be great if it removed an old definition entirely if it encounters a new one, so if it starts reading a STR_HEAVY_LASER definition it drops any old definitions entirely.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
add this:

Code: [Select]
accuracyAimed: 0
tuAimed: 0

to disable aimed shot.

Offline Align

  • Colonel
  • ****
  • Posts: 196
    • View Profile

Offline wsmithjr

  • Colonel
  • ****
  • Posts: 149
    • View Profile
I'm having a similar problem in that my changes are not being seen by the program.

I want to mod laser weapons the way Xcomutil did requiring alien materials to build the more powerful weapons.  So, I've created the new entry for Laser Rifle:

  - name: STR_LASER_RIFLE
    cost: 300
    points: 10
    dependencies:
      - STR_LASER_PISTOL
      - STR_ELERIUM_115

However, it didn't require Elerium to be researched before I could research Laser Rifle like I expected.

For manufacturing, I created:

  - name: STR_LASER_RIFLE
    category: STR_WEAPON
    requires:
      - STR_LASER_RIFLE
    space: 3
    time: 400
    cost: 20000
    requiredItems:
      STR_ELERIUM_115: 1

However, it doesn't display the Elerium requirement as it should.

I tried putting my "altlaser.rul" file both before and after the "Xcom1Ruleset.rul" listing in options.cfg, but it didn't seem to matter.

Can anyone help me figure out what I'm doing wrong?

EDIT:

Further fiddling ... and now things are going all wonky.  Mods that I had installed and were working are no longer working.  Think it might be something wrong with my configuration.  I've tried moving the "user data" file location from c:\user\documents to a subfolder of the OpenXcom folder, ie., d:\Games\OpenXcom\userdata so that I can have a stable mod to play and one to fiddle and experiment with.  To access, I use a command line of d:\Games\OpenXcom\openxcom.exe -user d:\Games\OpenXcom\userdata.  This works and it's finding the save files appropriately.  Is there some other command needed to access the options.cfg file which is also in the same location?

Thanks for any help.
« Last Edit: July 07, 2013, 10:04:08 pm by wsmithjr »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Code: [Select]
research:
  - name: STR_LASER_RIFLE
    cost: 300
    points: 10
    dependencies:
      - STR_LASER_PISTOL
      - STR_ELERIUM_115
manufacture:
  - name: STR_LASER_RIFLE
    category: STR_WEAPON
    requires:
      - STR_LASER_RIFLE
    space: 3
    time: 400
    cost: 20000
    requiredItems:
      STR_ELERIUM_115: 1

list it AFTER xcom1Ruleset

Offline wsmithjr

  • Colonel
  • ****
  • Posts: 149
    • View Profile
list it AFTER xcom1Ruleset

Thanks, I've gotten it working, but perhaps I am doing something else wrong.

I want to keep separate installations of OpenXcom, so that I can fiddle with modding without affecting my ability to play the game as is.

So, I've got 2 folders ... d:\Games\OpenXcom and d:\Games\OpenXcomMod.

The default for Win7 is to use \\User\My Documents\OpenXcom for the saved games and configuration files.  According to the website, a -user parameter can change the location of this folder.

So, I have options.cfg file in a userdata subfolder as recommended on the "Installing" page of the website at https://www.ufopaedia.org/index.php?title=Installing_(OpenXcom).  Then I have a shortcut set up as follows:

d:\Games\OpenXcomMod\openxcom.exe -user d:\Games\OpenXcomMod\userdata

When I run this, it finds the save games just fine, so it's seeing the new userdata folder as it is supposed to.  However, it seems to ignore the options.cfg file within that userdata folder because my changes do not show up.  If I run the game without the -user parameter, and have the files located in \\User\My Documents\OpenXcom, then everything runs fine, including the mods.  So, am I doing something wrong, or is there another parameter I have not yet seen that is needed to point the location of the options.cfg file?  Or do I need to put the options.cfg file in another location?  As it stands currently, I can't figure out how to run 2 independent installations for OpenXcom.

Thanks for any help.
« Last Edit: July 08, 2013, 12:44:22 am by wsmithjr »

Offline cort

  • Sergeant
  • **
  • Posts: 43
    • View Profile
You could create a folder named "user" in each of the installations, ie. d:\Games\OpenXcom\user and d:\Games\OpenXcomMod\user.
That way you bypass \\User\My Documents\OpenXcom completely (you can even delete it, that's what I did)

Offline wsmithjr

  • Colonel
  • ****
  • Posts: 149
    • View Profile
You could create a folder named "user" in each of the installations, ie. d:\Games\OpenXcom\user and d:\Games\OpenXcomMod\user.
That way you bypass \\User\My Documents\OpenXcom completely (you can even delete it, that's what I did)

Thanks, but I've tried that and it's not working.

I have game in d:\Games\OpenXcomMod, latest GIT version.

I have a folder d:\Games\OpenXcomMod\user which has save games and options.cfg.  I have a folder at d:\Users\Warren\Documents\OpenXcom with IDENTICAL contents to the other folder.  When I run the game by just clicking on openxcom.exe, everything works and it sees the saves and options.cfg in c:\Users\Warren\Documents\OpenXcom.  If I set up the short cut to execute "openxcom -user d:\Games\OpenXcomMod\user", it sees the save games, but completely ignores the options.cfg file all mods that are installed.

Here's the xcomutil.log when using the user folder at d:\Users\Warren\Documents\OpenXcom:

[08-07-2013 07:53:41]   [INFO]   Data folder is:
[08-07-2013 07:53:41]   [INFO]   d:\Users\Warren\Documents\OpenXcom\data\
[08-07-2013 07:53:41]   [INFO]   D:\Games\OpenXcomMod\data\
[08-07-2013 07:53:41]   [INFO]   D:\Games\OpenXcomMod\data\
[08-07-2013 07:53:41]   [INFO]   User folder is: d:\Users\Warren\Documents\OpenXcom\
[08-07-2013 07:53:41]   [INFO]   Config folder is: d:\Users\Warren\Documents\OpenXcom\
[08-07-2013 07:53:41]   [INFO]   Options loaded successfully.
[08-07-2013 07:53:41]   [INFO]   SDL initialized successfully.
[08-07-2013 07:53:41]   [INFO]   SDL_mixer initialized successfully.
[08-07-2013 07:53:41]   [INFO]   Attempting to set display to 1920x1080x8...
[08-07-2013 07:53:41]   [INFO]   Display set to 1920x1080x8.
[08-07-2013 07:53:41]   [INFO]   Using slower scaling routine. For best results, try a resolution of 640x400 or 1280x800.
[08-07-2013 07:53:41]   [INFO]   Loading ruleset...
[08-07-2013 07:53:42]   [INFO]   Ruleset loaded successfully.
[08-07-2013 07:53:42]   [INFO]   Loading resources...
[08-07-2013 07:53:42]   [INFO]   Loading extra resources from ruleset...
[08-07-2013 07:53:42]   [INFO]   Resources loaded successfully.
[08-07-2013 07:53:42]   [INFO]   OpenXcom started successfully!

Here is the openxcom.log file when using the "-user d:\Games\OpenXcomMod\user" parameter as indicated above:

[08-07-2013 07:54:13]   [INFO]   Data folder is:
[08-07-2013 07:54:13]   [INFO]   d:\Users\Warren\Documents\OpenXcom\data\
[08-07-2013 07:54:13]   [INFO]   D:\Games\OpenXcomMod\data\
[08-07-2013 07:54:13]   [INFO]   D:\Games\OpenXcomMod\data\
[08-07-2013 07:54:13]   [INFO]   User folder is: d:\Games\OpenXcomMod\user\
[08-07-2013 07:54:13]   [INFO]   Config folder is:
[08-07-2013 07:54:13]   [INFO]   Options loaded successfully.
[08-07-2013 07:54:13]   [INFO]   SDL initialized successfully.
[08-07-2013 07:54:13]   [INFO]   SDL_mixer initialized successfully.
[08-07-2013 07:54:13]   [INFO]   Attempting to set display to 1280x960x8...
[08-07-2013 07:54:13]   [INFO]   Display set to 1280x960x8.
[08-07-2013 07:54:13]   [INFO]   Using mediocre scaling routine due to screen height.
[08-07-2013 07:54:13]   [INFO]   Loading ruleset...
[08-07-2013 07:54:13]   [INFO]   Ruleset loaded successfully.
[08-07-2013 07:54:13]   [INFO]   Loading resources...
[08-07-2013 07:54:14]   [INFO]   Loading extra resources from ruleset...
[08-07-2013 07:54:14]   [INFO]   Resources loaded successfully.
[08-07-2013 07:54:14]   [INFO]   OpenXcom started successfully!

The log itself indicates it doesn't know where the options.cfg file is located.  This is the shortcut I'm using to run the game:  D:\Games\OpenXcomMod\openxcom.exe -user d:\Games\OpenXcomMod\user

Maybe I'm doing something wrong, but this sure seems like a bug in the program to me.  But, I'd be very appreciative if somebody could point out the obvious that I may be missing.

As an aside, I also find it interesting that the line about the resolution is different between the 2 log files, when the contents of the files in both locations is identical.  I'll change that at some point, but that's not really my current problem.

Thanks for helping.

Offline cort

  • Sergeant
  • **
  • Posts: 43
    • View Profile
I tried to replicate your situation, and it appears you are correct. I think it's because \\User\My Documents\OpenXcom location takes precedence over any other, even the one specified in the shortcut.

When you specify the location d:\Games\OpenXcomMod\user\ - this location is used for storing the save games/screenshots/log - but strangely, if it finds a cfg file in this location, it ignores it, and creates another one, this time in the root (d:\Games\OpenXcomMod\).
If this cfg is replaced by the one in the user folder, this time it is read.

Just for curiosity, look if you have the cfg in d:\Games\OpenXcomMod\. If you do, overwrite it with the cfg from the /user/ folder.

If not, my suggestion is this: have two identical installations (whole OpenXcom folder), and modify each user folder respectively. Plus, delete/move the whole \\User\My Documents\OpenXcom folder. After this you can run each installation individually, no shortcuts needed.

Hope this helps.
« Last Edit: July 08, 2013, 05:16:02 pm by cort »

Offline wsmithjr

  • Colonel
  • ****
  • Posts: 149
    • View Profile
When you specify the location d:\Games\OpenXcomMod\user\ - this location is used for storing the save games/screenshots/log - but strangely, if it finds a cfg file in this location, it ignores it, and creates another one, this time in the root (d:\Games\OpenXcomMod\).
If this cfg is replaced by the one in the user folder, this time it is read.

Just for curiosity, look if you have the cfg in d:\Games\OpenXcomMod\. If you do, overwrite it with the cfg from the /user/ folder.

Yep, the file shows up there.  I hadn't discovered that so thanks for finding it.

Quote
If not, my suggestion is this: have two identical installations (whole OpenXcom folder), and modify each user folder respectively. Plus, delete/move the whole \\User\My Documents\OpenXcom folder. After this you can run each installation individually, no shortcuts needed.

Hope this helps.

Note sure I understand this.  I moved the cfg file into the root OpenXcomMod folder and removed the OpenXcom folder in My Documents, but running the exe without a shortcut specifying the -user folder, it doesn't find the cfg file that I moved to the root.  The completely baffling thing, is that it *CREATED A NEW* cfg file in d:\Games\OpenXcomMod\user!  So, I guess I do understand what you mean, but it's just baffling that it works by not doing what you're instructed to do to make it work.

So, not sure I understand everything, but I really appreciate the help and verification that I'm not crazy.  8)  So, I've got my 2 installations working the way I wanted them to work even if the technical details aren't quite what I thought they should be.  Thanks.