Skip to content

1Stalk/MagicBullet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

MagicBulletMod

Far Far West mod: automatically redirects fired projectile and hitscan bullets to hit the head or center of the nearest active enemy within your field of view.

Requirements

Installation

  1. Download the mod files.
  2. Place the MagicBulletMod folder into your game's UE4SS Mods directory:
    \Steam\steamapps\common\FarFarWest\FarFarWest\Binaries\Win64\ue4ss\Mods\
    
  3. Enable the mod by adding the following line to mods.txt (located at \FarFarWest\Binaries\Win64\ue4ss\Mods\mods.txt):
    MagicBulletMod : 1
    

How it works

The mod automatically tracks bullets fired by the player and intercepts their trajectory.

  1. Dynamic Target Finding: The mod scans the world for living enemies (BP_Enemy_C).
  2. Field of View (FOV) Limit: The mod ignores enemies that are outside your field of view (defined by the MAX_FOV_ANGLE variable).
  3. Smart Target Selection: Among the enemies within your FOV, the mod selects the one that is physically closest to you.
  4. Guaranteed Headshots: The mod automatically reads the list of critical bones (head) for the enemy directly from the game engine. The bullet is directed straight into this bone in real-time, perfectly tracking all animations. If the enemy has no head, the mod will aim exactly at the center of the enemy's collision.
  5. Universal Weapon Support: Works for both physical projectiles (by instantly teleporting them into the enemy) and instant-hit weapons (Hitscan, by overriding the hit registration data for a perfect headshot).

Configuration

You can fine-tune the mod's behavior by changing the variables at the very top of Scripts/main.lua:

  • MAX_FOV_ANGLE (default 25.0) — The "capture" angle around your crosshair. Decrease it to require more precise aiming on your part, or increase it so bullets fly even at enemies on the edge of the screen.
  • PLAYER_GUN_Z_OFFSET (default 75.0) — The height of the player's camera, used to accurately calculate the pitch angle.

Layout

Scripts/main.lua        Core Lua script handling dynamic hooking, target selection, and vector redirection.
enabled.txt             Activation file for UE4SS.

Hook Points

Projectile Redirection

  • Target: /Game/Items/Assets/BP_PlayerBullet.BP_PlayerBullet_C:F_StartBullet
  • Action: Intercepts projectile spawn, determines nearest crosshair target, and teleports the bullet actor to the target's actor location.

Hitscan Redirection

  • Target: BP_Item_C:F_TraceBullet (Base class dynamically resolved at runtime)
  • Action: Overrides the aiming rotator (LookAt) and forces OutHit properties to register a chest-level hit on the target.

Troubleshooting & Game Update Recovery

If the mod breaks after a game update, follow these steps to restore functionality:

1. Check UE4SS Log

Check the log file Binaries/Win64/ue4ss/UE4SS.log for any Lua stack trace errors or warnings matching [MagicBullet].

2. Update Class, Function, and Property Names

If the developers renamed files, functions, or variables, update them in Scripts/main.lua:

  • Constants at the top: START_BULLET_FN (projectile spawn function) and ENEMY_CLASS (target base class).
  • Enemy Properties: The script relies on specific variables existing on the enemy class to function. Check the new SDK dumps (e.g., BP_Enemy_classes.hpp) if they change:
    • enemy.health: Used to check if the enemy is alive. If renamed to CurrentHealth or similar, the mod will ignore all enemies.
    • enemy.hitCriticalBonesHitmarker: Used to find the head bone. If renamed, the mod will silently fall back to aiming at the center of the enemy.
  • If you see Operation::Set is not supported errors for properties on OutHit (like HitObjectHandle), check if the inner struct names changed and update the version checks inside the setHitActor helper function.

3. Check for Changed Hook Parameters

If UE4SS complains about parameter counts or signature mismatch in the console:

  1. Open the UE4SS GUI Console in-game.
  2. Search for the signatures of F_StartBullet and F_TraceBullet.
  3. Update the arguments of onStartBullet(...) or onItemTrace(...) in Scripts/main.lua to match the new signatures.

4. HitResult Property Changes

If Unreal Engine updates to a newer major version (e.g. 5.5+): You may need to inspect the C++ structure of FHitResult in the UE source to understand which exact properties to overwrite (e.g., UE 5.4 unified Actor into HitObjectHandle).

About

Magic Bullet Auto Aim mod for Far Far West

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages