Results 1 to 7 of 7

Thread: [ogl] passing more than 1 ID in the getModels method

  1. #1
    Join Date
    Mar 2012
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default [ogl] passing more than 1 ID in the getModels method

    I'm trying to learn the OGL library and did understand something I couldn't find in the guide (Clarity's guide)


    Simba Code:
    airEssling:=ogl.getModels(3039914149,1252751151);
    mouse.click(clientCenter.closest(airEssling)[0].randomizePointEllipse(500));

    (airEssling)[0] refers to the first element in the array , But if the object has 2 ID'S?
    I tried to play with it, check if I replace it with (airEssling)[1] it will search only the second ID, it's not.
    Maybe I didn't understand it correctly?

  2. #2
    Join Date
    Jun 2012
    Posts
    586
    Mentioned
    112 Post(s)
    Quoted
    296 Post(s)

    Default

    [3039914149,1252751151]




    Skype: obscuritySRL@outlook.com

  3. #3
    Join Date
    Mar 2012
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by Obscurity View Post
    [3039914149,1252751151]
    Thank you
    I know this kind of questions are ridiculous so i'm sorry for that I didn't program a lot of years.

    edit: I get an error "Don't know which overloaded method to call with params"

  4. #4
    Join Date
    Jun 2012
    Posts
    586
    Mentioned
    112 Post(s)
    Quoted
    296 Post(s)

    Default

    @Clarity; @Ross;

    On my phone and won't be home a few days. Wanna type our a quick description/explanation?




    Skype: obscuritySRL@outlook.com

  5. #5
    Join Date
    Mar 2012
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by Obscurity View Post
    @Clarity; @Ross;

    On my phone and won't be home a few days. Wanna type our a quick description/explanation?
    First of all, thank you and them for the desire to help.
    I still didn't understand how it works.
    Simba Code:
    clientCenter.closest(airEssling)[0].randomizePointEllipse(500));
    the zero here means the first element in the array airEssling?If so why do we have the [0] outside the parenthesis?
    and how can I access all the ID's of airEssling with this function?

  6. #6
    Join Date
    Mar 2012
    Posts
    38
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Ok so I found I had to add the function TCardinalArray([3039914149,1252751151])
    I also found that "t" should be added to methods that conflict with the srl library.
    I think someone should add it to the pinned guide. it will help people.
    I still don't understand why the index is [0] if there are two elements and why it's outside the parenthesis.

  7. #7
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    Reposting PM response:

    Quote Originally Posted by Clarity
    1. A TCardinalArray is an array of cardinals, which are a type of integer:

    Quote Originally Posted by Delphi Basics
    // Integer data types :
    Int1 : Byte; // 0 to 255
    Int2 : ShortInt; // -127 to 127
    Int3 : Word; // 0 to 65,535
    Int4 : SmallInt; // -32,768 to 32,767
    Int5 : LongWord; // 0 to 4,294,967,295
    Int6 : Cardinal; // 0 to 4,294,967,295
    Int7 : LongInt; // -2,147,483,648 to 2,147,483,647
    Int8 : Integer; // -2,147,483,648 to 2,147,483,647
    Int9 : Int64; // -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
    TCardinalArray should no longer be necessary - did the following not work for you?

    Simba Code:
    myModels := ogl.getModels([ID1, ID2, ID3]);

    It used to be necessary - but we changed ogLib to make it easier to code. It used to be necessary simply because cardinal was the data type that the GLX.dll plugin accepted for models, as opposed to an integer.

    2. Because you are clicking on the [0] of clientCenter.closest(airEssling) rather than simply the [0] of airEssling. clientCenter.closest(airEssling) returns a new and different array that is being used in the mouse.click function, and you are trying to get the [0] of that result, rather than the [0] of airEssling by itself.

    Here's a better way to look at it:

    Simba Code:
    var
      airEssling, sortedEsslings: glModelArray;
    begin
      airEssling := ogl.getModels([1452224228,403123861]);
      sortedEsslings := clientCenter.closest(airEssling);
      mouse.click(sortedEsslings[0].randomizePointEllipse(15));
    end;

    It's my pleasure to help. Please feel free to ask any more questions - we are also working on more documentation - ogLib is only maintained by two people so we'll get to it when we have free time!
    I'll be updating the tutorial to reflect the cardinalarray changes - I thought I had done this, my apologies!
    Last edited by Clarity; 11-30-2015 at 11:37 PM.

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
  •