Results 1 to 5 of 5

Thread: How to draw ATPA bounds inside Smart Client?

  1. #1
    Join Date
    Mar 2012
    Location
    Grambling, LA
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Smile How to draw ATPA bounds inside Smart Client?

    Simba Code:
    {*******************************************************************************
    procedure DebugATPABounds(aPoints: Array Of TPointArray);
    By: Wizzup?, lordsaturn, & caused
    Description: Shows an image of the client, plotting each TPA's bounds as a box
                 of different colour per TPA. If a name is specified, an image
                 will be saved.
    *******************************************************************************}


    //I used Wizzup procedure as a base to create this Procedure which does not work
    //All credits goes to Wizzup, Hope it is not called plagiarism
    Procedure DebugATPABounds1(atpa:T2DPointArray);
    var
      i, length: Integer;
      B: TBox;
    begin
      length := High(atpa);
      for i:=0 to length do
        begin
          B := GetTPABounds(atpa[i]);
          SMART_DrawBox(B);
        end;
    end;
    Source: Debug.simba by Wizzup

    I wanted to create a debug boxes inside SMART which shows the boundaries of all TPAs of the given ATPA, I tried to modify the script to draw the debug box images inside the smart but did not work.

    Does Simba have predefined function/includes to do so? I have seen these Debug images inside SMART in MSI scripts, anybody could help me please?

  2. #2
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    So that Procedure does not work? What's it not doing correctly?

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  3. #3
    Join Date
    Mar 2012
    Location
    Grambling, LA
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    So that Procedure does not work? What's it not doing correctly?
    My modified procedure did not draw the boxes around boundaries of all TPAs of the ATPA.

    However, the problem is fixed because SMART has a function SMART_DebugATPA() which does what exactly I wanted, Draw the boxes boundaries of all TPAs inside the SMART window.

    I should have researched more before asking in forum. My bad.

  4. #4
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    This is because "SMART_DrawBox" clears the screen when called, therefore you'll only ever see just one box, if any. Try this instead:
    Simba Code:
    Procedure DebugATPABounds1(atpa:T2DPointArray);
    var
      i, length: Integer;
      B: TBox;
    begin
      length := High(atpa);
      for i:=0 to length do
        begin
          B := GetTPABounds(atpa[i]);
          SMART_DrawBoxEx(False, B, clRed);
        end;
    end;

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  5. #5
    Join Date
    Mar 2012
    Location
    Grambling, LA
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    This is because "SMART_DrawBox" clears the screen when called, therefore you'll only ever see just one box, if any. Try this instead:
    Simba Code:
    Procedure DebugATPABounds1(atpa:T2DPointArray);
    var
      i, length: Integer;
      B: TBox;
    begin
      length := High(atpa);
      for i:=0 to length do
        begin
          B := GetTPABounds(atpa[i]);
          SMART_DrawBoxEx(False, B, clRed);
        end;
    end;
    Thanks for the fix Flight, It works perfect now.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •