bumcheekcity
Active member
Weird. I made "main.html" as a ASH script, printing just one line of output and it doesn't seem to be being called. There were no errors.
The only thing I can see that they all have in common is being inside mainpane. The only other method I can think of to produce this effect would be to produce a list of php pages that the generic script would override.
Even then, how many override scripts would be desired to override adventure.php as well as, let's say, the arcade?
EDIT: Just occurred to me... what if it were possible to extract which page you were on. Could a generic override allow for the script writer to specify in ASH which pages were overwritten with the script being applied universally? Poor code would end up producing weird results, but it would mean that a script writer might only need to update a single source.
void main() {
switch (name_of_page) {
case "adventure.php" :
//do stuff for adventure.php
break;
case "arcade.php" :
//and so forth
break;
}
}
Code:void main()
void main( string name_of_page )
String script = request.getBasePath();
script = "testoverride.ash";
File toExecute = new File( KoLConstants.RELAY_LOCATION, script );
void main (){
buffer results;
results.append(visit_url());
results.replace_string(my_name(), "Tester");
results.write();
}
It CAN'T work that way. A specific relay override is under no obligation to actually load the requested page; it could modify the URL, load several pages and merge them somehow, or load nothing and generate the page entirely from scratch. The master override would either have to trigger on each page loaded by the specific override (which would prevent the master override from working on synthetic pages), or modify the text produced by the specific override (in which case problems arise in telling the master override just what page it's overriding).making it go so that the master relay mutilates the page first, then hands the page over to specific other relay overrides?
after: