Stars Player Editor

From Stars!wiki
Jump to: navigation, search

Sage advice from PaulCr: Everything seems to work as I expect it to but I know from experience someone may try to do something with it I would never even think of trying that could break it so I would highly recommend making a backup of any files you edit with it first and then test them out to make sure it has done what you were expecting.

About Stars Player Editor, he also says:

This is a pre alpha release, everything seems to work as I expect it to when I've been trying it, however there is still information I need to decode and something I've not worked out yet could cause problems.
I have added an errors collection that gives details of any block that gave an error while decoding.


See also:

'Installing'

Run the RunMe.bat to register the ActiveX Control, You will then be able to use it in VBScript, for .net users you should be able to add a reference to the DLL as a .net object.

Usage

I have not used this util yet so I'm unsure what effects it has. In particular, the demo script loads/edits a .m file(and makes no changes); unless the changes made are also made in the .hst file as well, the effect is purely cosmetic and would be undone with turn generation(and the .x file would likely be rejected). - Gible 24 Jun 08

Examples

StarsHostEditor.vbs

This is the demo script provided by PaulCr that dumps a fleet report to fleets.txt in the current directory.

set obj=createobject("AtlantisSoftware.StarsPlayerEditor")
obj.load("c:\stars\game.m1")
dim str
str="FleetID,OwnerID,X,Y,Ironium,Boranium,Germanium,Fuel,BattlePlan,DesignSlot,ShipCount,Damage" & chr(13) & chr(10)
for each fleet in obj.fleets
  for each ship in fleet.ships  
    str=str & fleet.fleetID & "," & Fleet.OwnerID & "," & fleet.x & "," & fleet.y & "," & fleet.ironium & "," & fleet.boranium & "," & fleet.germanium & "," & fleet.fuel & "," & fleet.battleplan & "," & ship.designID & "," & ship.shipcount & "," & ship.damage & chr(13) & chr(10)
  next
next
for each EnemyFleet in obj.Enemyfleets
  for each ship in EnemyFleet.ships  
    str=str & EnemyFleet.fleetID & "," & EnemyFleet.OwnerID & "," & EnemyFleet.x & "," & EnemyFleet.y & "," & EnemyFleet.ironium & "," & EnemyFleet.boranium & "," & EnemyFleet.germanium & "," & EnemyFleet.fuel & "," & EnemyFleet.battleplan & "," & ship.designID & "," & ship.shipcount & "," & ship.damage & chr(13) & chr(10)
  next
next
set fso=createobject("Scripting.filesystemobject")
set file=fso.createtextfile (".\fleets.txt")
file.write(str)
file.close
msgbox (str)