this mod breaks VATS in a way that right click does nothing anymore. you have to mouse over to the "Return" and then click it to exit and undo actions. JIP SF has no such issue
You went into xEdit and deleted your scripts? I was trying to make my mod compatible with yours but now I have to make guesses. Anybody that knows how to script wouldn't need to steal your scripts, and anybody that can't script wouldn't know what to do with them.
Incorrect, because I know of at least one instance of someone ripping my scripts out of my mod -- whitespacing, comments, variable names all included. All they had to do was recompile them and pass them off as their own, and they did.
That said, if the mod ever needs updating again, the scripts will be restored because I'm too lazy to keep removing them. How exactly do you need compatibility?
Everything is handled with HoldControl and ReleaseControl, so IsControlPressed 6 will give you the current aiming state. It's no different from holding down the aim control manually, except that it auto-releases it during a reload animation.
All right, I'm not going to get into a debate on stealing scripts. I appreciate the information. The main thing I wanted to check was whether you'd found a reliable way to check these things using events or if you had a quest script running. I did try isControlPressed 6 earlier and found it more reliable than certain animation checks but I'm still testing.
The mod in question is Aim View Switcher which switches to first-person when aiming and back to third afterwards. It works more or less perfectly using events, though I think with the functions now it could be cleaned up more. However, it sometimes gets mismatched with your mod, so I wanted to see exactly how you were doing your switches and match to it, as it seems to be the mod people are talking about when they ask me about making toggle-aim work with my mod.
It's all event driven except for reloading and holstering the weapon both cancelling the toggle
For reloading, ReleaseControl is called and then this is called to re-toggle your aim after the reload finishes. If reload cancelling is disabled, this is skipped scn ToggleAimReloadFunc
begin Function {} if (ToggleAim.bToggled && GetAnimAction != 9 && GetAnimAction != 17) Call ToggleAimSetFunc 1 SetGameMainLoopCallback ToggleAimReloadFunc 0 endif end
For holstering, this is called when you press the reload control but doesn't do anything until it's held for 0.5 seconds/the value in the INI. scn ToggleAimHolsterCancelFunc
begin Function {} if (IsControlPressed 7 && ToggleAim.bToggled) set ToggleAim.fHolsterTimer to ToggleAim.fHolsterTimer + GetSecondsPassed
if (ToggleAim.bHolstering == 0 && ToggleAim.fHolsterTimer >= GetINIFloat "Main:fHolsterTimer") DBPrintC "Toggle Aim: Player is attempting to holster while aiming" Call ToggleAimSetFunc 0 set ToggleAim.fHolsterTimer to 0 set ToggleAim.bHolstering to 1 endif else set ToggleAim.fHolsterTimer to 0 endif
if (ToggleAim.bHolstering) if (PlayerREF.IsWeaponOut) PlayerREF.SetWeaponOut 0 endif
if (PlayerREF.IsWeaponOut == 0) set ToggleAim.bHolstering to 0 SetGameMainLoopCallback ToggleAimHolsterCancelFunc 0 endif endif end
The ToggleAimSet function is just a shorthand for setting ToggleAim.bToggled and HoldControl/ReleaseControl at the same time
What's likely happening is that I'm using controls and you're using keys, which are slightly different. Keys should be used for anything that isn't covered by controls, and control detection in other cases
Thanks a million. I'll look over this and see if I can pinpoint where I'm not matching you.
For testing, right now I just have SetOnPlayGroupEventHandler ({int iAnimGroup} => callAfterSeconds 0 ({} => ToggleFirstPerson (isAnimPlayingEx 3 0 4 || GetPCUsingIronSights || isControlPressed 6 || getAnimAction == 9))) 1 player aimwhich so far works perfectly except when bReloadCancel is disabled in your INI, if the player reloads there will be a jarring split-second in between reloading and going back to aiming where the camera is in 3rd-person. Unless that was before I added isControlPressed 6, in which case the problem became that if you tap the aim button during reloading, my mod doesn't catch it.
So, I've tentatively 'solved' this by repeating the call 0.3 seconds later in addition to the first call at 0 seconds later (which is the next frame). Hoping that sorts it all out but it feels hacky.
Ah no, I always used controls in hopes they'd catch controllers, which now they finally do except only the default layout, so fully supporting controllers is still kind of a nightmare.
Anyway, what is getAnimAction 17? That's not listed on the wiki. Could that be the missing piece, perhaps?
Huh, I definitely needed that 17 anim. I had no idea about that one. Well, this version doesn't feel as snappy as my original version, but as a compatibility mode it's probably fine, at least for the time being. Scratch that, it's just as snappy now.
I had problems like what Jeffear had below. Removing this mod fixed them all up, weird yelling when ADSing, flashbangs, debug text in the top corner. Might just be that many mods share a way to get into debug mode.
I can't reproduce any of those issues listed, not to mention they don't make any sense from a logical standpoint. I can load up the mods he listed just fine.
Even if, for example with PN's Enhanced Vision, I intentionally set the hotkey to my aim key, the night vision toggles on and off as you would expect. Turns on when I toggle my aim, turns off when I toggle off my aim.
What's more than likely happening is someone has hit their mod limit, which causes a wide variety of seemingly random problems.
I aint gonna claim to know any of the spaghetti code that makes up good ol FNV or any of its mods, just reporting that I had those issues, and that after disabling this mod in particular everything ran fine. I've installed more mods since then with 0 issues, and I'm running the mod limit fix below the max. Re-enabling this mod causes all the same issues to reappear again, even loading it last. I previously had no issues with this mod, so maybe it's just the nature of the FNV/gamebryo spaghetti. If my FNV wasn't so borked I would totally be using this, cheers for making it for all us toggle-ers slippy.
somotchaua, are you sure togle aim is included in jip selective fire? i tried looking for it in mcm and couldnt find it. if you know where it is would you mind letting me know as id love to use it :)
If anyone using this mod is getting bizarre messages in the top left like "switched to single key pressing" and "Radius: 15 Fade: 0.70 R: 255, G: 182, B:66 Subtract," check to see if you're using "Dynamic Pipboy Light" ( https://www.nexusmods.com/newvegas/mods/64023 ). For some reason, running that alongside this mod causes those messages to spam the screen whenever you're aiming; disabling Dynamic Pipboy Light should solve the issue.
EDIT: It also causes problems with Project Nevada's enhanced vision; cycling through different vision modes will cause "Is this the right actor?" to appear on the top left of the screen. It seems like this mod somehow causes other mods to display their dev's debug messages.
This mod is cool and all but I want to be able to toggle aim using Right Stick as my aim button. Seeming as I cannot I just uninstalled the mod. I was really hoping there would be a separate option in the controls to toggle the toggle but it only works with Left Trigger.
63 comments
That said, if the mod ever needs updating again, the scripts will be restored because I'm too lazy to keep removing them. How exactly do you need compatibility?
Everything is handled with HoldControl and ReleaseControl, so IsControlPressed 6 will give you the current aiming state. It's no different from holding down the aim control manually, except that it auto-releases it during a reload animation.
As an aside, GetPCUsingIronSights and GetPCUsingScope would be the best solution above using IsControlPressed 6
The mod in question is Aim View Switcher which switches to first-person when aiming and back to third afterwards. It works more or less perfectly using events, though I think with the functions now it could be cleaned up more. However, it sometimes gets mismatched with your mod, so I wanted to see exactly how you were doing your switches and match to it, as it seems to be the mod people are talking about when they ask me about making toggle-aim work with my mod.
For reloading, ReleaseControl is called and then this is called to re-toggle your aim after the reload finishes. If reload cancelling is disabled, this is skipped
scn ToggleAimReloadFunc
begin Function {}
if (ToggleAim.bToggled && GetAnimAction != 9 && GetAnimAction != 17)
Call ToggleAimSetFunc 1
SetGameMainLoopCallback ToggleAimReloadFunc 0
endif
end
For holstering, this is called when you press the reload control but doesn't do anything until it's held for 0.5 seconds/the value in the INI.
scn ToggleAimHolsterCancelFunc
begin Function {}
if (IsControlPressed 7 && ToggleAim.bToggled)
set ToggleAim.fHolsterTimer to ToggleAim.fHolsterTimer + GetSecondsPassed
if (ToggleAim.bHolstering == 0 && ToggleAim.fHolsterTimer >= GetINIFloat "Main:fHolsterTimer")
DBPrintC "Toggle Aim: Player is attempting to holster while aiming"
Call ToggleAimSetFunc 0
set ToggleAim.fHolsterTimer to 0
set ToggleAim.bHolstering to 1
endif
else
set ToggleAim.fHolsterTimer to 0
endif
if (ToggleAim.bHolstering)
if (PlayerREF.IsWeaponOut)
PlayerREF.SetWeaponOut 0
endif
if (PlayerREF.IsWeaponOut == 0)
set ToggleAim.bHolstering to 0
SetGameMainLoopCallback ToggleAimHolsterCancelFunc 0
endif
endif
end
The ToggleAimSet function is just a shorthand for setting ToggleAim.bToggled and HoldControl/ReleaseControl at the same time
What's likely happening is that I'm using controls and you're using keys, which are slightly different. Keys should be used for anything that isn't covered by controls, and control detection in other cases
For testing, right now I just have
SetOnPlayGroupEventHandler ({int iAnimGroup} => callAfterSeconds 0 ({} => ToggleFirstPerson (isAnimPlayingEx 3 0 4 || GetPCUsingIronSights || isControlPressed 6 || getAnimAction == 9))) 1 player aim
which so far works perfectly except when bReloadCancel is disabled in your INI, if the player reloads there will be a jarring split-second in between reloading and going back to aiming where the camera is in 3rd-person. Unless that was before I added isControlPressed 6, in which case the problem became that if you tap the aim button during reloading, my mod doesn't catch it.So, I've tentatively 'solved' this by repeating the call 0.3 seconds later in addition to the first call at 0 seconds later (which is the next frame). Hoping that sorts it all out but it feels hacky.
Ah no, I always used controls in hopes they'd catch controllers, which now they finally do except only the default layout, so fully supporting controllers is still kind of a nightmare.
Anyway, what is getAnimAction 17? That's not listed on the wiki. Could that be the missing piece, perhaps?
Well, this version doesn't feel as snappy as my original version, but as a compatibility mode it's probably fine, at least for the time being.Scratch that, it's just as snappy now.Even if, for example with PN's Enhanced Vision, I intentionally set the hotkey to my aim key, the night vision toggles on and off as you would expect. Turns on when I toggle my aim, turns off when I toggle off my aim.
What's more than likely happening is someone has hit their mod limit, which causes a wide variety of seemingly random problems.
If my FNV wasn't so borked I would totally be using this, cheers for making it for all us toggle-ers slippy.
P/s: also sorry for necro :P
EDIT: It also causes problems with Project Nevada's enhanced vision; cycling through different vision modes will cause "Is this the right actor?" to appear on the top left of the screen. It seems like this mod somehow causes other mods to display their dev's debug messages.
2. Please read the description in regards to rebinding your controller button.