Tehnomaag
New member
The question is in the title. The motivation for the present thread is a discussion about failures of stealth gameplay in the general section of the present forums and an issue some people have with auto-agro sleeper volumes (link in the end of this post).
In that thread on page 9 Kalen posted a simple VB script that should, in theory, go over the POI XLM files in a given directory and change all auto-agro sleeper volumes (flag 2) into "normal" sleepers (flag 0)
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
That is pretty cool, in my opinion. However, what this basically means is doing a custom POI pack which means that both the server and clients would need to have it. It is not clear at all to me if it is even possible to do that change after the map has been already generated or if such an change would need to be done even before a map generation.
What I would like to try, actually, would be a situation where ALL sleeper volumes in all POI's are set to "awake" state (flag 1). Now before I start messing about with scripts doing changes to the POI files I would need to understand a bit more about what does what in the POI xlm files, exactly. Is there such a resource available somewhere? Must the sleeper volume changes be made before map generation? Or are the sleeper volumes loaded from a file only after a player enters the POI and, thus, could the changes made to a already running server? Are the sleeper volumes loaded from the server side or must they be both server and client side?
For example, I look at the "red mesa" POI xlm file
<?xml version="1.0" encoding="UTF-8"?>
<prefab>
<property name="CopyAirBlocks" value="True" />
<property name="ExcludeDistantPOIMesh" value="False" />
<property name="ExcludePOICulling" value="False" />
<property name="DistantPOIYOffset" value="0" />
<property name="AllowTopSoilDecorations" value="False" />
<property name="QuestTags" value="clear,fetch,hidden_cache" />
<property name="ShowQuestClearCount" value="2" />
<property name="DifficultyTier" value="4" />
<property name="TraderArea" value="False" />
<property name="Zoning" value="industrial" />
<property name="AllowedTownships" value="wilderness" />
<property name="RotationToFaceNorth" value="2" />
<property name="EditorGroups" value="government" />
<property name="YOffset" value="-23" />
<property name="SleeperVolumeSize" value="29, 3, 17#13, 3, 27#9, 3, 1#24, 3, 16#16, 3, 2#1, 2, 1#10, 3, 12#11, 3, 11#10, 3, 6#16, 1, 10#24, 3, 13#5, 4, 7#16, 4, 19#9, 2, 9#4, 5, 4#11, 7, 24#4, 3, 2#14, 6, 13#3, 3, 9#8, 3, 5#7, 3, 7#11, 2, 13#21, 3, 3#11, 3, 2" />
<property name="SleeperVolumeStart" value="31, 23, 31#18, 23, 44#40, 18, 60#32, 14, 30#40, 14, 46#37, 15, 47#39, 29, 48#16, 14, 42#19, 18, 68#30, 2, 57#33, 2, 27#56, 2, 41#32, 8, 29#48, 8, 15#28, 8, 37#31, 6, 49#27, 6, 46#15, 19, 30#26, 26, 33#18, 26, 34#17, 14, 63#60, 8, 12#49, 10, 15#18, 26, 31" />
<property name="SleeperVolumeGroupId" value="1,1,1,2,2,1,1,0,0,0,0,0,3,0,3,4,4,0,5,5,0,0,0,5" />
<property name="SleeperVolumeGroup" value="S_-_Group_Zom_Soldier,0,1,S_-Group_Generic_Zombie,2,2,S_-Group_Generic_Zombie,1,1,S_-_Group_Zom_Soldier,3,3,S_-Group_Generic_Zombie,2,2,S_-_Group_Zom_Soldier,0,1,S_-Group_Generic_Zombie,1,1,S_Zom_Utility_Worker,1,1,S_Zom_Utility_Worker,2,2,S_-Group_Generic_Zombie,2,2,S_-Group_Generic_Zombie,2,2,S_-Group_Generic_Zombie,1,2,S_-Group_Generic_Zombie,3,3,S_Zom_Utility_Worker,1,1,S_-_Group_Lab_Worker,1,1,S_-_Group_Lab_Worker,4,4,S_Zom_Utility_Worker,2,2,S_-Group_Generic_Zombie,1,1,S_-_Group_Zom_Soldier,4,4,S_-Group_Generic_Zombie,0,0,S_-_Group_Lab_Worker,1,1,S_Zom_Utility_Worker,1,1,S_-Group_Generic_Zombie,1,1,S_-_Group_Zom_Soldier,4,4" />
<property name="SleeperIsLootVolume" value="False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False" />
<property name="SleeperIsBossVolume" value="False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False" />
<property name="SleeperVolumeFlags" value="2,0,0,0,2,0,0,0,0,0,0,0,2,0,0,2,0,0,0,2,2,0,0,0" />
<property name="SleeperIsQuestExclude" value="False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False" />
<property class="Stats">
<property name="TotalVertices" value="1905279" />
<property name="TotalTriangles" value="1876287" />
<property class="BlockEntities">
<property name="Vertices" value="1406927" />
<property name="Triangles" value="1513608" />
</property>
<property class="ChunkMeshes0">
<property name="Vertices" value="396055" />
<property name="Triangles" value="252024" />
</property>
<property class="ChunkMeshes1">
<property name="Vertices" value="0" />
<property name="Triangles" value="0" />
</property>
<property class="ChunkMeshes2">
<property name="Vertices" value="3000" />
<property name="Triangles" value="1548" />
</property>
<property class="ChunkMeshes3">
<property name="Vertices" value="438" />
<property name="Triangles" value="244" />
</property>
<property class="ChunkMeshes4">
<property name="Vertices" value="62781" />
<property name="Triangles" value="50311" />
</property>
<property class="ChunkMeshes5">
<property name="Vertices" value="0" />
<property name="Triangles" value="0" />
</property>
<property class="ChunkMeshes6">
<property name="Vertices" value="0" />
<property name="Triangles" value="0" />
</property>
<property class="ChunkMeshes7">
<property name="Vertices" value="36046" />
<property name="Triangles" value="58536" />
</property>
<property class="ChunkMeshes8">
<property name="Vertices" value="0" />
<property name="Triangles" value="0" />
</property>
<property class="ChunkMeshes9">
<property name="Vertices" value="32" />
<property name="Triangles" value="16" />
</property>
</property>
<property class="IndexedBlockOffsets">
<property class="FetchContainer">
<property name="0" value="60, 3, 43" />
</property>
<property class="Rally">
<property name="0" value="53, 23, 1" />
</property>
</property>
</prefab>
It appears, that red mesa, as an example, has altogether 24 sleeper volumes? Can I just change all the 24 flags in "SleeperVolumeFlags" to "1" to turn all volumes into "awake" volumes? Or is it a bit trickier than that?
Or would it be truly that simple that I could walk through all the XLM files in a the prefabs directory and change any "SleeperVolumeFlag" that is not "1" into a "1" server-side and that would do it? If it could be made post-map-generation then an server side xlm modlet overrriding given prefabs would be possible?
This is the link to relevant thread in "general":
In that thread on page 9 Kalen posted a simple VB script that should, in theory, go over the POI XLM files in a given directory and change all auto-agro sleeper volumes (flag 2) into "normal" sleepers (flag 0)
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
That is pretty cool, in my opinion. However, what this basically means is doing a custom POI pack which means that both the server and clients would need to have it. It is not clear at all to me if it is even possible to do that change after the map has been already generated or if such an change would need to be done even before a map generation.
What I would like to try, actually, would be a situation where ALL sleeper volumes in all POI's are set to "awake" state (flag 1). Now before I start messing about with scripts doing changes to the POI files I would need to understand a bit more about what does what in the POI xlm files, exactly. Is there such a resource available somewhere? Must the sleeper volume changes be made before map generation? Or are the sleeper volumes loaded from a file only after a player enters the POI and, thus, could the changes made to a already running server? Are the sleeper volumes loaded from the server side or must they be both server and client side?
For example, I look at the "red mesa" POI xlm file
<?xml version="1.0" encoding="UTF-8"?>
<prefab>
<property name="CopyAirBlocks" value="True" />
<property name="ExcludeDistantPOIMesh" value="False" />
<property name="ExcludePOICulling" value="False" />
<property name="DistantPOIYOffset" value="0" />
<property name="AllowTopSoilDecorations" value="False" />
<property name="QuestTags" value="clear,fetch,hidden_cache" />
<property name="ShowQuestClearCount" value="2" />
<property name="DifficultyTier" value="4" />
<property name="TraderArea" value="False" />
<property name="Zoning" value="industrial" />
<property name="AllowedTownships" value="wilderness" />
<property name="RotationToFaceNorth" value="2" />
<property name="EditorGroups" value="government" />
<property name="YOffset" value="-23" />
<property name="SleeperVolumeSize" value="29, 3, 17#13, 3, 27#9, 3, 1#24, 3, 16#16, 3, 2#1, 2, 1#10, 3, 12#11, 3, 11#10, 3, 6#16, 1, 10#24, 3, 13#5, 4, 7#16, 4, 19#9, 2, 9#4, 5, 4#11, 7, 24#4, 3, 2#14, 6, 13#3, 3, 9#8, 3, 5#7, 3, 7#11, 2, 13#21, 3, 3#11, 3, 2" />
<property name="SleeperVolumeStart" value="31, 23, 31#18, 23, 44#40, 18, 60#32, 14, 30#40, 14, 46#37, 15, 47#39, 29, 48#16, 14, 42#19, 18, 68#30, 2, 57#33, 2, 27#56, 2, 41#32, 8, 29#48, 8, 15#28, 8, 37#31, 6, 49#27, 6, 46#15, 19, 30#26, 26, 33#18, 26, 34#17, 14, 63#60, 8, 12#49, 10, 15#18, 26, 31" />
<property name="SleeperVolumeGroupId" value="1,1,1,2,2,1,1,0,0,0,0,0,3,0,3,4,4,0,5,5,0,0,0,5" />
<property name="SleeperVolumeGroup" value="S_-_Group_Zom_Soldier,0,1,S_-Group_Generic_Zombie,2,2,S_-Group_Generic_Zombie,1,1,S_-_Group_Zom_Soldier,3,3,S_-Group_Generic_Zombie,2,2,S_-_Group_Zom_Soldier,0,1,S_-Group_Generic_Zombie,1,1,S_Zom_Utility_Worker,1,1,S_Zom_Utility_Worker,2,2,S_-Group_Generic_Zombie,2,2,S_-Group_Generic_Zombie,2,2,S_-Group_Generic_Zombie,1,2,S_-Group_Generic_Zombie,3,3,S_Zom_Utility_Worker,1,1,S_-_Group_Lab_Worker,1,1,S_-_Group_Lab_Worker,4,4,S_Zom_Utility_Worker,2,2,S_-Group_Generic_Zombie,1,1,S_-_Group_Zom_Soldier,4,4,S_-Group_Generic_Zombie,0,0,S_-_Group_Lab_Worker,1,1,S_Zom_Utility_Worker,1,1,S_-Group_Generic_Zombie,1,1,S_-_Group_Zom_Soldier,4,4" />
<property name="SleeperIsLootVolume" value="False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False" />
<property name="SleeperIsBossVolume" value="False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False" />
<property name="SleeperVolumeFlags" value="2,0,0,0,2,0,0,0,0,0,0,0,2,0,0,2,0,0,0,2,2,0,0,0" />
<property name="SleeperIsQuestExclude" value="False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False,False" />
<property class="Stats">
<property name="TotalVertices" value="1905279" />
<property name="TotalTriangles" value="1876287" />
<property class="BlockEntities">
<property name="Vertices" value="1406927" />
<property name="Triangles" value="1513608" />
</property>
<property class="ChunkMeshes0">
<property name="Vertices" value="396055" />
<property name="Triangles" value="252024" />
</property>
<property class="ChunkMeshes1">
<property name="Vertices" value="0" />
<property name="Triangles" value="0" />
</property>
<property class="ChunkMeshes2">
<property name="Vertices" value="3000" />
<property name="Triangles" value="1548" />
</property>
<property class="ChunkMeshes3">
<property name="Vertices" value="438" />
<property name="Triangles" value="244" />
</property>
<property class="ChunkMeshes4">
<property name="Vertices" value="62781" />
<property name="Triangles" value="50311" />
</property>
<property class="ChunkMeshes5">
<property name="Vertices" value="0" />
<property name="Triangles" value="0" />
</property>
<property class="ChunkMeshes6">
<property name="Vertices" value="0" />
<property name="Triangles" value="0" />
</property>
<property class="ChunkMeshes7">
<property name="Vertices" value="36046" />
<property name="Triangles" value="58536" />
</property>
<property class="ChunkMeshes8">
<property name="Vertices" value="0" />
<property name="Triangles" value="0" />
</property>
<property class="ChunkMeshes9">
<property name="Vertices" value="32" />
<property name="Triangles" value="16" />
</property>
</property>
<property class="IndexedBlockOffsets">
<property class="FetchContainer">
<property name="0" value="60, 3, 43" />
</property>
<property class="Rally">
<property name="0" value="53, 23, 1" />
</property>
</property>
</prefab>
It appears, that red mesa, as an example, has altogether 24 sleeper volumes? Can I just change all the 24 flags in "SleeperVolumeFlags" to "1" to turn all volumes into "awake" volumes? Or is it a bit trickier than that?
Or would it be truly that simple that I could walk through all the XLM files in a the prefabs directory and change any "SleeperVolumeFlag" that is not "1" into a "1" server-side and that would do it? If it could be made post-map-generation then an server side xlm modlet overrriding given prefabs would be possible?
This is the link to relevant thread in "general":