Skip to content

Commit

Permalink
files uploaded
Browse files Browse the repository at this point in the history
  • Loading branch information
Tostito committed Sep 28, 2014
1 parent 6913817 commit ac74eaa
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 65 deletions.
22 changes: 0 additions & 22 deletions .gitattributes

This file was deleted.

43 changes: 0 additions & 43 deletions .gitignore

This file was deleted.

Binary file added NoBeacon.lnk
Binary file not shown.
15 changes: 15 additions & 0 deletions README.md
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.
19 changes: 19 additions & 0 deletions SE_NoBeacon.ps1
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)

0 comments on commit ac74eaa

Please sign in to comment.