Author Topic: Starbase 12 set question  (Read 677 times)

Offline X_TheUnknown_X

  • Posts: 325
  • Cookies: 328
  • (Semi) Retired
Starbase 12 set question
« on: April 12, 2010, 02:20:27 PM »
Recently, I've been working on getting my new Fed Starbase model into BC as a replacement for the stock station. I was unwilling to overwrite the stock files beacuse it's easier to change hardpoints, ship descriptions and so on when I add a seperate ship myself (also my station is quite smaller than the stock model, causing complications with a simple model replacement). My plan all along was to create a custom Starbase 12 set which replaced the stock model with mine, and added some ships into the Starbase's dock and flying around the set.

However, when I examined the starbase 12 set file it appeared that the Starbase model is never loaded into the set with the usual 'loadspacehelper' method, in fact the only reference I can find to the model is when the script checks if the station exists in order to dock ships. Although in starbase 12 system file (where all the waypoints are defined) there is a 'Starbase12 Location' waypoint.
 :hithead:
Therefore, I'm asking if anybody knows how the Starbase is actually loaded into the set, so I can substitute the stock model for mine? Or is there any other method of accomplishing this?

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2186
  • Cookies: 1706
  • Life is life
Re: Starbase 12 set question
« Reply #1 on: April 12, 2010, 04:21:08 PM »
Starbase 12 set is a bad example since code which loads Starbase 12 itself is located in the QuickBattle module not the system module.

Alternatively you can use the following code to add a starbase to your set.

Code: [Select]
        # add my object here
        import loadspacehelper, MissionLib
# name of the base
        s = "Somebase"
loadspacehelper.CreateShip("FedStarbase", pSet, s, "SomeLocation")
        pMission = App.Game_GetCurrentGame().GetCurrentEpisode().GetCurrentMission()
        pMission.GetFriendlyGroup().AddName(s)
        pObj = MissionLib.GetShip(s, pSet)

import QuickBattle.StarbaseFriendlyAI
        pObj.SetAI(QuickBattle.StarbaseFriendlyAI.CreateAI(pObj))
Acta, non verba.
aka USS Sovereign

Offline ACES_HIGH

  • BCC Roleplay Game Narrator
  • Moderator
  • Posts: 1678
  • Cookies: 54
  • while(!(succeed=try()));
    • BCC Roleplay Games
Re: Starbase 12 set question
« Reply #2 on: April 13, 2010, 01:13:32 PM »
so that's why sometimes when you load up the Starbase 12 system in QB the station is missing

Offline X_TheUnknown_X

  • Posts: 325
  • Cookies: 328
  • (Semi) Retired
Re: Starbase 12 set question
« Reply #3 on: April 14, 2010, 02:20:16 PM »
I tried using the method you suggested Sovereign, but it still doesn't replace the stock model which is loaded by the quickbattle script. Instead, both space stations are spawned on top of each other.

Would there be any way to override the QB script in the set script, or would I need to modify the QB file responsible for adding Starbase 12?

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2186
  • Cookies: 1706
  • Life is life
Re: Starbase 12 set question
« Reply #4 on: April 16, 2010, 09:47:16 PM »
I was under the impression you were creating a new set for this new starbase and gave you a code snippet to achieve that.

However you need to adjust this sample to your needs, change the appropriate loadspacehelper parameters. I can't do that for you, since I don't even know the name of the new ship script.

Change to your needs
Code: [Select]
loadspacehelper.CreateShip("FedStarbase", pSet, s, "SomeLocation")

There is a way to remove the stock starbase via 1 line of code
Code: [Select]
pSet.RemoveObjectFromSet("Starbase 12")
Acta, non verba.
aka USS Sovereign