Free Aiming For Spells
The feature Free Aiming for Spells (GFA_SPELLS
) implements free aiming for spell combat. There is not much room for configuration.
For adjustments to the reticle for spells, see reticle adjustments.
Contents 1. Requirements for Spells |
Not all spells support free aiming or movement while investing/casting as explained here. Three properties of the C_Spell
instance decide over the mechanic of each spell.
Class C_Spell {
// ...
var int targetCollectAlgo;
var int canTurnDuringInvest;
var int canChangeTargetDuringInvest;
};
All Gothic 1 and Gothic 2 spells meet the necessary requirements (or explicitly don't if they shouldn't) of these properties out of the box. The properties of any new spells, you might design or introduce to your mod, should be adjusted to the requirements below.
Here is an overview. For requirements of the spell properties see below.
Spell Type | Example | |
---|---|---|
Free aiming + Movement while while investing/casting |
Projectile spells | Fireball |
Movement while while investing/casting | Area-of-effect spells Summoning spells Light spells |
Firerain Summon Golem Light |
Stationary (vanilla Gothic) | Focus spells Healing spells Teleport spells Transformation spells |
Sleep/Control Medium Heal Teleport Transf. to Sheep |
For a spell to support movement while investing/casting, the properties need to meet the following requirements.
-
targetCollectAlgo
must not beTARGET_COLLECT_FOCUS
-
canTurnDuringInvest
must be true
If any of the requirements is not met, the spell behaves like in Gothic vanilla. This is, however, sometimes desired like for example for sleep or control (Gothic 1), where the player should remain stationary.
For a spell to support movement while investing/cast and free aiming, the properties need to need the following requirements:
-
targetCollectAlgo
must beTARGET_COLLECT_FOCUS_FALLBACK_NONE
-
canTurnDuringInvest
must be true -
canChangeTargetDuringInvest
must be true
The configuration of this feature is found in the file config/spells.d.
This function is called continuously while aiming with spells to correct the aim vob position.
It should never be of use and should be adjusted for individual spells only. Usually, no spell requires the aim vob to be shifted. Exceptions are spells that utilize the aim vob as target to spawn VFX on it with the functions GFA_AimVobAttachFX and GFA_AimVobDetachFX.
func int GFA_ShiftAimVob(var int spellID, var int posPtr)
spellID |
Active spell ID (e.g. SPL_Firebolt ) |
posPtr |
Pointer to the position vector of the aim vob |
return | Distance in centimeters to shift the aim vob along the viewing angle of the camera. |
These functions are provided by GFA and aid in visualizing the aim vob. They may be used in the function documented above.
This is not a config function. It is a function provided by GFA and can be called from outside.
Attach a visual FX to the aim vob. This function is never used internally, but is useful for spells that visualize the aim vob.
This function should go hand in hand with detaching the visual FX (GFA_AimVobDetachFX): If you attach an FX, you should make sure to remove the FX, when it is no longer needed.
func void GFA_AimVobAttachFX(string effectInst)
effectInst |
VisualFX instance to attach (e.g. "spellFX_LIGHTSTAR_WHITE" ) |
This is not a config function. It is a function provided by GFA and can be called from outside.
Detach the visual FX from the aim vob, that was previously spawned with GFA_AimVobAttachFX.
func void GFA_AimVobDetachFX()
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
Creating a Mod File
Project Architecture
Debugging & Console Commands
Download
Free Aiming Patch
Settings for Players
Changelog
FAQ
Support this project
Acknowledgements
Contact & Discussion