Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Adjusting Target Positioning When Mounted In C++


Recommended Posts

spacer.png

 

Enhancing the gameplay experience for ranged attackers can greatly impact tactical strategies in your game. This guide focuses on modifying the target positioning code to account for whether the character is mounted on a horse or not.

Step-by-Step Code Modification

Step 1: Locate the Target Position Method

Begin by searching your source code for the method that retrieves the target position for flying entities. Look for the following function:

 
This is the hidden content, please

Step 2: Modify the Function

Replace the existing code inside the OnGetFlyTargetPosition function with the following revised version to account for whether a character is mounted:

 
This is the hidden content, please

Explanation of Changes

  • Removal of Redundant Code: The original code had unnecessary checks for setting the center vector, which has been streamlined.
  • Height Adjustment for Mounted Characters: The addition of the conditional block if (__IsMountingHorse()) ensures that if the character is on a horse, the Z-coordinate of the target position is increased by 110.0f. This change elevates the target's height appropriately, improving accuracy for ranged attacks.

 

By incorporating these adjustments, you ensure that the game accurately reflects the mechanics of mounted characters when they engage in ranged attacks. This modification not only improves gameplay dynamics but also enhances the strategic elements of using mounts in your game.

 

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...