Jump to content
Tehnomaag

Changing the flags on sleeper volumes

Recommended Posts

8 hours ago, Boidster said:

As you can see above, there is slightly more than a 1% chance the POI will play "with the equivalent of 0 perks invested". A single volume - or several even - in a POI which also has several - in most cases a majority - of volumes which are perfectly fine running in stealth mode, does not make the POI "the equivalent of [playing with] 0 perks invested". There is no need to exaggerate. You have a valid issue, don't f*** up your argument with hyperbole.

Not 100% of the sleeper volumes need to be auto agro in a given POI for it to be "unfeasible" for a stealth build. Because the auto-agro volumes are, usually, used in locations where the stealth would make the most difference, in rooms with high number of sleepers. While the "normal" sleepers are normally in areas where there is only few zombies which would be kinda fine even if they would be auto agro as most players can handle 1-2 zombies coming at them at a time. When it is 8+ rushing you that have a magic GPS enabled to beeline straight to you no matter if in line or sight or not - THAT is a problem and can, basically, invalidate the POI for the purposes of stealth. 

Combine that with the fact that there is NOTHING in game indicating that a player is about to enter an auto aggro volume, and I'd think it is realtively easy to see the source of the frustration of players who like to play the stealth way. 

How hard would it be to write a script that goes over all the sleeper volumes in all POI's and changes ALL the sleepers to be "Awake" (flag "1") kind. Or at least change all the auto-agros (flag "2") to be just awake (flag "1"). I assume it can not be  just find-and-replace all 2's in a file with 1's as it appears the flags contain a fiar bit of more information than just the agression state of the sleepers?

  • Poop 1

Share this post


Link to post
Share on other sites
Posted (edited)
2 hours ago, Tehnomaag said:

How hard would it be to write a script that goes over all the sleeper volumes in all POI's and changes ALL the sleepers to be "Awake" (flag "1") kind. Or at least change all the auto-agros (flag "2") to be just awake (flag "1"). I assume it can not be  just find-and-replace all 2's in a file with 1's as it appears the flags contain a fiar bit of more information than just the agression state of the sleepers?

Pretty easy..... create a file with a .vbs extenstion.   Paste in the following code (make sure you set the correct folder for the location of your prefab folder).  Run the file.

Const ForReading = 1
Const ForWriting = 2

sFolder = "C:\[Folder where prefabs are]\"
Set oFSO = CreateObject("Scripting.FileSystemObject")

For Each oFile In oFSO.GetFolder(sFolder).Files

  If UCase(oFSO.GetExtensionName(oFile.Name)) = "XML" Then
    ReadFiles oFSO, oFile
  End if
Next

Set oFSO = Nothing
msgbox("Processing Complete")

Sub ReadFiles(FSO, File)

	Set oFile2 = FSO.OpenTextFile(File.path, ForReading)

     Do Until oFile2.AtEndOfStream
       strLine = oFile2.ReadLine
       
	   if instr(strLine, "SleeperVolumeFlags") <> 0 then
	       strLine = replace(strLine, "2", "0")
	   end if
	   
	   strText = strText & strLine & vbCrLf
	   
     Loop

     sFile = File.path
     oFile2.close
     set oFile2 = Nothing

     Set File = FSO.OpenTextFile(sFile ,  ForWriting)
     File.Write strText
     File.Close
     Set File = Nothing
	
 end Sub
 
 
 

 

I wrote this pretty quick.... and only tested on a couple of files.   So I strongly recommend backing up your prefab folder before running this.  But it should be fine.

 

Edited by Kalen (see edit history)
  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
On 10/5/2020 at 2:13 PM, Kalen said:

Pretty easy..... create a file with a .vbs extenstion.   Paste in the following code (make sure you set the correct folder for the location of your prefab folder).  Run the file.


Const ForReading = 1
Const ForWriting = 2

sFolder = "C:\[Folder where prefabs are]\"
Set oFSO = CreateObject("Scripting.FileSystemObject")

For Each oFile In oFSO.GetFolder(sFolder).Files

  If UCase(oFSO.GetExtensionName(oFile.Name)) = "XML" Then
    ReadFiles oFSO, oFile
  End if
Next

Set oFSO = Nothing
msgbox("Processing Complete")

Sub ReadFiles(FSO, File)

	Set oFile2 = FSO.OpenTextFile(File.path, ForReading)

     Do Until oFile2.AtEndOfStream
       strLine = oFile2.ReadLine
       
	   if instr(strLine, "SleeperVolumeFlags") <> 0 then
	       strLine = replace(strLine, "2", "0")
	   end if
	   
	   strText = strText & strLine & vbCrLf
	   
     Loop

     sFile = File.path
     oFile2.close
     set oFile2 = Nothing

     Set File = FSO.OpenTextFile(sFile ,  ForWriting)
     File.Write strText
     File.Close
     Set File = Nothing
	
 end Sub
 
 
 

 

I wrote this pretty quick.... and only tested on a couple of files.   So I strongly recommend backing up your prefab folder before running this.  But it should be fine.

 

The script works, in the sense that it goes and replaces all the "2" in SleeperVolumeFlags with "0" so it does exactly what is needed. However, the modified XLM files are failing to load. Apparently 7d2d uses XLM version "1.0", however, the visual basic, apparently, decides to save the files as XLM version "1.1" which, in turn, makes 7d2d to throw a tantrum when trying to load such an XLM file. 

2020-10-14T18:48:02 32.634 ERR Failed parsing XML (skyscraper_03):
2020-10-14T18:48:02 32.635 EXC Version number '1.1' is invalid. Line 1, position 16.
XmlException: Version number '1.1' is invalid. Line 1, position 16.

I'm myself more of a Fortran and Python person, so any way you know from the top of your head to fix this small hiccup before I start googling and trying to figure this out on my own?

 

BTW thanx for the script again. I used it to first turn all auto aggro volumes into normal sleeper volumes and then ran it again to turn all normal sleeper volumes into "awake" (flag "1") ones for the currently running multiplayer server we are using to test how such a thing behaves on an already running server. 

  • Like 1

Share this post


Link to post
Share on other sites
1 minute ago, Tehnomaag said:

The script works, in the sense that it goes and replaces all the "2" in SleeperVolumeFlags with "0" so it does exactly what is needed. However, the modified XLM files are failing to load. Apparently 7d2d uses XLM version "1.0", however, the visual basic, apparently, decides to save the files as XLM version "1.1" which, in turn, makes 7d2d to throw a tantrum when trying to load such an XLM file. 


2020-10-14T18:48:02 32.634 ERR Failed parsing XML (skyscraper_03):
2020-10-14T18:48:02 32.635 EXC Version number '1.1' is invalid. Line 1, position 16.
XmlException: Version number '1.1' is invalid. Line 1, position 16.

I'm myself more of a Fortran and Python person, so any way you know from the top of your head to fix this small hiccup before I start googling and trying to figure this out on my own?

 

BTW thanx for the script again. I used it to first turn all auto aggro volumes into normal sleeper volumes and then ran it again to turn all normal sleeper volumes into "awake" (flag "1") ones for the currently running multiplayer server we are using to test how such a thing behaves on an already running server. 

Huh, I'll take a look at it.... nothing else is changing, so I'm not sure why it did that.

 

  • Thanks 1

Share this post


Link to post
Share on other sites
45 minutes ago, Tehnomaag said:

The script works, in the sense that it goes and replaces all the "2" in SleeperVolumeFlags with "0" so it does exactly what is needed. However, the modified XLM files are failing to load. Apparently 7d2d uses XLM version "1.0", however, the visual basic, apparently, decides to save the files as XLM version "1.1" which, in turn, makes 7d2d to throw a tantrum when trying to load such an XLM file. 


2020-10-14T18:48:02 32.634 ERR Failed parsing XML (skyscraper_03):
2020-10-14T18:48:02 32.635 EXC Version number '1.1' is invalid. Line 1, position 16.
XmlException: Version number '1.1' is invalid. Line 1, position 16.

I'm myself more of a Fortran and Python person, so any way you know from the top of your head to fix this small hiccup before I start googling and trying to figure this out on my own?

 

BTW thanx for the script again. I used it to first turn all auto aggro volumes into normal sleeper volumes and then ran it again to turn all normal sleeper volumes into "awake" (flag "1") ones for the currently running multiplayer server we are using to test how such a thing behaves on an already running server. 

Not sure whats happening, but it worked fine for me.... I tried it both on an existing world and a new world and had no errors.

 

Let me check a few more things and see if I can reproduce what you're seeing.

 

Sorry, I just can't reproduce the error you're getting.

Edited by Kalen (see edit history)
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
15 minutes ago, Kalen said:

Not sure whats happening, but it worked fine for me.... I tried it both on an existing world and a new world and had no errors.

 

Let me check a few more things and see if I can reproduce what you're seeing.

Thanx for checking. It is possible that it is something that is installed on my side which causes the edited XLM files to update from version 1.0 to 1.1 causing this issue. Although if it is it must be something which is shared between my PC (W10 Pro) and the machine running our dedicated server (W8.1 Pro). I'll add an example file's for the red mesa. The original is clearly at xlm version 1.0 while the one after running the script twice is the version 1.1. I'll add the two versions of the script as well I used, but I doubt that it is something I did there, because all I did was leaving, basically the 2 to 0 script as it was and in second script replaced the 2 with 0 in the condition and the 0 replacing 2 with 1 - but it should not target the xlm version, because the script very clearly targets only contents of the SleeperVolumeFlags. 

Regardless, now that I know that on your side everything works as it should then I know that its not the script itself that is an issue but something in the environment I'm running the script in. 

 

Another thing I should probably check is if my client installation is content to use these prefabs in single player and its only the dedicated server installation that has a problem with the xlm files version maybe. 

installation_red_mesa.xml installation_red_mesa_original.xml AAA_script_0_to_1.vbs AAA_script_2_to_0.vbs

Share this post


Link to post
Share on other sites
8 minutes ago, Tehnomaag said:

Thanx for checking. It is possible that it is something that is installed on my side which causes the edited XLM files to update from version 1.0 to 1.1 causing this issue. Although if it is it must be something which is shared between my PC (W10 Pro) and the machine running our dedicated server (W8.1 Pro). I'll add an example file's for the red mesa. The original is clearly at xlm version 1.0 while the one after running the script twice is the version 1.1. I'll add the two versions of the script as well I used, but I doubt that it is something I did there, because all I did was leaving, basically the 2 to 0 script as it was and in second script replaced the 2 with 0 in the condition and the 0 replacing 2 with 1 - but it should not target the xlm version, because the script very clearly targets only contents of the SleeperVolumeFlags. 

Regardless, now that I know that on your side everything works as it should then I know that its not the script itself that is an issue but something in the environment I'm running the script in. 

 

Another thing I should probably check is if my client installation is content to use these prefabs in single player and its only the dedicated server installation that has a problem with the xlm files version maybe. 

installation_red_mesa.xml 4.82 kB · 0 downloads installation_red_mesa_original.xml 4.82 kB · 0 downloads AAA_script_0_to_1.vbs 904 B · 0 downloads AAA_script_2_to_0.vbs 904 B · 0 downloads

Ok, I see what you did

 

You changed this line

 

if instr(strLine, "SleeperVolumeFlags") <> 0 then

to 

if instr(strLine, "SleeperVolumeFlags") <> 1 then

 

So what that piece of code does is check whether or not SleeperVolumeFlags exists in the current line with the value returned being the place in the line it exists.

 

For example

 

if you run the following code

strLine = "AAAABAAAA"

x =  instr(strLine, "B")

x will be = to 5, because B is in the 5th spot in strLine

 

But if you run

strLine = "AAAABAAAA"

x =  instr(strLine, "C")

x will be = to 0, because C doesn't exist.

 

So the code in the script is looking for lines where searching for SleeperVolumeFlags gives you something other than 0, meaning lines where it exists.   So it only changes that line.

 

By changing it, your script is looking for lines where SleeperVolumeFlags is not the beginning of the line (position 1).  Since this never happens, it's swapping 0 for 1 on every line.   Change the line back to "instr(strLine, "SleeperVolumeFlags") <> 0 then " and you'll be fine.

 

 

 

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
4 minutes ago, Kalen said:

Ok, I see what you did

 

You changed this line

 

if instr(strLine, "SleeperVolumeFlags") <> 0 then

to 

if instr(strLine, "SleeperVolumeFlags") <> 1 then

 

So what that piece of code does is check whether or not SleeperVolumeFlags exists in the current line with the value returned being the place in the line it exists.

 

For example

 

if you run the following code

strLine = "AAAABAAAA"

x =  instr(strLine, "B")

x will be = to 5, because B is in the 5th spot in strLine

 

But if you run

strLine = "AAAABAAAA"

x =  instr(strLine, "C")

x will be = to 0, because C doesn't exist.

 

So the code in the script is looking for lines where searching for SleeperVolumeFlags gives you something other than 0, meaning lines where it exists.   So it only changes that line.

 

By changing it, your script is looking for lines where SleeperVolumeFlags is not the beginning of the line (position 1).  Since this never happens, it's swapping 0 for 1 on every line.   Change the line back to "instr(strLine, "SleeperVolumeFlags") <> 0 then " and you'll be fine.

Heh. Thanx. Yeah I see now what I did. I kind assumed that the line I changed checks if the SleeperVolumeFlags  has a value that is not equal to the number behind it. So it made a perfect sense that if its not 0 go look up all the 2's and change them to 0 and in the next script if its not 1 go change all the 0's into 1's. Ofc I should have spotted that mistake by more carefully checking the resulting xlm files and taking note that ALL the zeros in the file have turned into 1's and that is not the intent. 

Share this post


Link to post
Share on other sites
Just now, Tehnomaag said:

Heh. Thanx. Yeah I see now what I did. I kind assumed that the line I changed checks if the SleeperVolumeFlags  has a value that is not equal to the number behind it. So it made a perfect sense that if its not 0 go look up all the 2's and change them to 0 and in the next script if its not 1 go change all the 0's into 1's. Ofc I should have spotted that mistake by more carefully checking the resulting xlm files and taking note that ALL the zeros in the file have turned into 1's and that is not the intent. 

When I was testing it, I set all of them to 2.   Let me tell you, that was a big difference.   Now I want to have the script randomize the volumes, so don't know what you're going to get!

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
12 minutes ago, Kalen said:

When I was testing it, I set all of them to 2.   Let me tell you, that was a big difference.   Now I want to have the script randomize the volumes, so don't know what you're going to get!

 

Yeah. I was myself thinking of the same, that it would be really cool if there would be a way to set a volume flag to a random value. Ideally it would be done in-engine, but failing that a script running on a timer server-side might do something like that as well. 

 

The script worked now. Server booted just fine so its time for me to go poking and seeing how it goes. Thanx for the script and for the help in getting it to work for me. 

  • Like 2

Share this post


Link to post
Share on other sites

Does anyone know if there is some other flag/mechanic than the SleeperVolumeFlags that makes the zombies in a given volume attack the player upon spawning?

 

Got around poking in only few POI's last night after updating all the SleeperVolumeFlags in the game to be "1" (i.e., awake) - the zeds appear to be somewhat more alert as few waked up somewhat easier than before, especially, when sneaking into their apparent field of view, so that is interesting. But in one tier 3 fetch guest (compopack poi, so not vanilla thing) there were 6 zombies that spawned and attacked the player. I'm not so much having an issue with the fact that they did (it made sense in that location and was cinematically nicely done, with 6 of them breaking out of their graves in a burial site) but wondering that how ... if all the sleepervolumeflags were changed.

 

Granted this is already playing map, so it is expected that not all the changes will register in all the POI's - but the assumption was that when a trader gives a mission to a POI and POI resets that then the POI would be loaded again from the prefabs folder and then the changes might register for a given POI. Is this assumption incorrect if someone knows?

Share this post


Link to post
Share on other sites

Seems fair. I mean it is kinda modding even if it originally started as a complaint about POI design decisions. 

 

Have been testing this everything awake (flag 1) for few days now. The zeds do seem to be more alert now, however, I really cant figure out if they still auto-attack sometimes or they are just really really alert sometimes. 

 

I suspect there is some other trigger somewhere as well that makes them attack upon entry. But I cant really claim that with high confidence as its an already running map I updated with these scripts, our "combat" characters are heavy armor and zero stealth skills and when they get into a tier 5 quest POI it's ... uhh ... I suppose more brutal when it used to be with auto-attack volumes and normal blind/deaf normal sleepers. The second you fire a unsilenced gun most of the POI will beeline to the location of the shot. My own char is not really combat as I'm a support (farming/cooking/salvage/crafting benches) with some points thrown into agi to be able to clear smaller poi's on my own. 

 

I'll attach the updated and now working scripts to this message as well, because the ones in my previous post, one of them had the mistake Kalen pointed out. The "2_to_0" makes all auto-agro volumes into the normal braindead sleepers, and the "0_to_1" turns all the normal braindead sleeper volumes into the "awake" ones, that are supposed not to auto attack upon entry but be really alert and attack you when you get near them (like the normal random walking zed in  the wild)

AAA_script_0_to_1.vbs AAA_script_2_to_0.vbs

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...