[ACK PATCH] Skipping the Info screen

Chris H.'s Ultima / ACS-style game development system!

Moderators: Ice Cream Jonsey, joltcountry

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

[ACK PATCH] Skipping the Info screen

Post by rld »

This code patch for the ACK player module (ACK02) is based on the ACK 3.251 release, using the procedure described in a previous post. Warning: given that I do not understand approximately 99% of the code in the ACK source package, it is entirely possible (and in fact quite likely) that modifying your ACK release as detailed below will result in horrific bugs and crashes. I take no responsibility for any aggravation that results from this.

As discussed in a previous thread, it may be a useful feature for some ACK games to be able to skip the 'player info' screen that results upon pressing the 'I' key and move straight on into inventory. This frees the game to implement its own version of the info screen (with an extra command, something like (S)TATUS) which may display variables and info specific to that game. Or you can just leave the info screen off altogether; particularly for games that do not implement things like experience, levels, and encumberance, this may be a useful way to avoid confusing the player.

THE EDIT: In the file O_PLAY0.PAS, change the procedure 'showplayerstatus' as follows. Code lines that were actually changed are prefixed with '***'; don't copy and paste the whole thing since pasting the code into this message has introduced line breaks where they weren't before, and I also snipped out a bit in the middle for length.

Code: Select all

procedure showplayerstatus;
 var
  j:char;
  my_inv:array[1..254] of byte;
  i,i1,top:integer;
  done:boolean;
  s:string;

begin
 savepage;

*** if (ack.variables[26] = 100) then
*** begin
***   player_inventory;
***   restorepage;
***   helpindex:=2;
*** end else
*** begin

 titlebars;
 if &#40;ack.playername<>''&#41; and &#40;ack.playername<>'UNUSED'&#41; then
  say&#40;3,3,0,'NAME&#58; Û1'+ack.playername&#41;;
 if ack.mpmax&#91;0&#93;<>0 then
  s&#58;='Û0  ENERGY&#58; Û1'+strnum&#40;ack.mp&#91;0&#93;&#41;+'Û0/Û1'+strnum&#40;ack.mpmax&#91;0&#93;&#41;
  else s&#58;='';
 say&#40;3,13,0,'HIT POINTS&#58; Û1'+strnum&#40;ack.hp&#91;0&#93;&#41;+'Û0/Û1'+strnum&#40;ack.hpmax&#91;0&#93;&#41;+s&#41;;

<snipped>

 say&#40;1,188,0,'PRESS Û6 I Û0 FOR INVENTORY OR Û6ESCÛ0 TO EXIT'&#41;;
 helpindex&#58;=48;
repeat
 j&#58;=upcase&#40;readkey&#41;;
 if j=#0 then if readkey=#59 then help;
until &#40;j=#27&#41; or &#40;j='I'&#41;;

 if upcase&#40;j&#41;='I' then
  player_inventory;
  
 restorepage;
 helpindex&#58;=2;

*** end;

end;

What does this do? If ack.variables[26] is set to 100, the code will now skip the normal behavior of this procedure (which is to show the 'info' screen optionally followed by inventory) and simply jump to the inventory display.

ack.variables[26] is the Z macro variable, so if Z=100, the info screen will be skipped; otherwise, the Info command will act as normal. When testing this sort of thing, the 'Debug' mode in the adventure configuration editor is helpful as it allows you to peek/poke variable values in the A-Z set by pressing Control+P.

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

Damn i never thanked u for thid rld. Awesome, thanks. I have another request for a code hack. I'll start another thread...
Which of you is interested in my fine wares?

Post Reply