Vector time!

CannonFodder100CannonFodder100 Join Date: 2011-09-14 Member: 121355Members
edited September 2011 in Modding
Complete noob with coding in NS2, though I'm familiar with Lua. I'd like functions to create a vector between the player character and whomever they are aiming at and also gain the X, Y, and Z coordinates of their target. Then, I would like this to refresh client-side rapidly.

Comments

  • SewlekSewlek The programmer previously known as Schimmel Join Date: 2003-05-13 Member: 16247Members, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Developer
    edited September 2011
    usually to determine if you aim at something, you should make a "Shared.TraceRay". See the lua code for how to use that functions. once the trace is completed, you can check if you hit an entity and also get the end point. This calculations are already made for the description text you see for every structure / player, so you might check that code and simply add your own stuff there
  • CannonFodder100CannonFodder100 Join Date: 2011-09-14 Member: 121355Members
    edited September 2011
    Much appreciated. I use this wonderfully worthless bit of software technically named Windows 7 but more often known in colorful terms the profanity filter would not appreciate, and as it stands the Search function is 99% broken. Do you know which file (in .../common/natural selection 2/lua, right?) contains those functions?
  • basti1337basti1337 Join Date: 2011-05-13 Member: 98538Members
    Download Notepad++ and use the "Search in files" function...
  • SewlekSewlek The programmer previously known as Schimmel Join Date: 2003-05-13 Member: 16247Members, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Developer
    <!--quoteo(post=1876413:date=Sep 22 2011, 05:27 PM:name=basti1337)--><div class='quotetop'>QUOTE (basti1337 @ Sep 22 2011, 05:27 PM) <a href="index.php?act=findpost&pid=1876413"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Download Notepad++ and use the "Search in files" function...<!--QuoteEnd--></div><!--QuoteEEnd-->

    thats what i do all the time, it works pretty good :)
  • AsranielAsraniel Join Date: 2002-06-03 Member: 724Members, Playtest Lead, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow, Subnautica Playtester, Retired Community Developer
    and there is decoda, the lua editor from uwe that you can run trough the ns2 launchpad
  • KalabalanaKalabalana Join Date: 2003-11-14 Member: 22859Members
    <!--quoteo(post=1876209:date=Sep 21 2011, 09:39 PM:name=CannonFodder100)--><div class='quotetop'>QUOTE (CannonFodder100 @ Sep 21 2011, 09:39 PM) <a href="index.php?act=findpost&pid=1876209"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Complete noob with coding in NS2, though I'm familiar with Lua. I'd like functions to create a vector between the player character and whomever they are aiming at and also gain the X, Y, and Z coordinates of their target. Finally, I would like this to refresh client-side rapidly. I don't ask for much, right?<!--QuoteEnd--></div><!--QuoteEEnd-->

    ...and then once I have that vector between player and character, I would like the functionality to adjust the player FOV orientation to align with said vector rapidly...





    haha, am I the only one where this came to mind? *cough* aimbot *cough*.




    Theoretically this would be easy to do, and not only that, you could even develop a dampening algorithm to smooth a players view to an alien (or vice versa), allowing for player created divergence to give the impression of sinuous, but amazing accuracy. Furthermore, you could only engage this action when actually clicking the attack button.




    Solution?
  • CannonFodder100CannonFodder100 Join Date: 2011-09-14 Member: 121355Members
    edited September 2011
    Or, alternatively, I could have a completely innocent purpose: death beams, showing a bright line between the pos of the player who you were killed by and at the pos you died on. The purpose of aligning it with a target for now would be to test the beam easily without having to die to some other source every time I want to test.

    There are other things that stand in the way of making an aimbot which I did not ask about: grabbing input from the game, setting view angle, and if I were really ambitious, grabbing the random seed used to create spread, determining the angle between the spot I'm aiming at and the spot I'm hitting, and then move the FOV to the opposite side the same angle. Also, I never asked about finding entities in a limited cone, without which an aimbot would see very little use. Oh, and walls! Gotta find a way of not aiming through walls.

    Just saying.

    ----End Defensiveness----
    I'm having trouble with Decoda: autocomplete no longer works and when I enter anything into another document, it doesn't auto-color it at all. Ideas?
  • KalabalanaKalabalana Join Date: 2003-11-14 Member: 22859Members
    <!--quoteo(post=1876566:date=Sep 23 2011, 02:39 PM:name=CannonFodder100)--><div class='quotetop'>QUOTE (CannonFodder100 @ Sep 23 2011, 02:39 PM) <a href="index.php?act=findpost&pid=1876566"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Or, alternatively, I could have a completely innocent purpose: death beams, showing a bright line between the pos of the player who you were killed by and at the pos you died on. The purpose of aligning it with a target for now would be to test the beam easily without having to die to some other source every time I want to test.

    There are other things that stand in the way of making an aimbot which I did not ask about: grabbing input from the game, setting view angle, and if I were really ambitious, grabbing the random seed used to create spread, determining the angle between the spot I'm aiming at and the spot I'm hitting, and then move the FOV to the opposite side the same angle. Also, I never asked about finding entities in a limited cone, without which an aimbot would see very little use. Oh, and walls! Gotta find a way of not aiming through walls.

    Just saying.<!--QuoteEnd--></div><!--QuoteEEnd-->

    I didn't actually think you were going to make an aimbot, lol, but it could sound like that.


    But yes, you did ask for input from the game, you asked for the vector between 2 players (or just the information to find it), that's all you really need. With that information I could make an aimbot. Regardless of walls, "finding entities in a limited cone" (irrelevant), moving angles to their opposites? Regardless, if I just knew where an enemy was in relation to me, a la a vector, that's all you need to make a very effective aimbot. Which of course I'd hope would see very little use (I do not support hacking), but in reality, would see widespread use if available.
  • CannonFodder100CannonFodder100 Join Date: 2011-09-14 Member: 121355Members
    edited September 2011
    Okey-doke. Any ideas for the problem that comes after the defensiveness?

    Also, finding entities in a limited cone is a necessary feature of aimbots; without that, you can't identify what the player wants to kill unless you're relying on the player aiming directly at the enemy, using a trace function to grab the entity and hold the player's FOV on it.
  • KalabalanaKalabalana Join Date: 2003-11-14 Member: 22859Members
    <!--quoteo(post=1876588:date=Sep 23 2011, 03:43 PM:name=CannonFodder100)--><div class='quotetop'>QUOTE (CannonFodder100 @ Sep 23 2011, 03:43 PM) <a href="index.php?act=findpost&pid=1876588"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Okey-doke. Any ideas for the problem that comes after the defensiveness?

    Also, finding entities in a limited cone is a necessary feature of aimbots; without that, you can't identify what the player wants to kill unless you're relying on the player aiming directly at the enemy, using a trace function to grab the entity and hold the player's FOV on it.<!--QuoteEnd--></div><!--QuoteEEnd-->
    If I had a vector from my player to an enemy I would not need any entity at all.
  • CannonFodder100CannonFodder100 Join Date: 2011-09-14 Member: 121355Members
    edited September 2011
    The enemy -IS- the entity, you need to continually redraw the vector because the enemy ain't gonna just hold still, and you can't rely on the player tracking it with the mouse because they'd have to have perfect aim anyway.

    In any case, that's not the point of this topic.
Sign In or Register to comment.