The forum has been set to read-only mode. For community discussion and questions, head over to our Discord: https://discord.taleoftwowastelands.com

Snap to ADS in Third Person

General help and troubleshooting.
Post Reply
User avatar
GoingZe1da
Posts: 14
Joined: Mon Jul 17, 2017 1:58 pm
Location: United States

Snap to ADS in Third Person

Post by GoingZe1da » Sat Jul 22, 2017 7:34 pm

Since this is my first post, let me begin by saying thank you to the fantastic people behind Tale of Two Wastelands, you have all done a wonderful job so far with the project and I hope it continues long into the future. I am enjoying it very much, and after dumping countless hours into both 3 and NV, it is amazing to now be able to go hunting mutties in DC with Boone, as well as destroying Fiends in Vegas with Jericho. /praise



So now to the idea. I have acquired the GECK and NifSkope, and I am hoping to get some assistance with a very simple mod that I would like to implement. As the title reads, I wish to be able to snap to ADS with in third person mode with a right mouse click, as in Player Unknown's Battlegrounds. As such, when the right mouse button is held down, the player should aim as they would in third person. I have implemented this in AutoHotKey (script attached below) but it failed to work in-game, possibly due to the fact Fallout New Vegas does not support AutoHotKey, if I am incorrect about this I apologize, but that is what I read when I initially troubleshot this issue. Therefore, I wish to create a script mod that implements this in-game. Plain and simple. I am hoping I can get some guidance on where to start, and where I can find an index of all of the base functions, if there is one. For reference, I have a background in both Python and C++, although I am more akin to the latter, if that helps at all with explaining things semantically. In addition, yes I have searched the Nexus and nothing like this has been done yet. Thank you for your time and I hope to hear from you all soon. I'll be shooting teddy bears at Deathclaws.


You do not have the required permissions to view the files attached to this post.
Paddle faster, I hear banjo music!

User avatar
RoyBatty
Gary
Posts: 7742
Joined: Sun Apr 27, 2014 10:26 am
Location: Vault 108

You can use tap control to do

Post by RoyBatty » Sat Jul 22, 2017 8:44 pm

You can use tap control to do this in an event handler. SetOnControlDownEventHandler is what you need there. See the new GECK wiki.


https://geck.foesmm.org/index.php/SetOnControlDownEventHandler


https://geck.foesmm.org/index.php/TapControl


Image

User avatar
GoingZe1da
Posts: 14
Joined: Mon Jul 17, 2017 1:58 pm
Location: United States

Thank you for your reply Roy.

Post by GoingZe1da » Sun Jul 23, 2017 6:36 pm

Thank you for your reply Roy. I have created a simple script and attached it to a hidden quest that runs whenever the game does. It runs wonderfully as of now, but all it does is display a message saying it works, for debug purposes. I have a few additional questions if you do not mind. Thank you again for your help and I hope to have this up and running for everyone to enjoy soon.



1. I wish for this script to be running indefinitely on a loop, refreshing as fast as the engine allows, for maximum input detection. Therefore should I check script processing delay or leave it blank? If I should check it, what would you recommend for the default setting? (update while writing this, unchecked the box and set it to .01 seconds, that ok I assume?)



2. I know there is the IsPC1stPerson command, but I need this script to only go through the code if the PC is in third person. What is the negation operator in the GECK? Akin to something like "if !var" in C? I haven't been able to find it yet, thats why I ask. (small update, tried "if !(IsPC1stPerson)" but that didn't work, suggestions?) (small update 2, "if eval !(IsPC1stPerson)" seems to work, will report back with more progress soon hopefully)


Paddle faster, I hear banjo music!

User avatar
GoingZe1da
Posts: 14
Joined: Mon Jul 17, 2017 1:58 pm
Location: United States

Well I have to go to work,

Post by GoingZe1da » Sun Jul 23, 2017 7:24 pm

Well I have to go to work, but this is as far as I got. Sadly, when I switch to third person in-game with this running it freezes my game. Tell me what you think! I'll always take whatever advice I get. Thank you again!


 


You do not have the required permissions to view the files attached to this post.
Paddle faster, I hear banjo music!

User avatar
RoyBatty
Gary
Posts: 7742
Joined: Sun Apr 27, 2014 10:26 am
Location: Vault 108

I suggested the event handler

Post by RoyBatty » Mon Jul 24, 2017 3:48 am

I suggested the event handler so you don't need to run it in a quest at all, it will fire any time the aim key is pressed. You can use SetOnControlUpEventHandler to reset the view when the control is released.


This is way more efficient than using a quest script.


You can't run infinite loops, it will freeze the game.


Image

User avatar
GoingZe1da
Posts: 14
Joined: Mon Jul 17, 2017 1:58 pm
Location: United States

My mistake. I did just start

Post by GoingZe1da » Mon Jul 24, 2017 12:42 pm

My mistake. I did just start delving into this a few days ago so everything is very new at this point. It has become clear though this isn't something I'll understand in a few days time. I'll keep working on it steadily. Many of the wikis and guides I've read point to the quest script to use for a mod like this. Am I correct in assuming this mod should end up being an object script? Then saved into a simple esp? Thank you again for helping me with this, I greatly appreciate it.
Paddle faster, I hear banjo music!

User avatar
RoyBatty
Gary
Posts: 7742
Joined: Sun Apr 27, 2014 10:26 am
Location: Vault 108

The guides are all very old

Post by RoyBatty » Mon Jul 24, 2017 1:07 pm

The guides are all very old and outdated, we have tons of new functions which are much better since then. DoctaSax has written some great tutorials, I would check those out.


Event Handlers are object scripts yes, they still need to be registered from a quest script with a GetGameRestarted check.


 


Image

User avatar
GoingZe1da
Posts: 14
Joined: Mon Jul 17, 2017 1:58 pm
Location: United States

Alright that seems to make

Post by GoingZe1da » Mon Jul 24, 2017 1:54 pm

Alright that seems to make sense. So I'll begin with a quest script that invokes on GetGameRestarted, which then, if true, leads to a a SetEventHandler, on trigger I assume with the key scan code for right click. This points to a separate object script, which then clicks both the POV key and holds the right mouse button. What I'm unsure of now is how to keep that button held until I physically click the button again, since I cannot keep looping it indefinitely. Maybe there is a key wait function? The other part of the code after this should be fine, since if right mouse is held and not clicked nothing new should happen. Does the engine have separate detection functions for keys being held or clicked? This is then saved and packaged into a nice little esp and loaded in, where it would theoretically work. Do all my ducks seem to be in a row there?
Paddle faster, I hear banjo music!

User avatar
RoyBatty
Gary
Posts: 7742
Joined: Sun Apr 27, 2014 10:26 am
Location: Vault 108

You'll have to hold the key

Post by RoyBatty » Mon Jul 24, 2017 4:33 pm

You'll have to hold the key down like normal, toggling is not really a thing in the engine.


You need to use the control code, not the key code. Controls can be rebound.


Image

User avatar
GoingZe1da
Posts: 14
Joined: Mon Jul 17, 2017 1:58 pm
Location: United States

Got it to work, albeit when I

Post by GoingZe1da » Tue Jul 25, 2017 2:25 pm

Got it to work, albeit when I zoom in the crosshair from Project Nevada is still there because I zoom in within third person before switching to first, this is a known bug with PN i'm pretty sure. Was a fun little project in any event. Thank you for your assistance Roy! I'll be lurking around the forums in the meantime.


Paddle faster, I hear banjo music!

Post Reply