Jump to content

Force a NPC to aim at an object?


Hopper31

Recommended Posts

I am working on a mod that allows you to summon a ridable mech from the sky (think Titanfall), and it works for the most part (you can get in it, move it around, and make it shoot). But I have encountered one major problem, there is no way for the player to properly aim it. I tried using the look command but that doesn't seem to work on creatures. The only way I could somewhat get it to aim is to use the useweapon command on a xmarker that floats around in front of it. but that fails some of the time to where it gets stuck in the turning or firing animation, and then that aiming stops after a few seconds if it succeeds. So pretty much what I'm asking is: is there a way to force an NPC to constantly track an object with their weapons out?

Edited by Hopper31
Link to comment
Share on other sites

I don't know if this would actually work, but if you set the Hold Fire When Blocked flag and then put an invisible movable object with collision data between the weapon and the xmarker it's aiming at, it might keep tracking until you move or disable the blocker object.

Link to comment
Share on other sites

I actually just now figured a way out that doesn't involve objects. Using SetAngle X won't work on a creature unless it's in combat or has reloaded their gun. So what I did was force it to reload it's weapon as soon as the player activates it and now it works just fine. Thanks for the help anyway!

Edited by Hopper31
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...