The following edit can be used to prevent the player from being able to save the game at any random location in your adventure. Macro variable Y is used to dynamically allow or block the 'save' command; if Y<>100, the player is allowed to save the game; if Y=100, saves are blocked. This could be used to restrict saves only to certain regions (like an overworld map) or only when certain conditions apply (like the player standing on/next to a 'save point').
THE EDIT: Because there are two different modules that determine what happens when the user hits Alt+S to save (one module for world map regions and one for room map regions), this edit must be performed in two places.
EDIT #1 - In O_PLAY2.PAS, starting at line 1694, add the lines marked '***' below:
Code: Select all
#68,#16,#31:begin
*** if (ack.variables[25] = 100) then
*** begin
*** if (j2=#16) or (j2=#68) then begin;shutdownsound;halt;end;
*** bottomsay(1,'UNABLE TO SAVE HERE');
*** erasebottom:=3;
*** end else
*** begin
say(43,188,6,' SAVE GAME? [Y/N] ');
ack.plregion:=rgn;
ack.plxch:=xchunkloc;
ack.plych:=ychunkloc;
ack.plxloc:=xinloc;
ack.plyloc:=yinloc;
moved:=false;
repeat
case upcase(readkey) of
'Y':begin;done:=true;moved:=true;end;
'N':if ((j2=#16) or (j2=#68)) then begin;shutdownsound;halt;end else moved:=true;
#27:begin;moved:=true;j2:=#31;done:=false;end;
end;
until moved;
if done then
begin
say(43,188,4,' SAVING GAME... ');
saveconfig;
savemap;
savewmap;
fullgamesave;
savegame_menu;
if (j2=#16) or (j2=#68) then begin;shutdownsound;halt;end;
say(43,188,0,' ');
end;
done:=false;moved:=false;clearbottom;
end;
*** end;
Code: Select all
#68,#16,#31:begin
*** if (ack.variables[25] = 100) then
*** begin
*** if (j2=#16) or (j2=#68) then begin;shutdownsound;halt;end;
*** bottomsay(1,'UNABLE TO SAVE HERE');
*** erasebottom:=3;
*** end else
*** begin
say(43,188,6,' SAVE GAME? [Y/N] ');
ack.plregion:=rgn;
ack.plxch:=room;
ack.plych:=255;
ack.plxloc:=xloc;
ack.plyloc:=yloc;
moved:=false;
repeat
case upcase(readkey) of
'Y':begin;done:=true;moved:=true;end;
'N':if ((j2=#16) or (j2=#68)) then begin;shutdownsound;halt;end else moved:=true;
#27:begin;moved:=true;j2:=#31;done:=false;end;
end;
until moved;
if done then
begin
say(43,188,4,' SAVING GAME... ');
saveconfig;
savemap;
fullgamesave;
savegame_menu;
if (j2=#16) or (j2=#68) then begin;shutdownsound;halt;end;
say(43,188,0,' ');
end;
done:=false;moved:=false;clearbottom;
end;
*** end;