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.
Printable View
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.
So you mean you have your own solvers?
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.Simba Code:begin
SRL_OnFindRandomsCall := @MySolver(false);
end.
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.
Yes, which is what I was requesting/suggesting in the initial post - that the finding be separated from the solving.
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/
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