Author Topic: SubMenu problem  (Read 1675 times)

Offline Nighthawk

  • |______[o]_|
  • Posts: 750
  • Cookies: 18
SubMenu problem
« on: April 25, 2007, 11:18:56 AM »
HELP ME MLEO!!!!!!
lol
I'm trying to use SubMenu 2.0 to sort ships in a QB main menu, but I just can get 1 submenu group inside the main menu.
Is it possible to load more than one?
I want to sort ships under "Federation", "Romulan", "Klingon" and other names, but inside a new QB menu, in parallel with the existing ones

say, I have a Galaxy nicknamed as "Battleship" under the "Federation" submenu.
when I try to load the equivalent Romulan class (Dderidex) also nicknamed "Battleship", and using SubMenu="Romulan Star Empire" in the plugins, it loads up overwriting the Galaxy.

No exceptions on the console until now....

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: SubMenu problem
« Reply #1 on: April 25, 2007, 11:38:37 AM »
My ShipDef inner workings are a bit rusty.

But you can't have 2 ships with the same name (or abrevation I believe).

So, set the LongName to "Battleship" and set the abrevation to fedBattleship for your Galaxy and romBattleship for the Warbird.

I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
Re: SubMenu problem
« Reply #2 on: April 25, 2007, 11:49:42 AM »
try putting a space before "Battleship" , and no space before the other "Battleship"
like:
longName = " Battleship" or
SubMenu = " Battleship" or however you're trying to do it (im not sure i completely understand what you're aiming at)

i think adding a space (or even two) in the longame (and/or Submenu) will allow it so you can have another with the same name (without a space)

just a thought, but i think it would work...  tho, there would be a space in your menu list as well...
you can try it out and see if you like it or not, tho...

Offline Nighthawk

  • |______[o]_|
  • Posts: 750
  • Cookies: 18
Re: SubMenu problem
« Reply #3 on: April 25, 2007, 11:52:33 AM »
try putting a space before "Battleship" , and no space before the other "Battleship"
like:
longName = " Battleship" or
SubMenu = " Battleship" or however you're trying to do it (im not sure i completely understand what you're aiming at)
i think adding a space (or even two) in the longame (and/or Submenu) will allow it so you can have another with the same name (without a space)
just a thought, but i think it might work... 
I'm sure it will work.
but I'm trying to get 2 menus in a main one. I can't realize how one ship defined in another submenu would "Jump" definitions and menues.

this is how it looks like by now:

Galaxy Def:

abbrev = 'XXXXXX'
iconName = 'XXXXXX'
longName = 'Heavy Battleship'
shipFile = 'XXXXXX'
menuGroup = 'AAAAAA'
playerMenuGroup = 'AAAAAA'
species = App.SPECIES_GALAXY
SubMenu = "Federation"

Warbird Def:

abbrev = 'YYYYYY'
iconName = 'YYYYYY'
longName = 'Heavy Battleship'
shipFile = 'YYYYYY'
menuGroup = 'AAAAAA'
playerMenuGroup = 'AAAAAA'
species = App.SPECIES_WARBIRD
SubMenu = "Romulan Star Empire"

this is the aiming:

XXXXXX
 |----Federation
 |        |------Carrier
 |        |------Escort
 |        |------Explorer
 |        |------Dreadnought
 |        |------Heavy Battleship
 |        |------Light Battleship
 |        |------....
...
 |----Romulan Star Empire
          |------Carrier
          |------Scout
          |------Escort
          |------Heavy Cruiser
          |------Heavy Battleship
          |------Light Battleship
          |------....

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: SubMenu problem
« Reply #4 on: April 25, 2007, 12:03:20 PM »
If you go with Jimmy's suggestion, then put the space behind it, same effect, just not noticable in a menu.

[EDIT] Never mind, didn't saw the ascii art, check back in a few moments...
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: SubMenu problem
« Reply #5 on: April 25, 2007, 12:09:17 PM »
Either go with Jimmy's suggestion, or try as I suggested it.

Both should work.
I've just checked, and ships are registerd by the abrevation.
So, as long as the abrevation is different, it should allow the same long names.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline Nighthawk

  • |______[o]_|
  • Posts: 750
  • Cookies: 18
Re: SubMenu problem
« Reply #6 on: April 25, 2007, 12:23:57 PM »
but why can't I get another submenu?

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: SubMenu problem
« Reply #7 on: April 25, 2007, 12:49:18 PM »
Tried SubSubMenu?
Or SubMenu = ["First", "Second", "Third", "Fourth", "Endless"]?

The XXXXXX should be the menuGroup/playerMenuGroup and the rest in SubMenu or SubSubMenu.

I should warn you, if your end user uses SubMenu V1 (not sure why :P) then the SubMenu = [.....] will not work and give a bsod.

On the other hand, do remember that using a SubMenu enabled ship does not require SubMenu (any version).
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline Nighthawk

  • |______[o]_|
  • Posts: 750
  • Cookies: 18
Re: SubMenu problem
« Reply #8 on: April 25, 2007, 01:39:24 PM »
can you elaborate?
I don't understand......

the XXXXXXX is the main menu. (a menu in the QB setup screen)
I could load "Federation" as SubMenu if the main one, but when I use "Romulan" it does not appear.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: SubMenu problem
« Reply #9 on: April 25, 2007, 01:46:19 PM »
Could you attach the actual plugins you are trying in BC?
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline Nighthawk

  • |______[o]_|
  • Posts: 750
  • Cookies: 18
Re: SubMenu problem
« Reply #10 on: April 25, 2007, 02:01:01 PM »
sure.
it's weird that I don't get a BSOD

they are actually named "FedGalaxy" and "RomDderidex", so the Galaxy loads up first.
hence why I don't understand why the warbird does not overwrite it completely.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: SubMenu problem
« Reply #11 on: April 25, 2007, 02:03:36 PM »
sure.
it's weird that I don't get a BSOD
I don't see the attachments at writing, will check back later tonight.


BSODs only happen when there is a scripting error (or an exception raised).
Overwriting of ship plugins isn't neccesairly bad.
For instance, with the Galaxy and Sovereign bridge extensions (BPCore) we actively overwrite the originial bridge plugins (of Galaxy and Sovereign).


[EDIT]

First glance, the FedBattleship doesn't define a SubMenu variable.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
Re: SubMenu problem
« Reply #12 on: April 25, 2007, 02:05:37 PM »
XXXXXX
 |----Federation
 |        |------Carrier
 |        |------Escort
 |        |------Explorer
 |        |------Dreadnought
 |        |------Heavy Battleship
 |        |------Light Battleship
 |        |------....
...
 |----Romulan Star Empire
          |------Carrier
          |------Scout
          |------Escort
          |------Heavy Cruiser
          |------Heavy Battleship
          |------Light Battleship
          |------....


try this:

for the Federation ships, put a space before the name next to longName,
such as:
longName = " Carrier"

longName = " Escort"

and as well - Submenu = "Federation"  (or even try a space before "Federation",
like Submenu = " Federation"

and so forth...

then for your Romulan Ships, don't put a space, like this:

longName = "Carrier"

longName = "Escort"

Submenu = "Romulan"

i think that should work...
i'm not too sure, tho - i'm at work right now, trying to think off the top of my head lol...

btw - why arent you using Submenu v3.7?

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: SubMenu problem
« Reply #13 on: April 25, 2007, 02:10:21 PM »
Um, Jimmy, putting a space before it would have the same effect as putting it after the name (atleast, identification-wise, I mean, "Federation " is different from "Federation" in the same extend as " Federation" is different from "Federation"). The difference is, is that the former isn't noticable (visible) in the GUI.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline Nighthawk

  • |______[o]_|
  • Posts: 750
  • Cookies: 18
Re: SubMenu problem
« Reply #14 on: April 25, 2007, 02:12:13 PM »
[EDIT]
First glance, the FedBattleship doesn't define a SubMenu variable.

ignore that. the Warbird is a copy of the Sovereign plugin, but all of them work. the Federation was finished almost a month ago and has been tested, so it works. I edited the Galaxy plugin manually, but the Warbird is what I want to focus into.

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
Re: SubMenu problem
« Reply #15 on: April 25, 2007, 02:15:49 PM »
Um, Jimmy, putting a space before it would have the same effect as putting it after the name (atleast, identification-wise, I mean, "Federation " is different from "Federation" in the same extend as " Federation" is different from "Federation"). The difference is, is that the former isn't noticable (visible) in the GUI.
really?  cuz i have my Fed ships listed as "  Cruisers", " Warships", and "Battleships", for submenus and they appear with the spaces before them in my ship list, and as such appear as:

Federation
---   Cruisers
------ list of ships
--- Warships
------ list of ships
---Battleships
------list of ships

and i'm pretty sure i was able to duplicate some ships (or perhaps bases) names?
altho for stock ships - shouldnt a "Foundation.ShipDef. ... longName = "whatever" " go at the top of the plugin script, to change the name of the stock ship itself?
dunno offhand tho, ill have to check my install when i get home...

i could be all wrong about this tho, im just thinking quickly lol

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: SubMenu problem
« Reply #16 on: April 25, 2007, 05:45:55 PM »
Ok, I found something interresting while going through the Foundation thanks to some prodding by Jimmy.

It would appear that ships are registered on a Foundation level by their abrevation, so your ship shouldn't have been overwritten (it doesn't, at the Foundation level).

But it is overwritten on a race menu level, since those are registered through their (long) name. Which is the same.

So, putting a space after the long name "should" fix your problem (aside from the missing variable).

Also, about the bsod, not every scripting error generates a bsod, it might just let Foundation skip the plugin, also causing it not to show up, or generate a "silent" error (one that is visible in the console, but doesn't cause a bsod).

I'm thinking of releasing a SubMenu 3.7a, maybe also with TGL support, or something like that.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline Nighthawk

  • |______[o]_|
  • Posts: 750
  • Cookies: 18
Re: SubMenu problem
« Reply #17 on: April 25, 2007, 11:11:50 PM »
well, adding a space at the end worked.
I'd rather use the name with no spaces, but this will do. The ships will be renamed in game by scripts, tho.

for what I saw, maybe the ship file (\scripts\ships) owns the priority. some changes on them made the difference. dunno.

thanks guys!!

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: SubMenu problem
« Reply #18 on: April 26, 2007, 04:48:55 AM »
well, adding a space at the end worked.
I'd rather use the name with no spaces, but this will do. The ships will be renamed in game by scripts, tho.
See my comment on SubMenuV3.7a

Quote
for what I saw, maybe the ship file (\scripts\ships) owns the priority. some changes on them made the difference. dunno.
Pre V3.7 has this, it's an added feature for 3.7 which sorts ships based on their name.

Why are you using V3 or older?
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline Nighthawk

  • |______[o]_|
  • Posts: 750
  • Cookies: 18
Re: SubMenu problem
« Reply #19 on: April 26, 2007, 09:41:28 AM »
nope.
I've just recently upgraded to 3.7

I think i'll re-sort the ships as UFP Battleship, IRW Battleship or IKS Battleship, so they are unique and with no final spaces, but that extends the name way too much.

anyways, it's working fine now. I'll stay with this settings for now. there's a known saying: "If it works, don't touch it".