Script for renaming stars...

Hello everyone,
I'm looking to write a script to rename stars to my specific needs. Can someone at least tell me what the variable name is for the star names? If you have a quick script to share with me all the better. I'll admit that I am not all that handy with this scripting system, but I can learn if given the information. I looked at the alien.api, but it was not nearly as useful as I had hoped.

Thanks,

Steve

Comments

  • Are you looking to randomly name them, or for something like a prompt that lets you enter a name in?

    There's one script here that might help:
    http://www.nbos.com/nox/index.php?action=1001&id=107
    You could basically tear out the generation stuff, and leave in name assigning.

    You can also use inspiration pad to create a name generator that can be used during generation.
  • I'm looking to write a script that will replace the star names with <sector name - XcoordYcoordZcoord>

    I'll look at the script you mentioned. That might point me in the right direction.

    Thanks - Steve
  • Ok, here's two scripts.... one shows up under the plugins menu and changes the names of all systems on the map, and the other shows up on the pop up menu when you right click a system, and changes only that system. Customize and rename the scripts to taste...

    Basic plugin
    #plugin	custom name all
    #author		NBOS
    #desc		changes all system names to &lt;sector&gt;-&lt;x&gt;-&lt;y&gt;-&lt;z&gt;
    
    
    oSector = GetCurrentSector()
    
    
    for i = 1 to oSector.SystemCount()
    	b = oSector.GetSystem( i-1)
    	oSector.Dynaload( b)
    	b.ClearChildrenNames
    	b.Name = oSector.Name & "-" & CInt(b.x) & "-" & CInt(b.y) & "-" & CInt(b.z)
    	b.SetChildDesignations b.Name
    next
    

    pop-up menu
    #popmenu	custom name assignment
    #author		NBOS
    #desc		changes the system name to &lt;sector&gt;-&lt;x&gt;-&lt;y&gt;-&lt;z&gt;
    
    
    oSector = GetCurrentSector()
    
    if not isNull( EditingBody) Then
    	oSector.Dynaload( EditingBody)
    	EditingBody.ClearChildrenNames
    	EditingBody.Name = oSector.Name & "-" & CInt(EditingBody.x) & "-" & CInt(EditingBody.y) & "-" & CInt(EditingBody.z)
    	EditingBody.SetChildDesignations EditingBody.Name
    End if
    

    Save these as .AstroScript files in the plugins directory, and restart Astro
  • Thanks Ed,

    With just a little more tweaking I was able to get exactly what I wanted out of it. That was a huge time saver for me. Thank you very much.

    Later - Steve
  • How can I tweak these scripts so that the names don't use the sector name, using my name generator instead, and show the coordinates to two decimal places?

    Very cool, by the way.

    Is there a plugin writing guide, or do we just use the alienAPI script and figure it out ourselves?
  • The AlienAPI is about all that I have found to help me, but Ed is very helpful with specific questions. I've also dissected many of the other plugins out there to learn how they operate as well. I will try and look more at what you need and see if I can help. I should be able to find some time this weekend.

    Later - Steve
  • Sweet.

    I think I'll dive into the AlienAPI right now to see what I can learn. Wish me luck <holds breath, grabs nose>

Leave a Comment