by rld » Tue Jul 06, 2010 8:42 am
After playing around with various tweaks and additions to the ACK player module using the source code that Chris so generously made available, I am planning to roll a number of items into a 'mega-patch' that will be used in upcoming projects I am working on.
Once I have it working, I will release it (along with the source code modifications) so that anyone else who is interested can use it in their projects as well.
Here are the features that I am planning at this point. Note that the changes will be to the player module only (not the editor modules) and so the data files will remain 100% compatible between the patched and standard versions.
In general, the use of features will be variable controlled so that someone using the patch has a choice whether to use some or all of the modifications in their game.
1) If a certain bit is set in the Z variable, silently block the Look command.
2) If a certain bit is set in the Z variable, silently block the Get/Drop commands.
3) If a certain bit is set in the Z variable, silently block the Talk command.
4) If a certain bit is set in the Z variable, when the 'I' (Info) key is pressed, skip the Info screen and go directly to the inventory display.
5) If a certain bit is set in the Z variable, when the player attempts to move in a direction, immediately (before any conditions are tested or an actual attempt is made to move) set the D variable to a value corresponding to the direction of the move (north=1, south=2, west=3, east=4). This is a replacement for the LASTMOV mechanism which has some issues, and also (because variable D is testable by terrain conditions) will allow things like 'one-way' spaces and terrain that can only be travelled through in a certain direction. (Or a portal that can only be entered from one side, etc, etc.)
6) If a certain bit is set in the Z variable, check the S variable when the player attempts to save. If S is non-zero, then block the save and display the short message (BMSG) whose number is contained in S.
7) Allow the option for weapons to do damage based on a 'die roll' formula (like 3d6+2) instead of a linear random range. Implement a similar option for the amount of damage blocked by armor.
8) Fix the touch macro, and allow both melee and ranged weapon hits to trigger it. (This allows the implementation of creatures that cast line of sight 'spells' on the player.) Pass the following variables to the touch macro:
V - Number of points of damage inflicted. This can be changed to a different value by the macro; if it is reduced to zero by the macro, no hit message will be displayed.
W - Type of weapon that triggered macro (obj number)
X, Y - Location of creature whose attack triggered the macro.
9) Additions to death macro. Pass the following variables to the creature death macro.
V - Set to zero before calling the macro; represents the creature's current hit points. If the macro sets this variable back to a nonzero value, the creature's hit points will be set to this value and the creature will not die. This allows the implementation of creatures that regenerate, change form or run away after taking a certain amount of damage.
W - Weapon type that killed the creature.
X, Y - Location of creature.
10) Fix the check for maximum range when creatures use distance weapons.
11) If a certain bit is set in variable Z, ignore encumberance calculations and instead use the 'weight' field of weapon objects to hold 'type' flags. Similarly, the EXP field in creatures will hold 'invulnerable to type' flags. If only a few of these flags are used, however, the EXP field can still be used to grant experience to the player.
For example, if a weapon had weight 4 (bit 2 set), and a creature had experience of 12 (bits 2 and 3 set), the creature would take no damage from that weapon. A special message ("YOUR ATTACK HAS NO EFFECT" or something similar) would be displayed to let the player know what is going on.
However, a creature that had experience 3 (bits 0 and 1 set), or 0, or any other value where bit 2 was not set, would take damage from the weapon normally.
12) Implement the following expansions to the DRAW macro command (as detailed in a previous post):
- Get or set the HP of a nearby creature.
- Get or set the type of a nearby creature.
- Draw a single tile (not using transparency) at a specified location.
- Get the EXP field of a nearby creature.
- Draw an SMSG and return immediately without waiting for a keypress.
If anyone has any feedback, or any other ideas that would not be too complicated to implement, let me know.
After playing around with various tweaks and additions to the ACK player module using the source code that Chris so generously made available, I am planning to roll a number of items into a 'mega-patch' that will be used in upcoming projects I am working on.
Once I have it working, I will release it (along with the source code modifications) so that anyone else who is interested can use it in their projects as well.
Here are the features that I am planning at this point. Note that the changes will be to the player module only (not the editor modules) and so the data files will remain 100% compatible between the patched and standard versions.
In general, the use of features will be variable controlled so that someone using the patch has a choice whether to use some or all of the modifications in their game.
1) If a certain bit is set in the Z variable, silently block the Look command.
2) If a certain bit is set in the Z variable, silently block the Get/Drop commands.
3) If a certain bit is set in the Z variable, silently block the Talk command.
4) If a certain bit is set in the Z variable, when the 'I' (Info) key is pressed, skip the Info screen and go directly to the inventory display.
5) If a certain bit is set in the Z variable, when the player attempts to move in a direction, immediately (before any conditions are tested or an actual attempt is made to move) set the D variable to a value corresponding to the direction of the move (north=1, south=2, west=3, east=4). This is a replacement for the LASTMOV mechanism which has some issues, and also (because variable D is testable by terrain conditions) will allow things like 'one-way' spaces and terrain that can only be travelled through in a certain direction. (Or a portal that can only be entered from one side, etc, etc.)
6) If a certain bit is set in the Z variable, check the S variable when the player attempts to save. If S is non-zero, then block the save and display the short message (BMSG) whose number is contained in S.
7) Allow the option for weapons to do damage based on a 'die roll' formula (like 3d6+2) instead of a linear random range. Implement a similar option for the amount of damage blocked by armor.
8) Fix the touch macro, and allow both melee and ranged weapon hits to trigger it. (This allows the implementation of creatures that cast line of sight 'spells' on the player.) Pass the following variables to the touch macro:
V - Number of points of damage inflicted. This can be changed to a different value by the macro; if it is reduced to zero by the macro, no hit message will be displayed.
W - Type of weapon that triggered macro (obj number)
X, Y - Location of creature whose attack triggered the macro.
9) Additions to death macro. Pass the following variables to the creature death macro.
V - Set to zero before calling the macro; represents the creature's current hit points. If the macro sets this variable back to a nonzero value, the creature's hit points will be set to this value and the creature will not die. This allows the implementation of creatures that regenerate, change form or run away after taking a certain amount of damage.
W - Weapon type that killed the creature.
X, Y - Location of creature.
10) Fix the check for maximum range when creatures use distance weapons.
11) If a certain bit is set in variable Z, ignore encumberance calculations and instead use the 'weight' field of weapon objects to hold 'type' flags. Similarly, the EXP field in creatures will hold 'invulnerable to type' flags. If only a few of these flags are used, however, the EXP field can still be used to grant experience to the player.
For example, if a weapon had weight 4 (bit 2 set), and a creature had experience of 12 (bits 2 and 3 set), the creature would take no damage from that weapon. A special message ("YOUR ATTACK HAS NO EFFECT" or something similar) would be displayed to let the player know what is going on.
However, a creature that had experience 3 (bits 0 and 1 set), or 0, or any other value where bit 2 was not set, would take damage from the weapon normally.
12) Implement the following expansions to the DRAW macro command (as detailed in a previous post):
- Get or set the HP of a nearby creature.
- Get or set the type of a nearby creature.
- Draw a single tile (not using transparency) at a specified location.
- Get the EXP field of a nearby creature.
- Draw an SMSG and return immediately without waiting for a keypress.
If anyone has any feedback, or any other ideas that would not be too complicated to implement, let me know.