Bridge Commander Central

BC Forums => BC Scripting => Topic started by: cnotsch on May 13, 2008, 04:44:47 AM

Title: Program to port ships from QB to MP
Post by: cnotsch on May 13, 2008, 04:44:47 AM
I'm trying to write a program in vb.NET - not that that matters here - wich reads out all ship scripts, -plugins, -icons and so on lists them in tree boxes: flyable, non-flyable, and unsorted ships. Than you have to correct the automatically created lists until you only have flable and non-flyable ships. After that the program tries to assign icons races and all the stuff needed to create the plugins if it encouters an error finding the right pairs it asks witch to take.
It changes:
\ships\*SHIP*.py
ShipIcons.py
SpeciesToShip.py

So much for the program.

My problem is now the following:
If I look at the scripts they look OK but if I i play MP alone the shipicons are mixed up not there ore someting like that.
If i play with a 2nd PC i've got the same problems additionally the following:
The CLIENT crashes if I add some ships - but it works with others - the courious thing is that it crashes with nearly every romulan ship but works fine with andromeda ships.
Second thing I nearly acciedently see the same ship flying the same ship on the server as on the chient also the hardpoints seem to load from the wrong ships...

I've included my current version of the program as well as the files it created/changed for my install.
To run the program you need the .NET Framework

I'm so STUCK there please HELP a confused treky  :lol: :lol: :lol:

No, yoke aside -if i can say so in english- I really need some help there.
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: MLeo on May 14, 2008, 09:32:38 AM
I think the problem is that the definition of ships is very liberal (no, not the definition of "ships", but the way you define ships) this is because they are scripts, they are executed.

So, to get information, you would have to execute said scripts, because there is absolutely no guarantee that things will be named similarly.


As for your problem with icons, it's the species number, normally, an icon is generated with an incrementing species number.

The species number is important in MP, since that defines all the different pieces (well, 2 pieces, ship and icon) that go to make a ship.

And another thing, everyone in an MP game needs to have the same scripts, and preferably, the same models.
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: FekLeyr Targ on May 14, 2008, 10:18:59 AM
And another thing, everyone in an MP game needs to have the same scripts, and preferably, the same models.
I think it isn't a big problem if your opponent lives near you: You can give him/her your installation or he/she give his/her installation to you. ;)
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 14, 2008, 01:27:25 PM
Sorry if that sounds a bit rude but I DO know that everyone needs exactly the same files - not even new compiled ones from the same source....

As for the species I don't know exactly what you mean because I have assigned an exactly incrementing species number for the ships as well as for the icons... see yourself I've attached an example...
As I said already I don't know what you mean.

I may mix it up a bit but now a statement to your first:
I thaught the shipnames listed in the second part of SpeciesToShip.py are the script-names.???

Oh an other idea is there a limit for the range of the species numbers? I've done it like this:
0-100: nothing
100++:ship-species
after the last ship-sp.:icon-sp.

may it be that i raises some errors because of my many ships? I think at the time there are about 400-500 in my install...

Sorry if I sound a bit silly, but I just don't know what you mean...

Thanks for trying to help me anyway
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: MLeo on May 14, 2008, 01:31:11 PM
First of all, I like to state more information that strictly neccesary, and this issue (about file missmatch) crops up a lot. So stating it more can't hurt in the long run, except now I suppose.



Anyway, the species number for the icon and the ship needs to be the same.
The icon species number is set either implicitly, or in scripts\Icons\ShipIcons.py
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 14, 2008, 01:34:53 PM
Thanks I'll try that out, just thaught It should be different because it is in KM...
Sorry again if my statment didn't sound nice :lol:
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 14, 2008, 01:44:01 PM
I just found a new a bit embarrasing error... I used the same icon nr.s for flyable and non-flyable ships...

 :? :? :?
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: MLeo on May 14, 2008, 02:15:15 PM
The idea is that the species number for a ship is the same as the species number for an icon.

Meaning that if Ship A has number 1, then the icon for Ship A is also 1.
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 14, 2008, 03:05:33 PM
Besides that, do you know where the piece of script is wich is responsible for displaying the ship-names in the ship selection menue in MP? - I had the idea to load them from the ship-scrips/plugins from QB
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 14, 2008, 04:01:36 PM
Ok now I did as you said: same number, increasing, starting at 0(1 if you don't count the UNKNOWN)
Result: bc crashes totally with windoof saying, I've to translate it now, stbc.exe does not work anymore. exit now? debug?
if i want to join the game(as host).
I hope you know what I mean since I don't know how the english error report looks like.

I added my files.
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: MLeo on May 14, 2008, 05:20:56 PM
Try installing a console logger, and if it doesn't start anymore, try deleting options.cfg and rebooting (latter only if the first doesn't work).
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 15, 2008, 03:31:47 AM
The programm runs perfectly normal until the first ship is loaded. The console logger does not record any sign of an error that is the wired thing about that. resetting the files to normal solves the problem. so it have to be the two files SpToSh & IcToSh...

Maybe you could take a look at them...
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: MLeo on May 15, 2008, 06:08:03 PM
I've been looking through things, and it appears that the second number in kSpeciesTuple of SpeciesToShip is the icon "species" number, I suppose I have been confused over the time because the 2 numbers were always the same.

Now, it appears that the ship species must match it's position in the kSpeciesTuple.

Meaning, that the first, Unknown, is 0, etc, etc.
So, if you keep the icon numbers (and the numbers in kSpeciesTuple) and replace your constant list (the list with the all caps names and numbers) with an incrementing one, then it might work even better.
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 16, 2008, 11:58:54 AM
I'll give it a try, besides that do I have to use the standard App.SPECIES_AMBASADOR, ... species-numbers or may I replace them too, because that would make it all a lot easier?
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: MLeo on May 16, 2008, 12:04:35 PM
You don't have to stop using them in the icons, but you can in the species to ship.
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 16, 2008, 12:15:15 PM
so... how do I know which numbers I'm allowed to use or to use for the icon number?
Do you know what I mean?

EDIT:
I'll try to simply replace the ship species like you said -it may work-, but that wold cause that the icon and the ship-species anen't the same anymore, but otherwise it didn't crash the first time when they were different, so it ran at least somehow  :D
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: MLeo on May 16, 2008, 12:55:13 PM
From what I've sofar seen, any.

But you must know that the ship species need to be incremental, starting at 0.
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 16, 2008, 04:03:39 PM
I've tried as you said and IT WORKED!....
....Only once. After restarting it went on crashing all the time. I'm going crazy here rrrrrr!  :x :x :x :x :x
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: MLeo on May 16, 2008, 05:52:11 PM
Define crashing.
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 16, 2008, 07:48:08 PM
As before the game crashes with no reason when first loading a ship meaning the whole process crashes, just as last time: no error just dies... I've so no idea.
The funny thing is that the first time after recreating the scripts it run well for about 40min. until I restarted. I've tried to do ecactly the same again and again but the only result is a windoof error and no comment from python...
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: Defiant on May 17, 2008, 05:13:23 AM
censored
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: LJ on May 17, 2008, 06:02:34 AM
Defiant is spot on.  It is best to make sure it works by hand first, it's how I started before I wrote my MP ship adder programs. :-)

In addition, if it is really working fine until your PC (not BC) restarts, it might be something silly like an open file handle from your program?  I know IDLE used to do strange things regarding keeping files open which I only found out because of a little empirical experimentation with the "quit" button.
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 17, 2008, 06:40:25 AM
I already added several ships manually and it worked...

so i saw you mentioned that the ship's icon species are listed in groups 100-199 for one race 200-299 for anoter.
is that just to keep track or has that a special reason? If so that would mean i'd have to change the ranges a bit because i definetly have more than 100 fed-ships!
so any idea there?

do i have to sort the first list in speciestoship.py in a special order that came out a bit weird?

Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 17, 2008, 06:56:06 AM
nice idea there LJ but resarting anyting(BC or PC) didn't cange anything not even going onto another PC. The only thing working is to backup the scripts-folders ships,multiplayer & icons meaning resetting the game to the state bevore i ran my progam. The silly thing is it WORKED once!!!
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 17, 2008, 07:35:00 AM
do i got that right? :

1.) The order in both lists of speciestoship has to be the same
2.) The first list starts at 1 and has to be incrementing
3.) All flyable ships have to be before MAX_FLYABLESHIPS
4.) All not flyable ships have to be after that
5.) Othewise the order is not important unless you want to sort the list you choose the ships from
6.) The icon number or species as most call it (the second in kSpeciesTuple) is not important but: (or do i have to keep them sorted by race as mentioned before?)
7.) The species in ShipIcons.py has to be the same
8.) The species in The shipfile has to be the same too
9.) The order in ShipIcons.py in not important

did i forget anything?

may the species be below 100 or above 1000?
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: Defiant on May 17, 2008, 08:11:45 AM
censored
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 17, 2008, 08:20:06 AM
i may not have placed my two questions well...
1.) may the species be below 100 or above 1000?
2.) do i have to sort the species by race as mentioned above

if you say all true wich one of those two is? they cant be both true unless it is possible to create new groups below 100 and above 1000  :?: :!: :?:
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: Defiant on May 17, 2008, 08:36:11 AM
censored
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: LJ on May 17, 2008, 08:57:24 AM
If you would like I can *try* to find the source to mine?
(note: it was one of my first ever programs and the code will be pretty rubbish!)
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 17, 2008, 09:06:42 AM
would be very nice.
I had the idea to create a mod wich includes the best version of every ship-class on bc-files but making the mp-scripts by hand would be to difficult so i try to solve that first.

btw, whad language did you use?

Quote
(note: it was one of my first ever programs and the code will be pretty rubbish!)
do you think i'm better in writing clear ^^
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: MLeo on May 17, 2008, 09:40:24 AM
Check your options.cfg, what does it say for Window Width and Window Height?
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: tiqhud on May 17, 2008, 10:25:45 AM
If I read correctly [which I doubt] a program that can take any ship, and put it into MP, isn't that like cheating, cause you'd have a verrrry strong , to your opponents semi weak-one.
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: MLeo on May 17, 2008, 10:27:28 AM
Everyone needs the same scripts, so the other player also has it.
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: tiqhud on May 17, 2008, 11:01:55 AM
OH, since Ive only , plsyed MP for a very short time, I knew that each player need same scripts, this just alluded me that what he was up to, trying to make it easier to get the same scripts, Got it.
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 17, 2008, 12:22:45 PM
Check your options.cfg, what does it say for Window Width and Window Height?

i suppose you are referring to my suspicious errors... if so:
i've tried the following resolutions
windowed: 1024x768;
fullscreen: 1024x768,1280x1024,1600x1200;

but like i said the game works perfectly until the game normally loads the first ship (MP after choosing the first ship, QB during loading)
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: MLeo on May 17, 2008, 12:42:25 PM
But what does the options.cfg say afterwards?
Don't load the game, just what does it say?
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 17, 2008, 03:36:07 PM
same as bevore
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: MLeo on May 17, 2008, 06:14:07 PM
Same as before, as in, no change in BC still crashing, or options.cfg the same (in what way then)?
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 18, 2008, 02:03:24 AM
sorry, i meant the resolution in options.cfg stays as i set it
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: MLeo on May 18, 2008, 08:21:39 AM
Another source of random crashes are missing projectile files.

Have you tried each ship on it's own in QB, firing all projectile based weapons?
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: cnotsch on May 18, 2008, 12:06:01 PM
i said the game crashes the first time a ship is tryed to be loaded so i don't even get to fly a ship.
Title: Re: Program to port ships from QB to MP - HELP!!!
Post by: LJ on May 18, 2008, 12:15:17 PM
Here you go dude.  I think the source code in the mpmpship2.1 folder is that of the program in the shipaddercomp folder, but without a VB6 complier I cannot test it lol.  You don't need the installer, it is just there lol.

I wrote this back in 2004 as one of my first pieces of code :D.  It is *awful* hehe!
I really hope it helps you! :mrgreen:

Edit: would have been more helpful if i had clicked "upload"  :lol: