ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
Stalker Mod Change Script (Modify The Extracted Mod .ltx Files Automatically) - Discussion

1 2 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Oldest Up Sort by Ascending
  11:07:58  1 October 2017
profilee-mailreply Message URLTo the Top
JakFrost
(Senior)
 
On forum: 11/30/2008
Messages: 112
2017-10-01: Public release.

[B]2017-10-01[/B]: Public release.

+ Updated with 'STALKER - Lost Alpha Developer's Cut v1.4004' weight max.
  04:29:49  5 April 2010
profilee-mailreply Message URLTo the Top
JakFrost
(Senior)
 
On forum: 11/30/2008
Messages: 112
2010-04-04: Public release.

+ Updated with STALKER Call of Pripyat game and mod file includes valuable
changes.

2009-09-12: Public release.

/ Removed the duplicate output of the Action, Section, Field, Value.
  08:00:56  11 June 2009
profilee-mailreply Message URLTo the Top
JakFrost
(Senior)
 
On forum: 11/30/2008
Messages: 112
2009-06-11: Public release.

/ Fixed the "SEVA Suit Upgradable By Stalkers In Agroprom - Repair" mod in
the data file to properly change the correct "agr_stalker_base_mechanic"
section to allow repairs and upgrades to this suit.
  01:16:44  10 June 2009
profilee-mailreply Message URLTo the Top
JakFrost
(Senior)
 
On forum: 11/30/2008
Messages: 112
A little update to fix some important bugs that I overlooked since I was testing this on my system and not a clean install.


2009-06-09: Public release.

/ Updated the Help section with download links and extra information for mod
authors about using Diff and WinMerge to help identifying the changes made
to make the creation of data files easier.

/ Fixed the Inventory Weight Change: Inv Max Weight mod for STALKER Clear
Sky to ensure that it adds the "inv_max_weight" field in case it is missing
since this is the case in the regular game files, and to change it if it
already exists.

+ Added ability to delete the "_unpacked\" folder automatically to delete
extracted version after the end of the script to prevent the script from
reusing these old extracted files in case a new patch is released that
would update the extracted files.

+ Added the "/cleanup_disable" switch to disable automatic clean-up but this
is not recommended since the unpacked files will get old if a new patch is
released and these old versions could be used in the future causing
problems. This switch exists to let people keep the unpacked files to do
comparisons with the modified versions after the mods.

/ Fixed a script problem where a copy of the file from the unpacked folder
fails because the destination folder under the gamedata folder does not
exist.
  18:21:55  7 June 2009
profilee-mailreply Message URLTo the Top
JakFrost
(Senior)
 
On forum: 11/30/2008
Messages: 112
New Release - Small Fix

Released a new version since I had to fix the Modify label since it did not refer to SED properly from the Utilities folder. Also tested the new SED 4.2-1 release from GnuWin32, but it still suffers from the --in-place problem.

2009-06-07 - Public release.
/ Fixed reference to SED.exe in the Modify label.
. Tested new SED 4.2-1 release, but --in-place bug still exists.
Staying with SED 4.1.5 for this script.
  12:17:44  6 June 2009
profilee-mailreply Message URLTo the Top
JakFrost
(Senior)
 
On forum: 11/30/2008
Messages: 112
New Release - 2009-06-06

2009-06-06 - Public release.
/ Data file format modified.
+ Add, Change, Delete actions added.
+ Automatic Mod File Extraction added.
+ Automatic Gamedata Mod Enable in "fsgame.ltx" file added.
+ SEVA Suit Upgrade included in data file with Add and Change actions.


The new release is up. I implemented some additional features that I needed such as the Add, Change, Delete actions to get the SEVA Suit Upgrade to work. I also added the automatic file extraction and "fsgame.ltx" file edit.

I'm quite happy with this script at this point. It could still use support for .xml and .script files but I think that I'll leave those features alone for now since implementing a good parser for those more difficult formats would probably be easier to do in a different language such as C# and .NET Framework than in the Windows shell. I already had to battle a hoard of bugs with the Windows shell to get even this functionality to work and I documented the bugs and my workarounds inside the script itself for any curious on lookers. The code is pretty clean, well structured, and commented so it should be understandable but it uses a lot of advanced coding techniques for Windows shell pushing it to the limit and past it so it is a bit weird in some places.

Enjoy. It's time to get a little break away from coding.
  23:19:48  5 June 2009
profilee-mailreply Message URLTo the Top
JakFrost
(Senior)
 
On forum: 11/30/2008
Messages: 112
Escape Character Problem Fixed

I fixed the problem with the escape character so now the script works very well with all the special regular expression characters in the data file.

One annoying thing remains is that all the section, field, value fields in the data file are always treated as regular expressions so they require all special characters to be escaped when populating these fields inside the data file. This makes it a pain in the ass for future modders to remember to escape all characters even though they might be doing a simple replace that contains any of the "\^$.?*+[](){}|&" and "/" characters.

I might have to think of a way to allow regular expressions to be /forward-slash quoted/ and regular strings to appear normally. This would solve the problem of having to escape everything.

Script Refactorization Complete

I was able to refactor some sections of the script and merge some of the query section commands. It worked out well.

I also changed all funky numerical references for variables "%~5" to actual name references "%value%" since I rewrote all the parts of the script dealing with regular expression section, field, and value variables to make them double-quote safe.

Additional File Formats .ltx, .xml, .script

Currently this script only handles .ltx files that are based on the config file format similar to INI files and contain "[section]" and "field = value" type of data. There are also .xml and LUA .script files that contain some data that could be modified but right now this script does not understand these formats. I believe that it would be possible to implement additional SED scripts to deal with these data formats in the future. The difficulty with this update is how difficult it would be to write SED scripts that will be able to deal with these file formats without trying to use advanced programming techniques and variable data formats that would not work in the simple shell language and would require the porting of this script to a more powerful language.

Automatic File Extraction

Right now the script depends on the user to ensure that the file to be modified has already been extracted from the game's DB files or that is already exists because another mod provided the file so it is ready to be modified. However, I think that it would be possible to add simple logic to this script to detect if a required file is missing, then to automatically extract all the DB files that contain "config\" or "scripts\" folders, find the required file, and copy it to the proper "gamedata\" folder, then modify it.

Next Release

Since there is no rush, I'm going to see about implementing the automatic file extraction feature for this script to save the user the trouble from having to extract and find the files himself that need to be modified. I think that this should not be a big problem to do script wise.

The addition of .xml and .script file support is something that I'll probably look at sometime later after I get this release out because I have a feeling that I'm going to look at some other mod that modifies one of the .script or .xml files and I'm going to have that need to update the script again for my own usage. Well, at least necessity is good in this respect.
  12:56:15  5 June 2009
profilee-mailreply Message URLTo the Top
JakFrost
(Senior)
 
On forum: 11/30/2008
 

Message edited by:
JakFrost
06/05/2009 12:56:33
Messages: 112
New Script Version - Necessity Calls Again

Once again necessary calls and I answer. I wanted to include the ability to have the SEVA suit be upgradable fully in the regular game so that you don't have to join the Bandit faction. I saw a file mod for the "stalkers_upgarde_info.ltx" file that did it and I did a WinMerge check against it to find that it lets the Stalker Mechanic in Agroprom do the upgrades. The change was simple with changing two lines from "false" to "true" to allow the upgrades but it also required the addition of another line "scientific_outfit" to the "[agr_stalker_base_mechanic]" section.

Well my script could only change lines but not add them, so I sat down last night and rewrote it entirely to allow it to do additions, changes, and deletions for lines. I finished it and the script works but there is just a tiny little bug with the windows shell command processor "cmd.exe" forcibly escaping any strings with the escape character "^" causing some small issues. It is late now so I'm going to work on this issue and resolve it tomorrow.
  23:18:36  4 June 2009
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
 

Message edited by:
Don Reba
06/04/2009 23:42:15
Messages: 11607
That SMM still cannot merge some seemingly simple cases just goes to show that diffs are not the Silver Bullet. Still, when in past people described problems they were having, we were able to solve them by improving SMM's merging algorithms. For instance, since version 1.8, it is not sensitive to differences in spacing or comments in Ltx files.

ModScript does not solve the same problem as your tool. I am mainly concerned with enabling modders to expose to their users adjustable features of their mods. Creation of mods that let the user customize the game is another application. It is not the intention, however, to create another way of making mods. There is plenty of small mods as it is, just look at those by Nandersen and {imperialreign} for good examples.
  19:48:10  4 June 2009
profilee-mailreply Message URLTo the Top
JakFrost
(Senior)
 
On forum: 11/30/2008
Messages: 112

---QUOTATION---
I was also dissatisfied people releasing Mods by including the whole file in the distribution when they were only changing a few numbers in the .ltx files. I always thought that if you are going to change a few small things in a file and not really add more data then you could have done this but submitting a difference patch instead of the whole thing. However, most people are not familiar with .diff files unless they are developers or advanced computer users.
Again, Smart Mod Manager computes the differences automatically. It seems to me, that you are solving a problem that does not exist.
---END QUOTATION---



Maybe that is the case with your mods but in my experience I could not get Smart Mod Manager to integrate a simple Medkit Heals Bleeding single file mod with Total Faction War for Clear Sky without crashing the game and requiring me to do a manual edit of the file in question. If this problem did not exist then my guess is that your new ModScript project is solving the same problem that does not exist.

I understand that my script and your ModScript project do the same thing and if your ModScript project is updated to include wildcard matches for files and regular expression syntax for section, field, and value names then your project really covers the functionality of this script. I don't have a problem with your ModScript project at all since I wrote the script for my own usage and I've shared it for other people to look at and use if they need the same features and flexibility of regular expressions for their minor mods. I really have no intention of building up features into it beyond what it does not because it does what I need it to do.

Since your Smart Mod Manager works well for my other mods, and with the inclusion of ModScript it does the same as long as the features like regular expressions and wildcard filename matches are added then that would be great. I wouldn't mind at all deprecating my own project and recommending all potential minor modders to use your ModScript format instead. I'd make a link in my own download and discussion threads to point to ModScript so that it becomes the de facto standard for script mods and to avoid any modders from using my hopefully soon to be deprecated script and data file format.

I'm all for having a single, unified mod system in the STALKER community and your Smart Mod Manager with ModScript should be it, provided that it offers the most and best features that modders want.
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2019 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.