Targeting system Created 15 years ago2008-05-23 15:58:31 UTC by thepatricksays thepatricksays

Created 15 years ago2008-05-23 15:58:31 UTC by thepatricksays thepatricksays

Posted 15 years ago2008-05-23 15:58:31 UTC Post #250336
Currently working on an experiment into giving HL2 an auto-targeting system. As it stands, I've got my player locked into a game_ui as soon as the test map loads, freezing him in place. I want to map PressedLeft and PressedRight to cycle up and cycle down, respectively, through available targets.

The theoretical method is this:

I create an enemy (example, npc_zombie). I parent an info_target to my npc, giving them corresponding names (zombie1, target1). Now, as soon as the zombie can SEE the player, I shoot a command to the target (fireuser1, onuser1) to tell the target to add itself to a list of all currently available targets. The player would press either A or D (default mapping) to cycle up or down through the targets, and his Z-axis rotation would be turned accordingly to point him directly at his chosen target.

Where this all breaks down is after I attach the targets. I haven't been able to find any entity that would behave as a list, nor have I been able to find a way to calculate the proper orientation for the player and force them towards it.

I realize that I could probably do all this with some source code modifications, but I wanted to see if it was possible to do based purely on entities. So far...no good. However, if anyone has any insights, I'd love to hear them and further along my experiment. Thanks.

(PS. The info_targets could probably be eliminated, too, but I like the idea of having the player oriented with the dead-center of the zombie, which is where I would spawn my targets.)
Posted 15 years ago2008-05-23 17:25:30 UTC Post #250341
There's not a list entity to my knowledge.

I see what you're wanting to do, and it's not going to be easy to do or for me to explain. You'll need to use butt-tonne's of logic_relays (These will allow your gun to consider something a target all the time, but not actually do anything until the logic relay is actually activated.. which you will have to trigger once the target actually gets into sight of the player via trigger_multiple or similiar), and then you'll need to use a func_tracktrain for your target switching. In a seperate room, you'll have this tracktrain there to move along a series of corners with 'onpass' outputs to trigger target switching. You'll have to have all the path_corners teleport (or move really fast) to the next corner so it works instantly with the target switching. You'll need to control the train forwards and backwards with your game_ui and maybe some logic_compares. Every corner will need to activate the target painter on specifically one target and deactivate the painters for the two targets 'around' it.

Also, to aim the player at the target, you'll have to use a func_monitor and a camera. In the onpass options in all of the path_corners, you'll just have to retarget the point_camera and then maybe also use it to activate/deactivate a sprite that highlights the target. That just seems the best way.

I still dont think I got my point across, but if you can get something out of it than yay :>
TheGrimReafer TheGrimReaferADMININATOR
Posted 15 years ago2008-05-23 17:41:08 UTC Post #250343
...actually, that made perfect sense. uhm...let's uh...see if it works.

be back.

(thanks!)
You must be logged in to post a response.