Jump to content
Developer Wiki and Function Reference Links ×

Auto Recompile - Vectorscript


twk

Recommended Posts

Thanks guys, I'm using a script for this, however I was also looking for it in the Menu's. Appreciate the help.

Furthermore on the include file approach, I managed to get the include to point to a file on network drive. However trying to add another include in the code on a network drive throws an error.

Working structure:

{$INCLUDE L:\VWScripting\PIOCodes\PortalFrame.vss}

Procedure PotalFrame;
VAR
PIOh, hParm, hParmRecord, hWall : HANDLE;
PIONameh : STRING;
BoolCheck : BOOLEAN;

PROCEDURE A_TextureByClass(h: HANDLE);
   VAR
       i : INTEGER;
   BEGIN
       IF (h <> NIL) THEN
           IF IsTextureableObject(h) THEN
               FOR i := 0 TO 2 DO { primary, secondary, tertiary }
                   SetTextureRef(h, -1, i);
                   { -1 as texture ID is "byClass" flag }

       { walls will need all parts set, roofs only 0 and 1, the rest only 0 }
   END;

<..code continues..>

And this compiles nicely.

However trying to add an include in that PortalFrame.vss throws an error. The include file is in the same location as the portalFrame.vss

Procedure PotalFrame;
VAR
PIOh, hParm, hParmRecord, hWall : HANDLE;
PIONameh : STRING;
BoolCheck : BOOLEAN;

{$INCLUDE TextureByClass.vss}

Error says 'The specified file cannot be found, etc etc'

Any idea what I'm doing wrong?

Edited by TuiWalker
Link to comment

If you use absolute paths, you should be able to nest your includes several files deep. I've succeeded nesting 4 levels deep and even get it to work across a network, PC to Mac. Keep playing with it. It should work.

At one point I did have to add extra backslashes to the front of the volume name of the Mac address when running from the PC. {$Include \\\minimac\etc. }

Not sure if this is pertinent to PC addresses running across a PC network.

Raymond

Link to comment

Very strange, actually that wasn't the fix. I mean it fixed it, but its stange.

Every $include file(sub-include?) I include into the main $include file I need to add an extra 'end;' statement to the code.

The subroutine written as code working in the main file:

Procedure CustomRect(rectx, recty, Movx, Movy: REAL);
Begin
	Rect(0,recty, rectx, 0);
	HMove(LNewObj, Movx, Movy);
End;

However saving this code as a customrect.vss and including it in the main include file won't work unless an extra 'end;' statement is added, like this:

Procedure CustomRect(rectx, recty, Movx, Movy: REAL);
Begin
	Rect(0,recty, rectx, 0);
	HMove(LNewObj, Movx, Movy);
End;
END;

Anyone know why this is so?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...