Results 1 to 10 of 10

Thread: Separate random detection code from solving code

  1. #1
    Join Date
    Jun 2006
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Separate random detection code from solving code

    Make a separate function to see if any random was found for people who want to check for randoms but don't want to run your solvers.
    Last edited by Aftermath; 11-20-2011 at 08:06 PM.

  2. #2
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Quote Originally Posted by Aftermath 96 View Post
    Make function to see if any random was found for people who want to check for randoms but don't want to run your solvers.
    Add this:

    Simba Code:
    SolveSRLRandoms := True;


    In your mainloop after SetupSRL;


    ~Home

  3. #3
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    So you mean you have your own solvers?
    Simba Code:
    begin
      SRL_OnFindRandomsCall := @MySolver(false);
    end.
    That will call MySolver every time FindNormalRandoms is called in your script. False will exit FindNormalRandoms, true will continue with the function. You could also just call MySolver in place of FindNormalRandoms.

  4. #4
    Join Date
    Jun 2006
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I assume you mean SolveSRLRandoms := False;

    Judging from the implementation of SolveTeleRandom, at least, doing so will log the player out when a random is encountered. This is not what I want - I want the function to do nothing other than tell me if a random was detected.

    Coh3n: I still want to use SRL's random detection (just not the solving), and that suggestion would require me to do my own detection.
    Last edited by Aftermath; 11-20-2011 at 08:02 PM.

  5. #5
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Aftermath 96 View Post
    I assume you mean SolveSRLRandoms := False;

    Judging from the implementation of SolveTeleRandom, at least, doing so will log the player out when a random is encountered. This is not what I want - I want the function to do nothing other than tell me if a random was detected.
    I don't think you can. You'd have to modify SRL's FindNormalRandoms.

  6. #6
    Join Date
    Jun 2006
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, which is what I was requesting/suggesting in the initial post - that the finding be separated from the solving.

  7. #7
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    You can easily do it on your own. Instead of calling FindNormalRandoms, make a custom function that loops through all of the inRandom functions. There is a detection function that can be used in every random as long as SRL is included.

    Check the files in /core/antirandoms/

  8. #8
    Join Date
    Jun 2006
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    You can easily do it on your own. Instead of calling FindNormalRandoms, make a custom function that loops through all of the inRandom functions. There is a detection function that can be used in every random as long as SRL is included.

    Check the files in /core/antirandoms/
    Thanks, this is what I was looking for. What are the assumptions that SRL libraries run on regarding graphics settings? (Resolution, Software vs. OpenGL vs. DirectX, quality, textures, shading, and other configurable properties?).

  9. #9
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Aftermath 96 View Post
    Thanks, this is what I was looking for. What are the assumptions that SRL libraries run on regarding graphics settings? (Resolution, Software vs. OpenGL vs. DirectX, quality, textures, shading, and other configurable properties?).
    SRL needs to be in safe mode, highest brightness. I recommend setting everything else to the lowest setting possible (with the exception of CPU usage).

  10. #10
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    You're saying you have your own solvers? That'd be cool to see.

    Anyway,
    Simba Code:
    {*******************************************************************************
    procedure LoadTeleRandoms;
    by: ZephyrsFury
    Description: Loads the teleport random information for each random.
    *******************************************************************************}


    procedure LoadTeleRandoms;
    begin
      SetLength(TeleRandoms, 19);

      with TeleRandoms[0] do    //
      begin
        Name := 'leo the gravedigger';
        Music := ['spooky'];
        TypeID := [0, 1];
        IsInRandom := @InLeoGraveyard;
        Texts := ['Leo'];
        TextColors := [128];
        TextFonts := [CharsNPC];
        TextBoxes := [IntToBox(MCX1, MCY1, MCX2, MCY2)];
        SolveRandom := @SolveLeo;
        RandIndex := rand_Leo;
      end;

    All you have to do is edit this SolveRandom := @SolveLeo; to use SRL's detection and your own solver.

    -RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

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
  •