View previous topic :: View next topic |
|
Author |
Message |
skipper
Cadet 2nd Class

Joined: 23 Jul 2002
Posts: 66

|
|
|

|
|
|
Code: | import App
import MissionLib
import Bridge.BridgeUtils
import Lib.Ambiguity
import QuickBattle.QuickBattle
import Custom.QuickBattleGame.QuickBattle
pBridge = App.g_kSetManager.GetSet('bridge')
g_pKiska = App.CharacterClass_GetObject(pBridge, 'Helm')
pKiskaMenu = Bridge.BridgeUtils.GetBridgeMenu('Helm')
pGame = App.Game_GetCurrentGame()
pEpisode = pGame.GetCurrentEpisode()
SETIMPULSE = App.Mission_GetNextEventType()
def SetPlayerAction(pAction, pShip):
return Custom.QuickBattleGame.QuickBattle.SetPlayerAction(pAction, pShip)
if (pKiskaMenu != None):
event = Lib.Ambiguity.getEvent("ET_SET_IMPULSE")
g_pKiska.AddPythonFuncHandlerForInstance(event, __name__ + ".SetImpulse")
pButton = QuickBattle.QuickBattle.CreateBridgeMenuButton(App.TGString('SetImpulse'), event, 0, g_pKiska)
pKiskaMenu.PrependChild(pButton) |
thats what ive got so for where abouts do you put it to get them sub menues sorry for keeping buging you but thanks
Editted to use the Code tag so that the indentation would show
|
_________________ Smoke Me A Kipper I'll Be Back For Breakfast
|
|
Back to top |
|
 |
MLeo
Fleet Admiral

Age: 22
Zodiac: 
Joined: 26 Nov 2002
Posts: 11439
Location: Netherlands

|
|
|

|
|
|
First, could a mod split this from the topic?
Second, there is one problem to your code. You created a button, not a menu.
A menu can be created this way:
Code: | pMenu = App.STMenu_Create(App.TGString("Menu Name")) |
And then, for each button you could do something like this:
Code: | pEvent = App.TGFloatEvent()
pEvent.SetFloat(0.0)
pEvent.SetEventType(SETIMPULSE)
pEvent.SetDestination(g_pKiska)
pButton = App.STButton_CreateW(App.TGString("Name"), pEvent)
pEvent.SetSource(pButton)
#And to add it to the menu:
pMenu.AddChild(pButton) |
|
_________________
How to beat the Black Screen Of Death and Script problems Also handles Console/Screen/Error report/dump.
BC Technical FAQ [Last updated 26/12/2005]
"Trust me, I'm a con artist" - Moist von Lipwig, "Going Postal, Discworld"
|
|
Back to top |
|
 |
Sim Rex
Moderator


Age: 26
Zodiac: 
Joined: 11 Apr 2002
Posts: 1714

|
|
|

|
|
|
MLeoDaalder wrote: | First, could a mod split this from the topic? |
Um... Questions like these are the kind of thing this thread actually exists for - small, specific requests for Python/BC API help on topics that are likely to be of interest to quite a lot of people...
So I don't intend to split it. I won't stop you from making your own new thread to continue discussing this in, but I'm not going to remove something on topic and potentially useful from a stickied thread.
|
_________________ "Could it be it's the end of our world? All the things that we cherish and love
Nothing left but to face this all on my own, cause I am the chosen one!"
-- The Fallen Angel - Iron Maiden(Smith/Harris)
For beginner scripters - The BCU Mission Scripting Lessons
|
|
Back to top |
|
 |
skipper
Cadet 2nd Class

Joined: 23 Jul 2002
Posts: 66

|
|
|

|
|
|
thanks MLeoDaalder i just got abit confused what to put in your other thred thanks once again
|
_________________ Smoke Me A Kipper I'll Be Back For Breakfast
|
|
Back to top |
|
 |
dramatdude
Ensign


Age: 22
Zodiac: 
Joined: 14 Apr 2004
Posts: 109
Location: Alpha Quadrant

|
|
|

|
|
|
Alright...I have a model that I've been hardpointing. I finished the hardpoint and saved it. Loaded up BC and got this error when I tried to use the ship.
(Click It)
I can't figure out what the problem is.
|
_________________ "Khan....I'm laughing at the superior intellect."
-Kirk, Star Trek II
|
|
Back to top |
|
 |
MLeo
Fleet Admiral

Age: 22
Zodiac: 
Joined: 26 Nov 2002
Posts: 11439
Location: Netherlands

|
|
|
|
Back to top |
|
 |
dramatdude
Ensign


Age: 22
Zodiac: 
Joined: 14 Apr 2004
Posts: 109
Location: Alpha Quadrant

|
|
|

|
|
|
I don't think the : is missing....afterall, I copied a ship script I knew worked, and filled in the info for the ship I was hardpointing. Here's the script:
Code: | import App
import Multiplayer.SpeciesToShip
def GetShipStats():
kShipStats = {
"FilenameHigh": "data/Models/Ships/Thunderbolt/Thunderbolt.nif",
"FilenameMed": "data/Models/Ships/Thunderbolt/ThunderboltMed.nif",
"FilenameLow": "data/Models/Ships/Thunderbolt/ThunderboltLow.nif",
"Name": "Thunderbolt",
"HardpointFile": "Thunderbolt",
"Species": Multiplayer.SpeciesToShip.SOVEREIGN
}
return kShipStats
def LoadModel(bPreLoad = 0):
pStats = GetShipStats()
# Create the LOD info
if (not App.g_kLODModelManager.Contains(pStats["Name"])):
# Params are: File Name, PickLeafSize, SwitchOut Distance,
# Surface Damage Res, Internal Damage Res, Burn Value, Hole Value,
# Search String for Glow, Search string for Specular, Suffix for specular
pLODModel = App.g_kLODModelManager.Create(pStats["Name"])
pLODModel.AddLOD(pStats["FilenameHigh"], 10, 200.0, 15.0, 15.0, 400, 900, "_glow", None, "_spec")
pLODModel.AddLOD(pStats["FilenameMed"], 10, 400.0, 15.0, 15.0, 400, 900, "_glow", None, "_spec")
pLODModel.AddLOD(pStats["FilenameLow"], 10, 800.0, 15.0, 30.0, 400, 900, "_glow", None, None)
# kDebugObj = App.CPyDebug()
if (bPreLoad == 0):
pLODModel.Load()
# kDebugObj.Print("Loading " + pStats["Name"] + "\n")
else:
pLODModel.LoadIncremental()
# kDebugObj.Print("Queueing " + pStats["Name"] + " for pre-loading\n")
def PreLoadModel():
LoadModel(1)
|
Oh...and another problem I've had....With only this script, when I try to open it in MPE...it opens the script, but nothing shows up in Scene Root. Weird.
|
_________________ "Khan....I'm laughing at the superior intellect."
-Kirk, Star Trek II
|
|
Back to top |
|
 |
MLeo
Fleet Admiral

Age: 22
Zodiac: 
Joined: 26 Nov 2002
Posts: 11439
Location: Netherlands

|
|
|
|
Back to top |
|
 |
dramatdude
Ensign


Age: 22
Zodiac: 
Joined: 14 Apr 2004
Posts: 109
Location: Alpha Quadrant

|
|
|

|
|
|
No...I'm not trying to load that script into MPE. I was loading the Hardpoint.
|
_________________ "Khan....I'm laughing at the superior intellect."
-Kirk, Star Trek II
|
|
Back to top |
|
 |
Capt. Dunivar
Cadet 3rd Class


Age: 30
Zodiac: 
Joined: 29 Aug 2004
Posts: 40

|
|
|

|
|
|
i'm a noob at scripting i know NOTHING about it lol.. frankly i am disappointed nobody made a mod to be able to view a different camera bridge mod in the Sovereign only galaxy has been released and it's driving me nuts i cannot try get some eye candy to view whole all around my damn sov nemesis bridge! i wanna make a good screenie but i don't have files to make a camera move inside the bridge to many positions u get my drift.. 
|
|
|
Back to top |
|
 |
dramatdude
Ensign


Age: 22
Zodiac: 
Joined: 14 Apr 2004
Posts: 109
Location: Alpha Quadrant

|
|
|

|
|
|
@MLeoDaalder: Any other thoughts about the script? Would you like me to show or upload the hardpoint too? This is driving me up the bulkhead!!
|
_________________ "Khan....I'm laughing at the superior intellect."
-Kirk, Star Trek II
|
|
Back to top |
|
 |
SlimyStrike
'Iw ra'wI' Sogh


Age: 17
Zodiac: 
Joined: 01 Dec 2004
Posts: 635
Location: In my Ready room

|
|
|

|
|
|
Does it matter what PHYTON version you use or is there a specified version?
|
|
|
Back to top |
|
 |
Sim Rex
Moderator


Age: 26
Zodiac: 
Joined: 11 Apr 2002
Posts: 1714

|
|
|

|
|
|
SlimyStrike wrote: | Does it matter what PHYTON version you use or is there a specified version? |
BC has version 1.5.2 integrated into it, but for the purposes of downloading a Python editor, the version doesn't really matter much, no. The core concepts of the language haven't changed that much.
|
_________________ "Could it be it's the end of our world? All the things that we cherish and love
Nothing left but to face this all on my own, cause I am the chosen one!"
-- The Fallen Angel - Iron Maiden(Smith/Harris)
For beginner scripters - The BCU Mission Scripting Lessons
|
|
Back to top |
|
 |
Stalker14
Cadet 4th Class


Joined: 05 Aug 2003
Posts: 10

|
|
|

|
|
|
Learning about modding...should be interesting!
-Stalker14
|
_________________

|
|
Back to top |
|
 |
eclipse74569
Lieutenant


Age: 26
Zodiac: 
Joined: 07 Apr 2005
Posts: 361
Location: Originally from NC, but moved to DC

|
|
|

|
|
|
I've been trying to figure this out for quite some time as I have created my very own ship using CG's Sovereign and well... it may sound kinda stupid, but, how do you create a description of a certain ship in the "Player and Region" menu when you select your ship...I've tried and it only gives the description in the "ships" menu, and ??? in the "P and R" menu...
Rog W.
|
|
|
Back to top |
|
 |
MLeo
Fleet Admiral

Age: 22
Zodiac: 
Joined: 26 Nov 2002
Posts: 11439
Location: Netherlands

|
|
|

|
|
|
eclipse74569 wrote: | I've been trying to figure this out for quite some time as I have created my very own ship using CG's Sovereign and well... it may sound kinda stupid, but, how do you create a description of a certain ship in the "Player and Region" menu when you select your ship...I've tried and it only gives the description in the "ships" menu, and ??? in the "P and R" menu...
Rog W. |
Similar as how you add SubMenu's but then replace SubMenu for desc
Use \n for new line.
Though I believe Dasher fixed something for this in FTech... But I'm not sure ATM.
|
_________________
How to beat the Black Screen Of Death and Script problems Also handles Console/Screen/Error report/dump.
BC Technical FAQ [Last updated 26/12/2005]
"Trust me, I'm a con artist" - Moist von Lipwig, "Going Postal, Discworld"
|
|
Back to top |
|
 |
eclipse74569
Lieutenant


Age: 26
Zodiac: 
Joined: 07 Apr 2005
Posts: 361
Location: Originally from NC, but moved to DC

|
|
|

|
|
|
MLeo wrote: |
Similar as how you add SubMenu's but then replace SubMenu for desc
Use \n for new line.
Though I believe Dasher fixed something for this in FTech... But I'm not sure ATM. |
Well, I'm editing this to let you know I've tried what you suggested...didn't work
But, I'm not giving up on it yet LOL I'll figure it out
Rog W.
|
|
|
Back to top |
|
 |
eclipse74569
Lieutenant


Age: 26
Zodiac: 
Joined: 07 Apr 2005
Posts: 361
Location: Originally from NC, but moved to DC

|
|
|

|
|
|
Ok, Figured it out, had nothing to do with Python scripting whatsoever LOL.
Thanks for your help.
|
_________________

|
|
Back to top |
|
 |
|