-
-
Notifications
You must be signed in to change notification settings - Fork 4
Free Aiming
The Feature Free Aiming (GFA_RANGED
and/or GFA_SPELLS
) offers some fundamental configuration options, as well as reticle adjustments. Detailed configuration, however, is separated into free aiming for ranged combat and free aiming for spells.
List of setting constants GFA_STRAFING |
Reticle Adjustments GFA_GetRangedReticle |
Enable/Disable the movement while aiming. This affects both ranged and spell combat, but is only applied to either if free aiming for them is initialized (GFA_RANGED
and/or GFA_SPELLS
).
Remove focus when not aiming. The focus (focus name and focus bar) will only be visible in combat when aiming. This prevents using ranged weapons or spells as enemy detector when running around with them drawn. This setting affects both ranged and spell combat, but is only applied to either if free aiming for them is initialized (GFA_RANGED
and/or GFA_SPELLS
).
Turn rate while aiming. This constant has by default a carefully chosen value and it is not recommended to change this constant. This has nothing to do with mouse sensitivity. Do not change if you don't know what you are doing. Affects Gothic 1 controls only.
Set to true, if the free aiming camera (CCamSys_Def script instance) is modified to shoulder view. This is not recommended! Shot origin and camera would be to different causing parallax effect and aiming becomes highly inaccurate.
Enable console commands (debugging). It is recommended to disable in this in a final mod release.
Disply output information to zSpy by default. This can also be enabled via console in a running game, if GFA_DEBUG_CONSOLE
is enabled.
The reticle is very dynamic as it may change with aiming distance, target focus and may be animated by time or external criteria. A reticle has the following properties kept in the Reticle
class. You do not have to create or maintain this class in the configuration, but only fill or change its properties in the config functions below.
class Reticle {
var string texture; // Texture file name
var int size; // Size in percentage (100 is biggest size, 0 is smallest)
var int color; // zCOLOR
};
GFA already comes with a collection of reticle texture files. Their names are defined as string constants in config/reticleTextures.d for easy usage along with some recommendations. The reticle can be hidden by setting the texture to an empty string.
The color can be created with LeGo's RGBA function.
This function is called continuously while aiming with a ranged weapon (bows and crossbows). It allows defining the reticle texture, size and color at any point in time while aiming, based on a variety of properties.
Ideas: more sophisticated customization like e.g. change the texture by draw force, the size by accuracy, ...
Examples are given inside the function, but commented out to serve as inspiration of what is possible.
By default, for example, the size is scaled by aiming distance. As indicated by the in-line comments in the function, basing the size (or color) on the functions GFA_GetDrawForce and GFA_GetAccuracy is also possible.
func void GFA_GetRangedReticle(C_Npc target, C_Item weapon, int talent, int dist, int returnPtr)
target |
The NPC that is in focus (if any). |
weapon |
The ranged weapon in use. |
talent |
The talent value depending on the ranged weapon. |
dist |
Aiming distance to the next obstacle. |
returnPtr |
Instance pointer to the reticle definition. |
This function is called continuously while aiming with a spells. It allows defining the reticle texture, size and color at any point in time while aiming, based on a variety of spell properties.
To hide the reticle (might be of interest for certain spells), set the texture to an empty string.
Ideas: more sophisticated customization like e.g. change the texture by spellID, the size by spellLevel, ...
Examples are given inside the function, but commented out to serve as inspiration of what is possible.
By default, for example, the size is scaled by aiming distance. As indicated by the in-line comments in the function, basing the size (or color) on the any provided spell properties is easily possible.
func void GFA_GetSpellReticle(C_Npc target, int spellID, C_Spell spellInst, int spellLevel, int isScroll, int manaInvested, int dist, int returnPtr)
target |
The NPC that is in focus (if any). |
spellID |
The current spell ID (e.g. SPL_Firebolt ). |
spellInst |
The C_Spell instance of the current spell. |
spellLevel |
The spell level as defined by the Spell_Logic_* function. |
isScroll |
Is the spell a scroll (true/false). |
manaInvested |
How much many was invested up to this point. |
dist |
Aiming distance to the next obstacle. |
returnPtr |
Instance pointer to the reticle definition. |
This is not a config function. It is a function provided by GFA and can be called from outside.
This function allows animated reticle textures dependent on time.
func string GFA_AnimateReticleByTime(string textureFileName, int framesPerSecond, int numberOfFrames)
textureFileName |
The base file name for which the several textures exist with the postfix textureFileName_00.tga , ..., textureFileName_numFrames-1.tga . |
framesPerSecond |
FPS of the animation. |
numFrames |
The number of texture files belonging to the animation. |
returns | The texture file name depending on the current frame time. |
This is not a config function. It is a function provided by GFA and can be called from outside.
This function allows animated reticle textures dependent on a given percentage. This is useful to indicate progress of draw force or distance to target or any other gradual property.
func string GFA_AnimateReticleByPercent(string textureFileName, int percent, int numberOfFrames)
textureFileName |
The base file name for which the several textures exist with the postfix textureFileName_00.tga , ..., textureFileName_numFrames-1.tga . |
percent |
Percentage along 0 and numFrames-1 . |
numFrames |
The number of texture files belonging to the animation. |
returns | The texture file name depending on percent . |
Table of Contents
Features
Youtube Trailer
Demo Modifications
Installation & Requirements
Gothic 1
Gothic 2
Features & Configuration
Free Aiming
Ranged Combat
Spells
Re-usable Projectiles
Custom Collisions
Critical Hits
Hit Probability
Creating a Mod File
Project Architecture
Debugging & Console Commands
Download
Free Aiming Patch
Settings for Players
Changelog
FAQ
Support this project
Acknowledgements
Contact & Discussion