Author Topic: FTLD decsription ~ FTL MFD  (Read 4377 times)

Jon

  • Callsign "Doc"
  • Project Manager
  • *
  • Posts: 1845
  • Why? That's all I ask.
    • Rag Tag Fleet
Re: FTLD decsription
« Reply #15 on: August 20, 2008, 04:23:52 AM »
Not to mention taking less time to code modules too. Now any ship can be more fleet compatible right out of the gate ! Well done C  8)

Also it allows a single point of updates so that as the FTL MFD evolves so does the fleet without having to download all new ship DLLs.


Please take a moment to visit our sponsor: Yankee Clippers Mobile Dog Wash and Groom

Aliens control my mind. It's the only reasonable explanation  why I do this.

computerex

  • Engineer/Test Pilot
  • *
  • Posts: 57
Re: FTLD decsription
« Reply #16 on: August 20, 2008, 10:49:53 AM »
Now all we need is an attach MFD that allows attaching right "here" like the flattop does.
That would mean that we could do away with all the attach code in the fleet ships and allow as many ships to land in the bays as you like.

The only problem would be launch from Vipertubes but because that is so ship centric I could just code a pop-up that moves the ships from the generic MFD attach point to the viper tube and then launches it.

So how does the flattop exactly work? Does it simply create a attachment point on your position (but on deck) and use the fleet compatible attachment point on the approaching vessel to snap it? Have you looked at the autoattach plug-in? It tries to emulate docking port behavior by automatically attaching attachment points when they get inside a certain range. As I understand it, right now you may land as many fleet ships as possible? If you want to use autoattach, you might have to cover the entire landing area with attachment points. I think a better alternative however is to create landing pads on the mesh, so the number of vessels that can land on the ship is limited, which makes things easier to handle. Then you could do other fancy stuff, such as creating beacons on the pad, like the prelude base from Dan Steph. Autoattach will handle all the attachment code, and the ships will only have to deal with any visual effects.
cheers!

Jon

  • Callsign "Doc"
  • Project Manager
  • *
  • Posts: 1845
  • Why? That's all I ask.
    • Rag Tag Fleet
Re: FTLD decsription
« Reply #17 on: August 20, 2008, 11:48:14 AM »


I convert the global pos of the attaching ship to flattop local. If the ship is in range I create an attach point at the local x,z but snap it to the y of the deck. It is created with a losose connection so that the ship stays pointed in the direction it came in at. This does cause a few problems during saves and loads because you have to detach all the ships and then reattach them.

It is limited to 10 attach points.

Here is the attach code.
Code: [Select]
void QJFlat::AttachShip(DWORD inx_in){
             VECTOR3 gaph, gpship, ourship;
          //   VECTOR3 aphpos, aphdir, aphrot;
             ATTACHMENTHANDLE   hAtt;

             //find a free deck point
             for(i=0;i<25;i++){
                if(!GetAttachmentStatus(APDeck[i])) break;
             }
             if(i>23) return;

             double grab_distance = 500.0, freeAP=0.0;
             // get our position
             oapiGetGlobalPos (GetHandle(), &ourship);
             //I now know were we are so lets find the another ship
             OBJHANDLE hV = oapiGetVesselByIndex(inx_in); //get requestor handle
             oapiGetGlobalPos (hV, &gpship); // get global postion of requestor and put into gpship
             // Make sure that the requestor is close enough to us
             if (dist(gpship, ourship) < grab_distance) {
                 VESSEL *v = oapiGetVesselInterface (hV);
                 DWORD nAttach = v->AttachmentCount (true); //Get attachment count. I do this because there may be more than one child point.
                 if (nAttach > 0){ // Only continue if ship has a child attach point
                    for (DWORD j = 0; j < nAttach; j++) { // now scan all attachment points of the candidate
                        hAtt = v->GetAttachmentHandle (true, j);
                        // this allows me to filter out all but Fleet attach points.
                        const char *id = v->GetAttachmentId (hAtt);
                    Global2Local (gpship, gaph);
                        gaph.y = 52.549; //this is the top of the deck
                        SetAttachmentParams(APDeck[i], gaph, _V( 0,  0, 1), _V( 0, 1, 0)); //Set the attach point X and Z to the same place as the requesting ship.
                        if(!strncmp (id, "VAP", 3))AttachChild (hV, APDeck[i], hAtt);
                        if(!strncmp (id, "APR", 3))AttachChild (hV, APDeck[i], hAtt);
                        if(!strncmp (id, "APC", 3))AttachChild (hV, APDeck[i], hAtt);
if(!strncmp (id, "APW", 3))AttachChild (hV, APDeck[i], hAtt);
}
}
            }
            return;
}

Here is the save:
Code: [Select]
void QJFlat::clbkSaveState (FILEHANDLE scn)
{
char cbuf[256];
char cbuf2[25];
// default vessel parameters
VESSEL2::clbkSaveState (scn);

// custom parameters

    sprintf (cbuf, "%0.4f", hdf_amt);
oapiWriteScenario_string (scn, "HDF", cbuf);

sprintf (cbuf, "%0.4f", fs_factor);
oapiWriteScenario_string (scn, "FSEN", cbuf);

sprintf (cbuf, "%0.4f", gs_factor);
oapiWriteScenario_string (scn, "GSEN", cbuf);

sprintf (cbuf, "%0.4f", wfxd);
oapiWriteScenario_string (scn, "WFXD", cbuf);

sprintf (cbuf, "%0.4f", djd);
oapiWriteScenario_string (scn, "DJD", cbuf);

    sprintf (cbuf, "%d %0.4f", door_status, door_proc);
    oapiWriteScenario_string (scn, "DOOR", cbuf);


for(i=0; i<10;i++){
       if (GetAttachmentStatus(APDeck[i])){
           oapiGetObjectName (GetAttachmentStatus(APDeck[i]), cbuf, 50);
   sprintf (cbuf2, "AD%d%", i);
           oapiWriteScenario_string (scn, cbuf2, cbuf);
   }
}
    DetachShips();
}

Here is the reattach code on load
Code: [Select]
void QJFlat::clbkLoadStateEx (FILEHANDLE scn, void *vs)
{
    char *line;
    sprintf (apdname0, "");
sprintf (apdname1, "");
sprintf (apdname2, "");
sprintf (apdname3, "");
sprintf (apdname4, "");
sprintf (apdname5, "");
sprintf (apdname6, "");
sprintf (apdname7, "");
sprintf (apdname8, "");
sprintf (apdname9, "");
// VECTOR3 apdpos, apddir, apdrot;
    while (oapiReadScenario_nextline (scn, line)) {
        if (!_strnicmp (line, "HDF", 3)) {
            sscanf (line+3, "%lf", &hdf_amt);

} else if (!_strnicmp (line, "FSEN", 4)) {
            sscanf (line+4, "%lf", &fs_factor);

} else if (!_strnicmp (line, "GSEN", 4)) {
            sscanf (line+4, "%lf", &gs_factor);

} else if (!_strnicmp (line, "WFXD", 4)) {
            sscanf (line+4, "%lf", &wfxd);

} else if (!_strnicmp (line, "DJD", 3)) {
            sscanf (line+3, "%lf", &djd);

} else if (!_strnicmp (line, "DOOR", 4)) {
            sscanf (line+4, "%d%lf", &door_status, &door_proc);


} else if (!_strnicmp (line, "AD0", 3)) {
            sscanf (line+3, "%s", &apdname0);
} else if (!_strnicmp (line, "AD1", 3)) {
            sscanf (line+3, "%s", &apdname1);
} else if (!_strnicmp (line, "AD2", 3)) {
            sscanf (line+3, "%s", &apdname2);
} else if (!_strnicmp (line, "AD3", 3)) {
            sscanf (line+3, "%s", &apdname3);
} else if (!_strnicmp (line, "AD4", 3)) {
            sscanf (line+3, "%s", &apdname4);
} else if (!_strnicmp (line, "AD5", 3)) {
            sscanf (line+3, "%s", &apdname5);
} else if (!_strnicmp (line, "AD6", 3)) {
            sscanf (line+3, "%s", &apdname6);
} else if (!_strnicmp (line, "AD7", 3)) {
            sscanf (line+3, "%s", &apdname7);
} else if (!_strnicmp (line, "AD8", 3)) {
            sscanf (line+3, "%s", &apdname8);
} else if (!_strnicmp (line, "AD9", 3)) {
            sscanf (line+3, "%s", &apdname9);
} else {
            ParseScenarioLineEx (line, vs);
            // unrecognised option - pass to Orbiter's generic parser
        }
    }

  SetAnimation (anim_door, door_proc);
  if (fs_factor <= 0.0) fs_factor = 0.25;
  if (gs_factor <= 0.0) gs_factor = 10.0;
  if (djd <= 0.0) djd = DEFAULT_JUMP_DISTANCE;
  }


void QJFlat::clbkPostCreation ()
{
    MyID=ConnectToOrbiterSoundDLL3(GetHandle());
    RequestLoadVesselWave3(MyID,HDBUILD,  "Sound\\QJBay\\HDBUILD.wav",   INTERNAL_ONLY);
    RequestLoadVesselWave3(MyID,HDSTOP,   "Sound\\QJBay\\HDSTOP.wav",    INTERNAL_ONLY);
    RequestLoadVesselWave3(MyID,FFSYNC,   "Sound\\QJBay\\FFSYNC.wav",    INTERNAL_ONLY);

APDeckHandle[0] = oapiGetVesselByName(apdname0);
APDeckHandle[1] = oapiGetVesselByName(apdname1);
APDeckHandle[2] = oapiGetVesselByName(apdname2);
APDeckHandle[3] = oapiGetVesselByName(apdname3);
APDeckHandle[4] = oapiGetVesselByName(apdname4);
APDeckHandle[5] = oapiGetVesselByName(apdname5);
APDeckHandle[6] = oapiGetVesselByName(apdname6);
APDeckHandle[7] = oapiGetVesselByName(apdname7);
APDeckHandle[8] = oapiGetVesselByName(apdname8);
APDeckHandle[9] = oapiGetVesselByName(apdname9);


for(i=0;i<10;i++){
        for (DWORD the_inx = 0; the_inx < oapiGetVesselCount(); the_inx++){
if(oapiGetVesselByIndex (the_inx) == APDeckHandle[i]){
  AttachShip(the_inx);
   break; //Got index so bail out of for loop
            }
}

}



Please take a moment to visit our sponsor: Yankee Clippers Mobile Dog Wash and Groom

Aliens control my mind. It's the only reasonable explanation  why I do this.

computerex

  • Engineer/Test Pilot
  • *
  • Posts: 57
Re: FTLD decsription
« Reply #18 on: August 20, 2008, 12:23:58 PM »
Looking at that, I think it would be best if you just let Autoattach handle it. The plug-in is located at orbithangar:
http://orbithangar.com/searchid.php?ID=3508

You will have to create some sort of visual marker on the mesh in order to show where the attachment points are.

Here's the latest of FTL MFD:

It takes ten seconds to recharge the FTL drive. I have yet to implement fuel consumption, sound and visual effects.

zip package here: http://www.mediafire.com/?sharekey=39cb2b53aaaed6ead2db6fb9a8902bda

EDIT:

Newest shot, with the fleet feature included:
« Last Edit: August 20, 2008, 04:42:05 PM by computerex »
cheers!

Captain Rodolphus

  • Callsign "Shadow"
  • Project Manager
  • *
  • Posts: 1704
Re: FTLD decsription
« Reply #19 on: August 20, 2008, 08:37:18 PM »
I wish I would have read this before I responded in another area :-[ This is coming along very nicely. Ended up jumping way too far into what Z calls the weird zone where stuff just ain't quite right, oops lol. Looking forward to the fleet capability.



computerex

  • Engineer/Test Pilot
  • *
  • Posts: 57
Re: FTLD decsription
« Reply #20 on: August 20, 2008, 11:06:02 PM »
I wish I would have read this before I responded in another area :-[ This is coming along very nicely. Ended up jumping way too far into what Z calls the weird zone where stuff just ain't quite right, oops lol. Looking forward to the fleet capability.

Fleet capability has already been implemented, I just haven't uploaded the package.

EDIT:

Here's the latest build: http://www.mediafire.com/?sharekey=faf3a09aaac9d15bd2db6fb9a8902bda
It's screaming for some sounds. Now you can power up/power down the drive, saving you fuel. Jon, I wonder if I can get power up, power down, charging, powered on, and valid/invalid MFD button sounds. Does anyone know of a source ?
« Last Edit: August 21, 2008, 01:42:53 PM by computerex »
cheers!

tgep

  • Callsign " Poobah "
  • Project Manager
  • *
  • Posts: 1494
    • The Palace of The Grand Exhaulted Poobah
Re: FTLD decsription ~ FTL MFD
« Reply #21 on: August 21, 2008, 02:27:19 PM »
Here is a link to some .wav files used in the USS Coranado simulation. Maybe some of these will work for you or give you some ideas of what your looking for.

http://www.jestertrek.com/coro2400/bodies/siminfo/support.html
" Hand grenades are like RAM. You can never have enough. "

Captain Rodolphus

  • Callsign "Shadow"
  • Project Manager
  • *
  • Posts: 1704
Re: FTLD decsription ~ FTL MFD
« Reply #22 on: August 23, 2008, 02:58:30 AM »
Those are excellent sounds. It seems to me whenever they jump it makes a sound like a bad spring. I couldn't even type the sound I mean. But if you watch the show, especially the very beginning of season 3 when the ships leave the orbit of New Caprica, they all jump on their own in a rapid pace. Ping ping ping etc... But it's like a reverse spring. We are powering up coils are we not? Maybe we need a sound byte from the show?  Pr--eeong Thats as close as I can come. As far as the charging, gosh we could use a multitude of sounds for that. Theres got to be some wub-wub-wub sounds out there?
« Last Edit: August 23, 2008, 03:19:10 AM by Captain Rodolphus »



ZCochrane

  • Project Manager
  • *
  • Posts: 300
Re: FTLD decsription ~ FTL MFD
« Reply #23 on: August 25, 2008, 06:08:30 AM »
Woo-HOOO!  Nice job there, computerex!

I DO, in fact, have some very show-specific sounds ripped right from the current BSG series... works quite well with the default-BSG-hard-coded jumps... perhaps I could sneak a peek at your MFD code to see where sounds/wav files might go?

Warmly,
ZCochrane

~~~~~~~~EDIT~~~~~~~~~~
Dumb-ass=Me.   I didn't notice that you in fact DID include the source code.  Sorry about that.  Also:  the sounds that tgep provided a link to ARE very, very nice indeed!
« Last Edit: August 25, 2008, 06:22:02 AM by ZCochrane »

computerex

  • Engineer/Test Pilot
  • *
  • Posts: 57
Re: FTLD decsription ~ FTL MFD
« Reply #24 on: August 26, 2008, 12:18:04 AM »
I don't have an ounce of creativity in me, so if anyone would be kind enough to simply find me the appropriate sounds, I don't think it should take long to add them in along with some visual effects.
« Last Edit: August 26, 2008, 12:22:07 AM by computerex »
cheers!

tgep

  • Callsign " Poobah "
  • Project Manager
  • *
  • Posts: 1494
    • The Palace of The Grand Exhaulted Poobah
Re: FTLD decsription ~ FTL MFD
« Reply #25 on: August 26, 2008, 06:27:25 AM »
I've got lotsa wav files so just tell me how many you need and what sequence you want them for and I'll put a sound pack together for you.

I'll see if I can find one that says " Target locked " when you enter your target destination too.
" Hand grenades are like RAM. You can never have enough. "

computerex

  • Engineer/Test Pilot
  • *
  • Posts: 57
Re: FTLD decsription ~ FTL MFD
« Reply #26 on: August 27, 2008, 05:23:46 AM »
We will need:

drive activating (mechanical, not a voice)
drive deactivating (^)
drive active (perhaps a sound that we can loop when the drive is active?)
drive charging (mechanical)
jumping

It would also be a nice touch to play a sound when any of the MFD buttons are pressed, and a "invalid operation" sound if the user does something bad, such as entering a target name that doesn't exist.
cheers!

tgep

  • Callsign " Poobah "
  • Project Manager
  • *
  • Posts: 1494
    • The Palace of The Grand Exhaulted Poobah
Re: FTLD decsription ~ FTL MFD
« Reply #27 on: August 27, 2008, 06:22:36 AM »
I'll look thru my .wav files and send you the others.  ;D
" Hand grenades are like RAM. You can never have enough. "

gamma7897

  • Callsign ~ Shiner
  • Crew
  • *
  • Posts: 77
Re: FTLD decsription ~ FTL MFD
« Reply #28 on: September 15, 2010, 08:58:06 AM »
I like the ftl drive but quite frankly its to hard to operate. I have to make smal jumps but that takes forever unless you travel from earth to the luna (moon). I look forward to having a system where you pick ypur target and then you press jump. For those who work on just that, when you make it work it will be a great innovation. No it would be a revolution for travelning with rtf ships in orbiter. The sole reason why i downloaded orbiter is because i am addicted to battlestar galactica. And orbiter gives a great foundation for living the story once again! ;D ;D ;D ;D ;D :D ;D :)
If I got an idea, i ask myself HOW IN THE MERRY CHRISTMAS DO I DO IT?

Jon

  • Callsign "Doc"
  • Project Manager
  • *
  • Posts: 1845
  • Why? That's all I ask.
    • Rag Tag Fleet
Re: FTLD decsription ~ FTL MFD
« Reply #29 on: September 15, 2010, 02:25:00 PM »
I look forward to having a system where you pick ypur target and then you press jump.
Where's the fun in that?
Just use the scn editor if you want to jump to another planet.

I like the Warp drive and would even exclude the FTL jump if I could get away with it. I like it even better with the newer ships that have the 1 and 10 meter Warp capability.
« Last Edit: September 16, 2010, 05:08:28 AM by Jon »


Please take a moment to visit our sponsor: Yankee Clippers Mobile Dog Wash and Groom

Aliens control my mind. It's the only reasonable explanation  why I do this.