adding Hail Menues etc 13 replies

  • 1
  • 2

Please wait...

skipper

2nd bestMaster Donut Eater

50 XP

2nd May 2002

0 Uploads

448 Posts

0 Threads

#1 15 years ago

How do you add Menues like Hail at the helm etc? i just want to mess about to see what i can do i want to do a Ramming Speed mod but where do i start scripting?

that is how you spell Ramming is it or as it just got 1 "m" in?

Thanks :)




idontknow

|Place Word Here|

50 XP

15th September 2002

0 Uploads

479 Posts

0 Threads

#2 15 years ago

they are in the *character*menuhandlers.py file. heres an example takjen from the XOMenuHandlers.py file is this what you are looking for?:

############################################################################### # XO ############################################################################### # # Commander # Set Alert Level # Green # Yellow # Red # Report # Contact Engineering # Objectives # Contact Starfleet # ###############################################################################

pDatabase = App.g_kLocalizationManager.Load("data/TGL/Bridge Menus.tgl")

#pXOPane = App.TGPane_Create(LCARS.TACTICAL_MENU_WIDTH, LCARS.TACTICAL_MENU_HEIGHT) pXOMenu = App.STTopLevelMenu_CreateW(pDatabase.GetString("Commander")) pXOPane = App.STStylizedWindow_CreateW("StylizedWindow", "NoMinimize", pDatabase.GetString("Commander"), 0.0, 0.0) pXOPane.AddChild(pXOMenu, 0.0, 0.0, 0)

pXOMenu.AddPythonFuncHandlerForInstance(App.ET_ST_BUTTON_CLICKED, "Bridge.BridgeMenus.ButtonClicked")

# Communicate import BridgeMenus pCommunicate = BridgeMenus.CreateCommunicateButton("XO", pXOMenu) pXOMenu.AddChild(pCommunicate, 0.0, 0.0, 0)

# Report pReport = BridgeUtils.CreateBridgeMenuButton(pDatabase.GetString("Damage Report"), App.ET_REPORT, 0, pXOMenu) pXOMenu.AddChild(pReport, 0.0, 0.0, 0)

# Alert Levels pXOMenu.AddChild(BridgeUtils.CreateBridgeMenuButton(pDatabase.GetString("Green Alert"), App.ET_SET_ALERT_LEVEL, App.CharacterClass.EST_ALERT_GREEN, pXOMenu), 0.0, 0.0, 0) pXOMenu.AddChild(BridgeUtils.CreateBridgeMenuButton(pDatabase.GetString("Yellow Alert"), App.ET_SET_ALERT_LEVEL, App.CharacterClass.EST_ALERT_YELLOW, pXOMenu), 0.0, 0.0, 0) pXOMenu.AddChild(BridgeUtils.CreateBridgeMenuButton(pDatabase.GetString("Red Alert"), App.ET_SET_ALERT_LEVEL, App.CharacterClass.EST_ALERT_RED, pXOMenu), 0.0, 0.0, 0)

# Objectives pObjectives = App.STCharacterMenu_CreateW(pDatabase.GetString("Objectives")) pXOMenu.AddChild(pObjectives, 0.0, 0.0, 0)

# Mission Log pShowLog = BridgeUtils.CreateBridgeMenuButton(pDatabase.GetString("Show Mission Log"), App.ET_SHOW_MISSION_LOG, 0, pXOMenu) pXOMenu.AddChild(pShowLog, 0.0, 0.0, 0)

# Contact Starfleet pContactStarfleet = BridgeUtils.CreateBridgeMenuButton(pDatabase.GetString("Contact Starfleet"), App.ET_CONTACT_STARFLEET, 0, pXOMenu) pXOMenu.AddChild(pContactStarfleet, 0.0, 0.0, 0)

# Contact Engineering pContactEngineering = BridgeUtils.CreateBridgeMenuButton(pDatabase.GetString("Contact Engineering"), App.ET_CONTACT_ENGINEERING, 0, pXOMenu) pXOMenu.AddChild(pContactEngineering, 0.0, 0.0, 0) pContactEngineering.SetDisabled()

However i am running the abandon ship scripts with the new abandon ship button but it isnt in that file. ill search around for where it is stored and post it here if i find it




skipper

2nd bestMaster Donut Eater

50 XP

2nd May 2002

0 Uploads

448 Posts

0 Threads

#3 15 years ago

Right thanks i have added a button under the "Fire at will" in the Tactical but it hasnt got any wrighting on its just got ????? on it

this is what i put on it mine is the bottom 1

pPhasersOnlyButton = BridgeUtils.CreateBridgeMenuButton(pDatabase.GetString("PhasersOnly"), ET_PHASERS_ONLY, 0, pTacticalMenu) pPhasersOnlyButton.SetAutoChoose(1) pPhasersOnlyButton.SetChosen(0) pPhasersOnlyButton.SetChoosable(1) pTacticalMenu.AddChild(pPhasersOnlyButton)

pTargetingButton = BridgeUtils.CreateBridgeMenuButton(pDatabase.GetString("Target At Will"), ET_TARGETING_TOGGLED, 0, pTacticalMenu) pTargetingButton.SetAutoChoose(1) pTargetingButton.SetChosen(1) pTargetingButton.SetChoosable(1) pTacticalMenu.AddChild(pTargetingButton)

pTargetingButton = BridgeUtils.CreateBridgeMenuButton(pDatabase.GetString("Ramming Speed"), ET_TARGETING_TOGGLED, 0, pTacticalMenu) pTargetingButton.SetAutoChoose(1) pTargetingButton.SetChosen(1) pTargetingButton.SetChoosable(1) pTacticalMenu.AddChild(pTargetingButton)

but why the ????? and not the name RammingSpeed?




idontknow

|Place Word Here|

50 XP

15th September 2002

0 Uploads

479 Posts

0 Threads

#4 15 years ago

hmm. I'm not to sure rhy its doing that. I think it might have something to do with the data stored in the bridge menu tgl file. try pming defiant. he got the abandon ship button working with text on the XO menu and the In System warp bitton working with text on the Helm Menu

EDIT: does this help?

# lets create the Button now if (g_pSaffi != None): event = Lib.Ambiguity.getEvent(ET_ABANDON_SHIP) g_pSaffi.AddPythonFuncHandlerForInstance(event, __name__ + ".AbandonShip") pButton = QuickBattle.QuickBattle.CreateBridgeMenuButton(App.TGString("Abandon Ship"), event, 0, g_pSaffi) pSaffiMenu.PrependChild(pButton)

App.TopWindow_GetTopWindow().AddPythonFuncHandlerForInstance(AS_TIMER1, __name__ + ".StartAbandonShip") App.TopWindow_GetTopWindow().AddPythonFuncHandlerForInstance(AS_END_SCENE_TIMER, __name__ + ".AS_End_Cutscene")

# Red Alert, Abandon Ship now! -what todo: def AbandonShip(pObject, pEvent): #print("Abandon Ship")

this looks like the text used to create the abandon ship button. Once you have the abandon ship mod installed the file containting that information is located in Scripts/Custom/Autoload folder




skipper

2nd bestMaster Donut Eater

50 XP

2nd May 2002

0 Uploads

448 Posts

0 Threads

#5 15 years ago

Well ive been trying but no look hehe all ive been getting is the dreded Black screen or just get stuck on the loading screen ive added a mutaers button i did it with the help from the Engineers Mod for QB which that was easy its just the Mod it self whats getting up my nose hehe I bet its quite easy to do it be just me lacking experiance in this lol but ill keep trying




idontknow

|Place Word Here|

50 XP

15th September 2002

0 Uploads

479 Posts

0 Threads

#6 15 years ago

lol try pming defiant and asking him how he managed to get the abandon ship/go to engineering/in system warp buttons working




skipper

2nd bestMaster Donut Eater

50 XP

2nd May 2002

0 Uploads

448 Posts

0 Threads

#7 15 years ago

am i doing the right thing here this is from the QBAuto ive added these in

import App import MissionLib import Bridge.BridgeUtils import QuickBattle.QuickBattle import Custom.QuickBattleGame.QuickBattle

pBridge = App.g_kSetManager.GetSet('bridge') g_pSaffi = App.CharacterClass_GetObject(pBridge, "XO") pSaffiMenu = Bridge.BridgeUtils.GetBridgeMenu("XO") ET_COLLISION_COURSE = App.Mission_GetNextEventType() def CollisionCourse(pObject, pEvent): iType = pEvent.GetInt() if (iType == App.CharacterClass.EST_SET_COLLISION_COURSE): pGame = App.Game_GetCurrentGame() pPlayer = pGame.GetPlayer() if pPlayer == None: return

pTarget = pPlayer.GetTarget() pTarget = pEnemy.GetTarget()

if (pTarget == None): return event = Lib.Ambiguity.getEvent(COLLISION_COURSE)

g_pKiska.AddPythonFuncHandlerForInstance(event, __name__ + ".CollisionCourse")

pButton = QuickBattle.QuickBattle.CreateBridgeMenuButton(App.TGString("CollisionCourse"), event, 0, g_pKiska)

pKiskaMenu.PrependChild(pButton)

-------------------------------------------------------------------------- this is from in the main script if you no what i mean? pKiskaMenu = Bridge.BridgeUtils.GetBridgeMenu("Helm") if (pKiskaMenu != None): pKiskaMenu.AddPythonFuncHandlerForInstance(App.ET_DOCK, __name__ + ".QBRDockButtonClicked") pKiskaMenu.AddPythonFuncHandlerForInstance(App.ET_HAIL, __name__ + ".QBRHailHandler")

pKiskaMenu = Bridge.BridgeUtils.GetBridgeMenu("CollisionCourse") if (pKiskaMenu !=None): pKiskaMenu.AddPythonFuncHandlerForInstance(App.ET_COLLISION_COURSE, __name__ + ".QBRCollisionCourseButtonClicked") pBrexMenu = Bridge.BridgeUtils.GetBridgeMenu("Engineer") pBridge = App.g_kSetManager.GetSet('bridge') g_pBrex = App.CharacterClass_GetObject(pBridge, "Engineer") if (pBrexMenu != None): event = Lib.Ambiguity.getEvent("ET_TRANSPORT") g_pBrex.AddPythonFuncHandlerForInstance(event, __name__ + ".QBRTransport") pButton = Custom.QuickBattleGame.QuickBattle.CreateBridgeMenuButton(App.TGString('Transporter'), event, 0, g_pBrex) pBrexMenu.PrependChild(pButton)

event = Lib.Ambiguity.addEventHandler("XO", "ET_CONFIG", __name__ + ".QBRConfig") Lib.Ambiguity.createMenuButton("XO", "Configure", event, "Configure") event = Lib.Ambiguity.addEventHandler("XO", "ET_CREDITS", __name__ + ".QBRCredits") Lib.Ambiguity.createMenuButton("XO", "Credits", event, "Credits")

# Init and Start LoadQBautostart.ImportQBautostart(0,0)

# Custom.QuickBattleGame.QuickBattle.StartSimulation(pObject, pEvent) def QBRStartSimulation(pObject, pEvent): if (Custom.QuickBattleGame.QBGUI.CheckSetup() == 0): pTopWindow = App.TopWindow_GetTopWindow() pModalDialogWindow = App.ModalDialogWindow_Cast (pTopWindow.FindMainWindow (App.MWT_MODAL_DIALOG)) pModalDialogWindow.Run(None, App.TGString("Not enough data. Please check that all your ships have a name and a starting system and that you have assigned a PLAYER ship."), App.TGString("OK"), None, None, None) else: Custom.QuickBattleGame.QuickBattle.ResetQB() if (pObject): pObject.CallNextHandler(pEvent) # Restart LoadQBautostart.ImportQBautostart(1,0)

def QBRConfig(pObject, pEvent): Custom.QuickBattleGame.QuickBattle.Config(pObject, pEvent)

def QBRCredits(pObject, pEvent): Custom.QuickBattleGame.QuickBattle.Credits(pObject, pEvent)

def QBRTransport(pObject, pEvent): Custom.QuickBattleGame.QuickBattle.Transport(pObject, pEvent)

def QBRHailHandler(TGObject, pEvent): Custom.QuickBattleGame.QuickBattle.HailHandler(TGObject, pEvent)

def QBRDockButtonClicked(pObject, pEvent): Custom.QuickBattleGame.QuickBattle.DockButtonClicked(pObject, pEvent)

def QBRShipExploding(pObject, pEvent): Custom.QuickBattleGame.QuickBattle.ShipExploding(pObject, pEvent)

def QBRShipDestroyed(pObject, pEvent): Custom.QuickBattleGame.QuickBattle.ShipDestroyed(pObject, pEvent)

def CollisionCourse(pObject, pEvent): Custom.QuickBattleGame.QuickBattle.CollisionCourse(pObject, pEvent) -------------------------------------------------------------------------- And this is from the LoadQBAutoStart

# # Based off of Dasher's LoadExtraPlugins based off of Banbury's GetShipList() # def ImportQBautostart(QBrestart, CollisionCourseONOFF): dir = "scripts\\Custom\\QBautostart"

import nt import string

list = nt.listdir(dir) list.sort()

dotPrefix = string.join(string.split(dir, '\\')[1:], '.') + '.'

for plugin in list: s = string.split(plugin, '.') if len(s) <= 1: continue # Indexing by -1 lets us be sure we're grabbing the extension. -Dasher42 extension = s[-1] fileName = string.join(s[:-1], '.')

# We don't want to accidentally load the wrong ship. if (extension == 'pyc' or extension == 'py'): if ( fileName == "CollisionCourse" ): if ( CollisionCourseONOFF == 1 ): pModule = __import__(dotPrefix + fileName) else: pModule = __import__(dotPrefix + fileName) if ( QBrestart == 1 ): if hasattr(pModule ,"Restart"): pModule.Restart() --------------------------------------------------------------------------

If you want you can lol if its totaly wrong because all i keep getting is the black screen and when i type error in the consol it just says stuff about foundation and No Modual named Collision Course

DOH




idontknow

|Place Word Here|

50 XP

15th September 2002

0 Uploads

479 Posts

0 Threads

#8 15 years ago

im not too sure. it does look alright but im not entirly familiar with that amount of scripting myself.

Sorry




skipper

2nd bestMaster Donut Eater

50 XP

2nd May 2002

0 Uploads

448 Posts

0 Threads

#9 15 years ago

ok thanks

ill send another PM to Defient to see if its right lol




Defiant

Free GNU user

50 XP

28th March 2002

0 Uploads

742 Posts

0 Threads

#10 15 years ago

*Looking left and right ans saying Hello*

Well...This is a very long source code and bad formatted - thx to this forum, so I can't see very much. Could you send me your file? :)




  • 1
  • 2