-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tostito
committed
Sep 28, 2014
1 parent
6913817
commit ac74eaa
Showing
5 changed files
with
34 additions
and
65 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
SE-NoBeacon | ||
=============== | ||
**INTENDED FOR DEDICATED SERVERS | ||
|
||
The author of this script is not responsible for any damage to the game save or the machine it is run on. | ||
|
||
Grid removal if no Beacon is found. | ||
|
||
This powershell script is used by changing the variables at the top of the 'ps1' file to match your server settings. | ||
|
||
The default settings will delete object grids from the game if those grids have no beacon. | ||
|
||
Be sure to shut your space engineers server down before running this script!!! | ||
|
||
Use the windows shortcut provided to run. Be sure the shortcut and the script file are in the same folder. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
$filePath = 'your save path here\SANDBOX_0_0_0_.sbs' | ||
|
||
[xml]$myXML = Get-Content $filePath | ||
$ns = New-Object System.Xml.XmlNamespaceManager($myXML.NameTable) | ||
$ns.AddNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance") | ||
|
||
|
||
#delete grid if no beacon. | ||
$nodes = $myXML.SelectNodes("//SectorObjects/MyObjectBuilder_EntityBase[(@xsi:type='MyObjectBuilder_CubeGrid')]" , $ns) | ||
ForEach($node in $nodes){ | ||
$beaconcount = $node.SelectNodes("CubeBlocks/MyObjectBuilder_CubeBlock[@xsi:type='MyObjectBuilder_Beacon']", $ns).count | ||
IF($beaconcount -eq 0){ | ||
$node.ParentNode.RemoveChild($node) | ||
} | ||
} | ||
|
||
|
||
$myXML.Save($filePath) |