Skip to content

Commit

Permalink
Rename project to Gothic Free Aim (GFA)
Browse files Browse the repository at this point in the history
  • Loading branch information
szapp committed Aug 8, 2017
1 parent a888774 commit 5eda5c8
Show file tree
Hide file tree
Showing 28 changed files with 250 additions and 251 deletions.
52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
G2 Free Aim
===========
Gothic Free Aim
===============

**Script for the video game Gothic II: Night of the Raven enabling free aiming for ranged weapons and spells.**

Expand Down Expand Up @@ -98,13 +98,13 @@ manually.
> Again: The [setup](http://github.com/szapp/g2freeAim/releases/latest) will perform all these steps for you.
You will have to adjust the labels in `_work\data\Scripts\System\Menu\Menu_Opt_Game_FreeAim.d`. By default they are in
German. After parsing the scripts g2freeAim should be fully implemented. Read on to find out how to adjust g2freeAim to
German. After parsing the scripts GFA should be fully implemented. Read on to find out how to adjust GFA to
your preferences.

> **Note**: By using these scripts, you agree to the terms of the **[MIT License](http://opensource.org/licenses/MIT)**.
Please respect my efforts and accredit my work in your project accordingly (i.e. *"This modification utilizes G2 Free
Aim written by mud-freak (@szapp)"* in the credits). If you omit this, you are stating this was your own work which is
effectively violating the license.
Please respect my efforts and accredit my work in your project accordingly (i.e. *"This modification utilizes Gothic
Free Aim written by mud-freak (@szapp)"* in the credits). If you omit this, you are stating this was your own work which
is effectively violating the license.


Customization
Expand Down Expand Up @@ -205,7 +205,7 @@ every positive hit on an npc and aids to decide whether a critical hit happened.
function `freeAimCriticalHitEvent()` is called, in which you can define an event on getting a critical hit. Possible
implementations: Headshot counter, sound notification, hit marker, print on the screen. Both functions are supplied with
the target npc in question. Thus, it is very well possible to discern those and define varying cases. As it is very
difficult to guess the dimensions of a defined weakspot, the console command `debug freeaim weakspot` will visualize the
difficult to guess the dimensions of a defined weakspot, the console command `debug GFA weakspot` will visualize the
projectile trajectory and the bounding box of the currently defined weakspot for the target. This will help deciding on
suitable sizes for weakspots. For thorough testing this debug visualization can be enabled by default with
`GFA_DEBUG_WEAKSPOT` in `freeAimInitConstants()`.
Expand Down Expand Up @@ -238,12 +238,12 @@ a few are enumerated and explained here briefly.
or check out the branch `SPL_Blink`).

There are quite some more things that can be changed (listed at the top of `_intern\const.d`) but they should not be
altered under normal circumstances. Changing those settings will most certainly make g2freeAim unstable.
altered under normal circumstances. Changing those settings will most certainly make GFA unstable.

#### Eligible Spells

Gothic offers very different types of spells (attack spells, area of effect spells, summoning spells, enhancement
spells). Of course, not all of those require free aiming, let alone a reticle. Here is a description of how g2freeAim
spells). Of course, not all of those require free aiming, let alone a reticle. Here is a description of how GFA
decides which spell is eligible for free aiming.

- The property `targetCollectAlgo` in the spell instance needs to be set to `TARGET_COLLECT_FOCUS_FALLBACK_NONE`
Expand All @@ -258,7 +258,7 @@ these conditions, because they make sense.
Debugging
---------

Some steps have been taken to make debugging g2freeAim easier and to help with customizing it (see **Customization**
Some steps have been taken to make debugging GFA easier and to help with customizing it (see **Customization**
above).
1. Information about shots from bows and crossbows is sent to the zSpy at time of shooting, containing
- Draw force (percent)
Expand All @@ -268,16 +268,16 @@ above).
- Whether or not it was a critical hit
- Critical base damage and original base damage
- Critical hit zone (body node/weakspot) and its dimensions
3. For finding good critical hit zones (weakspots), the console command `debug freeaim weakspot` will visualize the
3. For finding good critical hit zones (weakspots), the console command `debug GFA weakspot` will visualize the
projectile trajectory and the bounding box of the currently defined weakspot for the target. This will help deciding
on suitable sizes for weakspots.
4. The console command `debug freeaim traceray` will visualize the aiming trace ray and the determined nearest
intersection. This should only be useful if the underlying g2freeAim mechanics are modified (which is not
4. The console command `debug GFA traceray` will visualize the aiming trace ray and the determined nearest
intersection. This should only be useful if the underlying GFA mechanics are modified (which is not
recommended).
5. Additional information about the selected settings of g2freeAim can be displayed in the console by the commands
- `freeaim version` displays the current version of g2freeAim, e.g. "G2 Free Aim v1.0.0-alpha"
- `freeaim license` displays the license information of g2freeAim
- `freeaim info` displays the settings of g2freeAim
5. Additional information about the selected settings of GFA can be displayed in the console by the commands
- `GFA version` displays the current version of GFA, e.g. "Gothic Free Aim v1.0.0-alpha"
- `GFA license` displays the license information of GFA
- `GFA info` displays the settings of GFA
- Whether free aiming is enabled
- Whether focus collection is enabled (ini-file setting for performance)
- Whether projectiles are enabled to be reusable
Expand All @@ -300,7 +300,7 @@ create a pull request. Consult with the issue tracker for information on possibl
FAQ
---

Q: **Do balancing issues arise from g2freeAim?**
Q: **Do balancing issues arise from GFA?**

A:
No. The option, to collect/re-use projectiles, however, increases the amount of arrows/bolts (since the player will need
Expand All @@ -312,7 +312,7 @@ A:
Anyone can try the free aiming by downloading the demo modification (see link above). This can be done without much
effort. Note that this demo is in German.

Q: **How do I install g2freeAim into my scripts?**
Q: **How do I install GFA into my scripts?**

A:
You can find the latest release [here](http://github.com/szapp/g2freeAim/releases/latest). Follow the instructions
Expand All @@ -327,27 +327,27 @@ file and save it with the encoding *ANSI (Windows-1252)*.
Q: **I am getting and error telling me *"CC_Register"* is missing, what now?**

A:
Your version of LeGo is out dated: g2freeAim requires LeGo 2.4.0 or higher.
Your version of LeGo is out dated: GFA requires LeGo 2.4.0 or higher.

Q: **It does not work? What now?**

A:
Should the installation of g2freeAim fail, please read through this README.md first. If this does not help, post your
Should the installation of GFA fail, please read through this README.md first. If this does not help, post your
problem into the mentioned forum thread (see **Contact and Discussion** below) with the following information:

- What exaclty is not working: Is the game not launching (list possible parser errors)? Is nothing happing in the game
(as if g2freeAim was not installed)? Does the game crash (when and how)?
(as if GFA was not installed)? Does the game crash (when and how)?
- Attach possible error messages/codes
- Attach the zSpy log
- If possible, please post the output when entering `freeaim info` into the F2-ingame-console.
- If possible, please post the output when entering `GFA info` into the F2-ingame-console.

Q: **Why does my game crash?**

A:
See **"It does not work? What now?"**. Additionally, it will be essential to describe your configuration, ideally by
attaching your files in `freeAim\config\`.

Q: **What is the deal with the license? May I use g2freeAim in my modification?**
Q: **What is the deal with the license? May I use GFA in my modification?**

A:
In the section **Installation** above, I have written what the license implies. Please read it, keep it in mind and
Expand All @@ -357,7 +357,7 @@ remind the creator of that mod of the license conditions or report them to me.
Q: **Why is the reticle not in the center of my screen?**

A:
You seem to be using version v0.1.0 of g2freeAim. Update it to the
You seem to be using version v0.1.0 of GFA. Update it to the
[latest version](http://github.com/szapp/g2freeAim/releases/latest).

Q: **Why do I have a rock-like texture instead of a reticle on my screen?**
Expand Down Expand Up @@ -395,7 +395,7 @@ include the following information:

- Detailed description of what happened.
- Detailed description of how it happened.
- Output when entering `freeaim info` into the F2-ingame-console.
- Output when entering `GFA info` into the F2-ingame-console.
- zSpy Log.
- The Access Violation message (if applicable).
- Your configuration (attach the files in `freeAim\config\`).
Expand Down
20 changes: 10 additions & 10 deletions _work/data/Scripts/Content/freeAim/_intern/activate.d
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
* Activate free aiming and set internal settings
*
* G2 Free Aim v1.0.0-alpha - Free aiming for the video games Gothic 1 and Gothic 2 by Piranha Bytes
* Gothic Free Aim (GFA) v1.0.0-alpha - Free aiming for the video games Gothic 1 and Gothic 2 by Piranha Bytes
* Copyright (C) 2016-2017 mud-freak (@szapp)
*
* This file is part of G2 Free Aim.
* This file is part of Gothic Free Aim.
* <http://github.com/szapp/g2freeAim>
*
* G2 Free Aim is free software: you can redistribute it and/or modify
* it under the terms of the MIT License.
* Gothic Free Aim is free software: you can redistribute it and/or
* modify it under the terms of the MIT License.
* On redistribution this notice must remain intact and all copies must
* identify the original author.
*
* G2 Free Aim is distributed in the hope that it will be useful,
* Gothic Free Aim is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MIT License for more details.
*
* You should have received a copy of the MIT License
* along with G2 Free Aim. If not, see <http://opensource.org/licenses/MIT>.
* You should have received a copy of the MIT License along with
* Gothic Free Aim. If not, see <http://opensource.org/licenses/MIT>.
*/


Expand All @@ -32,7 +32,7 @@ func void GFA_UpdateSettings(var int on) {
return; // No change necessary
};

MEM_Info(ConcatStrings(" OPT: Free-Aim: Enabled=", IntToString(on))); // Print to zSpy in same style as options
MEM_Info(ConcatStrings(" OPT: GFA: freeAimingEnabled=", IntToString(on))); // Print to zSpy, same style as options

if (on) {
// Turn free aiming on
Expand Down Expand Up @@ -76,8 +76,8 @@ func void GFA_UpdateSettings(var int on) {
* The constant GFA_ACTIVE is modified in the subsequent function GFA_UpdateSettings().
*/
func void GFA_UpdateStatus() {
// Check if g2freeAim is enabled and mouse controls are enabled
if (!STR_ToInt(MEM_GetGothOpt("FREEAIM", "enabled"))) || (!MEM_ReadInt(zCInput_Win32__s_mouseEnabled)) {
// Check if GFA and mouse controls are enabled
if (!STR_ToInt(MEM_GetGothOpt("GFA", "freeAimingEnabled"))) || (!MEM_ReadInt(zCInput_Win32__s_mouseEnabled)) {
// Disable if previously enabled
GFA_UpdateSettings(0);
GFA_DisableAutoTurning(0);
Expand Down
18 changes: 9 additions & 9 deletions _work/data/Scripts/Content/freeAim/_intern/aimRay.d
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
* Aim-specific trace ray and focus collection
*
* G2 Free Aim v1.0.0-alpha - Free aiming for the video games Gothic 1 and Gothic 2 by Piranha Bytes
* Gothic Free Aim (GFA) v1.0.0-alpha - Free aiming for the video games Gothic 1 and Gothic 2 by Piranha Bytes
* Copyright (C) 2016-2017 mud-freak (@szapp)
*
* This file is part of G2 Free Aim.
* This file is part of Gothic Free Aim.
* <http://github.com/szapp/g2freeAim>
*
* G2 Free Aim is free software: you can redistribute it and/or modify
* it under the terms of the MIT License.
* Gothic Free Aim is free software: you can redistribute it and/or
* modify it under the terms of the MIT License.
* On redistribution this notice must remain intact and all copies must
* identify the original author.
*
* G2 Free Aim is distributed in the hope that it will be useful,
* Gothic Free Aim is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MIT License for more details.
*
* You should have received a copy of the MIT License
* along with G2 Free Aim. If not, see <http://opensource.org/licenses/MIT>.
* You should have received a copy of the MIT License along with
* Gothic Free Aim. If not, see <http://opensource.org/licenses/MIT>.
*/


Expand All @@ -28,8 +28,8 @@
* recommended to use for any other matter.
* This function is very complex, but well tested.
*
* To increase performance, increase the value of FREEAIM.focusUpdateIntervalMS in the Gothic INI-file. It determines
* the interval in milliseconds in which the trace ray is recomputed. The upper bound is 500ms, which already introduces
* To increase performance, increase the value of GFA.focusUpdateIntervalMS in the Gothic INI-file. It determines the
* interval in milliseconds in which the trace ray is recomputed. The upper bound is 500ms, which already introduces
* a slight lag in the focus collection and reticle size (if applicable). A recommended value is below 50ms.
*/
func int GFA_AimRay(var int distance, var int focusType, var int vobPtr, var int posPtr, var int distPtr,
Expand Down
16 changes: 8 additions & 8 deletions _work/data/Scripts/Content/freeAim/_intern/aimVob.d
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
/*
* Definition and manipulation of aim vob (targeting system)
*
* G2 Free Aim v1.0.0-alpha - Free aiming for the video games Gothic 1 and Gothic 2 by Piranha Bytes
* Gothic Free Aim (GFA) v1.0.0-alpha - Free aiming for the video games Gothic 1 and Gothic 2 by Piranha Bytes
* Copyright (C) 2016-2017 mud-freak (@szapp)
*
* This file is part of G2 Free Aim.
* This file is part of Gothic Free Aim.
* <http://github.com/szapp/g2freeAim>
*
* G2 Free Aim is free software: you can redistribute it and/or modify
* it under the terms of the MIT License.
* Gothic Free Aim is free software: you can redistribute it and/or
* modify it under the terms of the MIT License.
* On redistribution this notice must remain intact and all copies must
* identify the original author.
*
* G2 Free Aim is distributed in the hope that it will be useful,
* Gothic Free Aim is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MIT License for more details.
*
* You should have received a copy of the MIT License
* along with G2 Free Aim. If not, see <http://opensource.org/licenses/MIT>.
* You should have received a copy of the MIT License along with
* Gothic Free Aim. If not, see <http://opensource.org/licenses/MIT>.
*/


/*
* Detach the visual FX from the aim vob. This function should go hand in hand with attaching a visual FX: If you attach
* an FX, you should make sure to remove the FX, when it is no longer needed. Some precautions are already taken from
* the side of g2freeAim and this function is called on every weapon change, specifically in GFA_CleanUpAiming().
* the side of GFA and this function is called on every weapon change, specifically in GFA_CleanUpAiming().
*/
func void GFA_AimVobDetachFX() {
if (!GFA_AimVobHasFX) {
Expand Down
21 changes: 10 additions & 11 deletions _work/data/Scripts/Content/freeAim/_intern/auxiliary.d
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
/*
* Auxiliary functions for finding active spell instances, weapons and offering animated reticles
*
* G2 Free Aim v1.0.0-alpha - Free aiming for the video games Gothic 1 and Gothic 2 by Piranha Bytes
* Gothic Free Aim (GFA) v1.0.0-alpha - Free aiming for the video games Gothic 1 and Gothic 2 by Piranha Bytes
* Copyright (C) 2016-2017 mud-freak (@szapp)
*
* This file is part of G2 Free Aim.
* This file is part of Gothic Free Aim.
* <http://github.com/szapp/g2freeAim>
*
* G2 Free Aim is free software: you can redistribute it and/or modify
* it under the terms of the MIT License.
* Gothic Free Aim is free software: you can redistribute it and/or
* modify it under the terms of the MIT License.
* On redistribution this notice must remain intact and all copies must
* identify the original author.
*
* G2 Free Aim is distributed in the hope that it will be useful,
* Gothic Free Aim is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MIT License for more details.
*
* You should have received a copy of the MIT License
* along with G2 Free Aim. If not, see <http://opensource.org/licenses/MIT>.
* You should have received a copy of the MIT License along with
* Gothic Free Aim. If not, see <http://opensource.org/licenses/MIT>.
*/


/*
* Retrieve the active spell instance of an NPC. Returns an empty instance if no spell is drawn. This function is
* usually called in conjunction with GFA_IsSpellEligible(), see below. It might prove to also be useful outside of
* g2freeAim.
* usually called in conjunction with GFA_IsSpellEligible(), see below. It might prove to also be useful outside of GFA.
*/
func MEMINT_HelperClass GFA_GetActiveSpellInst(var C_Npc npc) {
if (Npc_GetActiveSpell(npc) == -1) {
Expand Down Expand Up @@ -138,7 +137,7 @@ func int GFA_GetWeaponAndTalent(var int weaponPtr, var int talentPtr) {

/*
* Return texture file name for an animated texture. This function is not used internally, but is offered as a feature
* for the config functions of g2freeAim. It allows for animated reticles dependent on time.
* for the config functions of GFA. It allows for animated reticles dependent on time.
* 'numFrames' files must exist with the postfix '_[frameNo].tga', e.g. 'TEXTURE_00.TGA', 'TEXTURE_01.TGA',...
*/
func string GFA_AnimateReticleByTime(var string fileName, var int fps, var int numFrames) {
Expand All @@ -165,7 +164,7 @@ func string GFA_AnimateReticleByTime(var string fileName, var int fps, var int n

/*
* Return texture file name for an animated texture. This function is not used internally, but is offered as a feature
* for the config functions of g2freeAim. It allows for animated reticles dependent on a given percentage. This is
* for the config functions of GFA. It allows for animated reticles dependent on a given percentage. This is
* useful to indicate progress of draw force or distance to target or any gradual spell property.
* 'numFrames' files must exist with the postfix '_[frameNo].tga', e.g. 'TEXTURE_00.TGA', 'TEXTURE_01.TGA',...
*/
Expand Down

0 comments on commit 5eda5c8

Please sign in to comment.