Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsJedi Knight and Mysteries of the Sith Editing Forum → cleave2vectex
cleave2vectex
2009-03-31, 4:22 PM #1
I installed the cleave2vx plugin (found http://jkhub.net/library/index.php/Tools:Cleave2VX) and attempted to use with ZED and it gave me a "START JED (v8+) BEFORE USE" error message. I added it to the JED plugins and started JED v0.951b and still get the same message.

What's worse, is that I now get that same message with ALL of my plugins (at least the ones by UGGBOOT). I deleted the cleave2vertex plugin and STILL get the same error message with all my plugins in both JED and ZED. This is very frustrating because I really need to use the MirrorMadness plugin...

This plugin had a special extra file that checked file versions. I'm thinking it must of created a registry file somewhere, but for the life of me I can't figure out where.

Any thoughts on how I can resolve this?

I think the problem file is: Cleave2VX.dpr
Code:
{ Cleave2VX - An OLE plugin for JED versions 8.5 and higher.
  This cleaves the current surface between the first two multiselected vertices.
  Usually you can cleave between vertices by holding SHIFT, but this doesn't
  always work, especially in sectors with a high vertex count.
  Written by Craig Urquhart (UGG_BOOT) 5Dec98. Email: cu@rpi.net.au
  Imperial Detention Center: http://www.rpi.net.au/~cu/main.html }

program Cleave2VX;

{ You need 'ComObj' for the OLE connection, and 'Windows' for the message box.
  If you used the Delphi ShowMessage box you would need 'Dialogs' which would
  add another 100K to your executable filesize for almost no advantage }
uses
    SysUtils, ComObj, Windows;

var
   Jed: Variant;

{ Check that Jed is running and that it's version supports the functions used }
procedure StartUp;
begin
     try
        Jed := CreateOleObject('JED.App');
     except
           MessageBox(0, PChar('START JED (v8.5+) BEFORE USE.'),
                     PChar('Cleave2VX'), MB_ICONEXCLAMATION);
           Halt(1);
     end;
     if Jed.Version < 0.85 then
     begin
          MessageBox(0, PChar('REQUIRES JED VERSION 8.5 OR HIGHER.'),
                     PChar('Cleave2VX'), MB_ICONEXCLAMATION);
          Halt(1);
     end;
end;

procedure CleaveSurface;
var
   SC, VX1, SCTEST, VX2, SF, SFOLD, NVX, VXI1, VXI2, i, sfi, VX: Integer;
   SCO, SFO, SFOOLD: Variant;
begin
{ Check two verticies multiselected and that they are on same surface }
     if Jed.NMultiSelected(2) < 2 then
     begin
          MessageBox(0, PChar('MULTISELECT TWO VERTICES TO CLEAVE BETWEEN'),
                     PChar('Cleave2VX'), MB_ICONEXCLAMATION);
          Halt(1);
     end;
     Jed.GetSelectedVX(0, SC, VX1);
     Jed.GetSelectedVX(1, SCTEST, VX2);
     if SC <> SCTEST then
     begin
          MessageBox(0, PChar('VERTICES NOT IN THE SAME SECTOR'),
                     PChar('Cleave2VX'), MB_ICONEXCLAMATION);
          Halt(1);
     end;

{ Setup a variant for the current surface and the number of verticies on it. }
     Jed.MapMode := 1;
     Jed.GetCurSF(SC, SFOLD);
     SCO := Jed.Level.GetSector(SC);
     SFOOLD := Jed.Level.GetSurface(SC, SFOLD);
     NVX := SFOOLD.NVertices;

{ Find the index of each selected vertex on the surface }
     VXI1 := -1;
     for i := 0 to (NVX - 1) do
          if SFOOLD.GetVertex(i) = VX1 then VXI1 := i;
     if VXI1 = -1 then
     begin
          MessageBox(0, PChar('FIRST VERTEX IS NOT ON THE SURFACE'),
                     PChar('Cleave2VX'), MB_ICONEXCLAMATION);
          Halt(1);
     end;

     VXI2 := -1;
     for i := 0 to (NVX - 1) do
          if SFOOLD.GetVertex(i) = VX2 then VXI2 := i;
     if VXI2 = -1 then
     begin
          MessageBox(0, PChar('SECOND VERTEX IS NOT ON THE SURFACE'),
                     PChar('Cleave2VX'), MB_ICONEXCLAMATION);
          Halt(1);
     end;

{ Check that the verticies are not next to each other }
     if (VXI1 = VXI2 + 1) or (VXI1 = VXI2 - 1) or
        ((VXI1 = 0) and (VXI2 = (NVX -1))) or
        ((VXI1 = (NVX -1)) and (VXI2 = 0)) then
     begin
          MessageBox(0, PChar('VERTICIES LIE NEXT TO EACH OTHER'),
                     PChar('Cleave2VX'), MB_ICONEXCLAMATION);
          Halt(1);
     end;

{ Insert new surfaces }
     SF := SCO.AddSurface;
     SFO := Jed.Level.GetSurface(SC, SF);
     SFO.InsertVertex(0, VX1);
     i := VXI1 + 1;
     if i = NVX then i := 0;
     sfi := 1;
     while i <> VXI2 do
     begin
           VX := SFOOLD.GetVertex(i);
           SFO.InsertVertex(sfi, VX);
           Inc(i);
           Inc(sfi);
           if i = NVX then i := 0;
     end;
     SFO.InsertVertex(sfi, VX2);
     SFO.Update;

     SF := SCO.AddSurface;
     SFO := Jed.Level.GetSurface(SC, SF);
     SFO.InsertVertex(0, VX2);
     i := VXI2 + 1;
     if i = NVX then i := 0;
     sfi := 1;
     while i <> VXI1 do
     begin
           VX := SFOOLD.GetVertex(i);
           SFO.InsertVertex(sfi, VX);
           Inc(i);
           Inc(sfi);
           if i = NVX then i := 0;
     end;
     SFO.InsertVertex(sfi, VX1);
     SFO.Update;

{ Remove old surface, update and redraw display }
     SCO.DeleteSurface(SFOLD);
     SCO.Update;
     Jed.UpdateMap;
end;

{ This is the 'main' program which is run first }
begin
     StartUp;             { Try to connect to JED through OLE, otherwise quit }
     CleaveSurface;       { Cleave surface between two mulitselected verticies }
end.
2009-04-01, 10:15 PM #2
I've had that issue before, honestly can't say what I did to fix it. Just, one day, it worked.
2009-04-03, 4:32 AM #3
The plugin seems to fail when creating the OLE JED app object, I guess this is because JED fails to register it at startup (or whenever it does that).

I've had similar problems running my JED plugins on Vista, but running JED as admin solved it for me. So try that.
dr0id
2009-04-03, 8:16 AM #4
Yep, running it as administrator fixes that.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2009-04-03, 4:37 PM #5
<Slaps Forehead> Of course, in my frustration I overlooked the most obvious.

↑ Up to the top!