lfnetwork.com mark read register faq members calendar

Thread: Help With Adding TSL Planets To Galaxy Map
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 08-28-2006, 04:20 PM   #1
Mostly dormant
stoffe's Avatar
Status: Administrator
Join Date: Apr 2002
Posts: 5,850
Helpful!  10 year veteran!  Notable contributor 
Help With Adding TSL Planets To Galaxy Map

(Explanation: This is a response to a PM I got, since the forum apparently won't let you post this long messages in PMs. Since it might be of at least some use to others I posted it here instead. I hope this is OK.)

Originally Posted by dangen77
I've read all the posts on adding a planet to the galaxy map. I've added my planet to Line 12 in the planetary 2da and I've edited a_galaxymap.ncs to include:
(...correct script snipped...)
However, nothing new shows up in the galaxy map. Is there anything else I need to add to make it show up? Did I put this line in the wrong place? Did I type the wrong syntax? The file comiles without error. Any help would be appreciated.

To add a new working planet to the Ebon Hawk Galaxy Map you'd roughly follow these steps. The NSS files for scripts mentioned below exist either in scripts.bif, or can be found in one of the tutorial forums below Holowan Labs:
  1. Make a galaxy map icon for your planet. The easiest way is to extract one of the existing GAL_*_2.tpc files (where * is the planet name, for example GAL_M478_2.tpc), edit that one and then save it under a new name. In this example I'll call the new planet Gaia, so I'll save the modified icon as gal_gaia_2.tga. Put this in the override folder.

    Next, create a TXI file containing the texture information KotorTool likely had trouble extracting when you converted the TPC file to TGA. Create a new text file, name it the same as your TGA file but with a TXI extension instead (gal_gaia_2.txi), and as content of the file type in mipmap 0. Save this file along with the TGA file in the override folder.

  2. Open your dialog.tlk file with a TLK editor (TalkEd will do), and add two new entries. The first should contain the name of your new planet (Gaia in this example), the second should contain the specifics of the planet, laid out like:
    Climate: Terran
    Terrain: Mixed
    Docking: Gaia's Landing

    Write down the StrRef numbers these two entries were added as, you'll need those numbers soon.

  3. From gui.bif, extract the file named galaxymap_p.gui and save it in your override folder. Open this file with a GFF Editor, expand the CONTROLS list field and select the struct with listindex 11, copy it and paste it in under the CONTROLS field to add a new struct to the list while saving yourself some manual field creation. Open your newly pasted struct, find the BORDER struct inside it and expand that one too. There, find the FILL field and change its value to the name of the planet icon you created in step 1 above, gal_gaia_2 in this case.

    Next back up to your new struct again and expand the EXTENT struct (inside it) and change the LEFT and TOP fields to the X and Y coordinates on the galaxy map where you want your planet to appear. Check the coordinates for some of the other planets to get an idea of the scale, though some trial and error may be needed to find the desired location.

    Next back up to your new struct again and expand the HILIGHT struct (inside it) and change the value of the FILL field here to the name of the icon you created in step 1 above as well, gal_gaia_2 in this case.

    Back up to your new struct again and find the TAG field. Set this to something that has the name of your planet for simplicity, I use LBL_Planet_Gaia in this example, and write this down somewhere as you'll need this tag soon.

    Save changes to the modified galaxymap_p.gui file.

  4. Next, open Planetary.2da and find line 12 (live planet 2):
    • Change the Label field here to the name of your planet (Gaia).
    • Change the name field to the StrRef number of the name of your planet from step 2 above.
    • Change the description field to the StrRef number of the description from step 2 above.
    • Change the icon field to the name of the icon you created in step 1 above (gal_gaia_2).
    • Change the model field to the name of the model (MDL/MDX) file of the model you want to use for the "spinning planet" 3D view when you select your planet on the galaxy map. Unless you've made a new unique model for your planet you can re-use one of the existing ones, as I do in this example. I set the value planet_06 here, borrowing the planetary view of Dantooine for my planet.
    • Change the guitag field to the Tag of the struct you added to the galaxymap_p.gui file in the previous step, LBL_Planet_Gaia in this example.
    Save your modified planetary.2da in the override folder.

  5. Extract the include file named k_inc_hawk.nss from scripts.bif and put where you compile your scripts. You'll need to make some changes to this include file and use this modified copy when recompiling the following scripts.
    • First, find the function named SetBackground(). This is responsible for setting what is seen outside the cockpit window in the Ebon Hawk when you have "arrived" at the planet. As far as I am aware it's currently not possible to add new room animations to an area model, so you'll have to use a view from one of the existing planets. Pick one that's close enough to resemble your new planet, I'll use the view for Dxun in this example.

      Scroll down to near the end of the long switch...case statement in this function, and before default: add a new case and set the room animation number you want to use here. In this example it looks like (the bolded part is what I added):
      case 10://Hyperspace
          nRoomAnimation = ANIMATION_ROOM_SCRIPTLOOP11;
      case 12: //ST: Gaia....
          nRoomAnimation = ANIMATION_ROOM_SCRIPTLOOP05;
          AurPostString("EBO ERROR: No background sepcified!",15,15,10.0);
    • Next, scroll down to the function SetHologramWorld() and do the same. Before the default: case, add a new case for your planet, like (again, bolded part is what added, the other is just to show where to insert it):
      case 10://Hyperspace
          sResRef = "";
      case 12: //ST: Gaia...
          sResRef = "holo_tel";
          AurPostString("EBO ERROR: No background sepcified!",15,15,10.0);
      This function set the name of the placeable UTP file for the holographic image of a planet that is shown in the main hold of the ebon hawk while "landed" on the planet. Pick one of the existing ones to re-use if you haven't made your own model, it doesn't matter which one since they are all completely identical as far as I can tell. I used holo_tel in this example.

    • Last, find the function GetCurrentPlanet(), which is used to tell the other scripts what planet you are currently landed/docked at. Again insert a new case near the end, like (bolded part is new, again...):
      case 10://Hyperspace
          return PLANET_EBON_HAWK;
      case 12: //ST: Gaia...
          return PLANET_LIVE_02;
          return PLANET_EBON_HAWK;
    Save this modified k_inc_hawk.nss include file in a place where it will be used when you recompile the next batch of scripts below.

  6. In the script a_galaxymap.nss (used to open the map screen), add...
    SetPlanetAvailable(PLANET_LIVE_02, TRUE);
    SetPlanetSelectable(PLANET_LIVE_02, TRUE);

    ...somewhere near the end to make sure the planet is always reachable. If you want the planet to only be reachable under certain conditions you may add additional checks here as well, but in this example the planet should always be there so the above is sufficient. Save the modified script, recompile it and put the resulting a_galaxymap.ncs file in the override folder.

  7. In the script k_sup_galaxymap.nss (used when you pick a destination at the map screen), find the switch statement near the start of the main() function that begins like switch(GetGlobalNumber("003EBO_BACKGROUND")). Add a new case at the end for your planet, like:
    case 12: // ST: Gaia....
    This part plays the departure and hyperspace movies to give the impression of the ship travelling to its destination. If you've made a departure movie for your planet (or want to re-use an existing one) add a QueueMovie() call with the name of the BIK movie file as parameter. Otherwise you can do as the above example and skip the departure movie and go straight to the "jump to hyperspace" movie.

    Next scroll down to the next switch statement. This plays the arrival/landing movie for the destination planet, and sets which planet the Ebon Hawk is currently loaded on. Add a new case at the end, like:
    case PLANET_LIVE_02:
    This sets which planet you are currently landed on. If you've made a new landing movie for your planet, or want to re-use an existing one you can add a QueueMovie() call with the name of the BIK movie file as parameter after the last of the SetGlobalNumber() function calls.

    Save and recompile the file, and put the resulting k_sup_galaxymap.ncs file in the override folder.

  8. If you want to restrict what NPCs may be brought along when exiting the Ebon Hawk on your new planet you can modify the script tr_leave_ehawk.nss to add these restrictions. This script is the OnEnter script of the exit ramp trigger inside the Ebon Hawk.

  9. Open the script check_party_gui.nss and scroll down to the ExitEbonHawk() function (it should be at the top of the script if you use the re-created script I made). In the switch statement inside this function, add a new case above the default case, like (bold text is new):
    case 10: sDest = "IN_TRANSIT"; 	break;
    case 12: sDest = "ST_GAIA"; 	break;
    default: sDest = "ERROR";
    The text you assign at case 12 above (ST_GAIA) is the name of the MOD or RIM file containing your new module (st_gaia.mod in this example). This tells the game what module to load when you exit the Ebon Hawk. Save, recompile and put the resulting check_party_gui.ncs file in the override folder.

These steps will add a new planet to the galaxy map. When selected, a "jump to hyperspace" movie is played and the hawk is "landed" on that planet. When you exit the Ebon Hawk, the module for the new planet will load. With reservation for typos and poor memory, since I just wrote this thing it's only roughly proof-read.


Last edited by stoffe -mkb-; 08-29-2006 at 05:58 AM. Reason: More typos, spelling, the usual...
stoffe is offline   you may: quote & reply,
Old 08-28-2006, 05:00 PM   #2
goldberry's Avatar
Join Date: Dec 2005
Location: London, Enfield
Posts: 610
stoffe, I LOVE YOU!!!!!!!

This is the most easy to understand Galaxy Map tutorial I have seen.

*saves page to desktop*

goldberry is offline   you may: quote & reply,
Old 08-28-2006, 08:04 PM   #3
8-Bit Code Monkey
Mav's Avatar
Join Date: May 2004
Location: A House
Posts: 4,042
Current Game: SWTOR
10 year veteran! 
I'll go ahead and nominate this as an "add-on" to the existing tutorial for this subject

"Women are like sunsets… they’re beautiful, but there will be a different one tomorrow." - Gilder
Mav is offline   you may: quote & reply,
Old 08-29-2006, 12:24 AM   #4
Shadow Lord Of The Sith™
RedHawke's Avatar
Status: Moderator
Join Date: Mar 2004
Location: Stormreach CA.
Posts: 9,184
Current Game: DDO, Stormreach
10 year veteran! 
Added to General Tutorials section...


"Beware the form-fitting black armor-clad Drow hottie with twin Mineral II Greensteel Khopeshes!"
"Liella d'Orien says, '"You're the fool, Devil. -- Witness the power of this fully ARMED and OPERATIONAL Titan!"'"
RedHawke is offline   you may: quote & reply,
Old 08-29-2006, 03:16 AM   #5
Lit Ridl
@Lit Ridl
Junior Member
Lit Ridl's Avatar
Join Date: May 2006
Location: Moscow, Russia
Posts: 437

Is it possible only with the live planets?
Will adding new row work (somehow I think no)?

Are you game developer???
So many knowledges in one people...

{snip, most of my mods are on my computer}

My website

My pcgamemods page
Also you may find some of my mods on FileFront
Lit Ridl is offline   you may: quote & reply,
Old 09-04-2007, 02:46 PM   #6
Qui-Gon Glenn
@Qui-Gon Glenn
Digory Kirke's Bafflement
Qui-Gon Glenn's Avatar
Join Date: May 2007
Location: Irune
Posts: 1,492
Current Game: KotOR awww yeah
Folder extraordinaire  Helpful!  Forum Veteran  Veteran Modder 
My apologies to all for bumping a very old thread.

Your tutorial is excellent Stoffe, although I have made some errors here and there. I do have one direct and simple question.

I think I understand the scale of the Galaxy Map, and how to use the left (x) and top (y) coordinates. If I am imagining things correctly (which would be rare) this is a 300 high by 600 long rectangle? Starting at the bottom left hand corner at 0,0?

This works out when I sketch the existing planets out into a simple map with this 300x600 grid. However my planet appeared in a different place than I expected. Just wanting to double check my thinking with anyone else in the community.
Qui-Gon Glenn is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Star Wars Gamer > Community > The Star Forge > Knights of the Old Republic series > Holowan Laboratories > Help With Adding TSL Planets To Galaxy Map

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -4. The time now is 03:36 AM.

Powered by vBulletin®
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.