SRL Archive - SRL Archives

Separate random detection code from solving code


Aftermath

2011-11-20 14:52:59

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.

Home

2011-11-20 14:55:30

From: Aftermath 96
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:

  SolveSRLRandoms := True;


In your mainloop after SetupSRL;


~Home

Coh3n

2011-11-20 14:56:25

So you mean you have your own solvers?

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.

Aftermath

2011-11-20 14:59:59

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.

Coh3n

2011-11-20 15:04:32

From: Aftermath 96
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.

Aftermath

2011-11-20 15:05:05

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

NCDS

2011-11-20 20:17:08

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/

Aftermath

2011-11-22 02:02:44

From: NCDS
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?).

Coh3n

2011-11-22 02:11:03

From: Aftermath 96
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).

Sir R. M8gic1an

2011-11-22 09:42:55

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

Anyway,

{*******************************************************************************
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