Any way of detecting when [Activate] is pressed without SkSE

Post » Tue Nov 20, 2012 10:20 am

It's pretty self-explanatory.

Need to be able to know when the player has just pressed the "Activate" button. Specifically, I'm trying to detect this when on horseback, but without dismounting the horse.

Maybe this is possible, or maybe it's just crazy and impossible without SkSE. Anyways, I'm giving it a shot :unsure2:
User avatar
Claire Jackson
 
Posts: 3422
Joined: Thu Jul 20, 2006 11:38 pm

Post » Tue Nov 20, 2012 10:04 am

Hello.

Two ways of doing it come to my mind:
* Attach a script to the activated object, and hook OnActivate (or is it OnActivated?).
* Add a perk on the player. On the right side of the perk window, you can choose an "activate" trigger or something. It was designed for the cannibal perk (displaying a menu when you try to look a body) but it can be used for other purposes and you do not have to display a menu.
User avatar
louise hamilton
 
Posts: 3412
Joined: Wed Jun 07, 2006 9:16 am

Post » Tue Nov 20, 2012 2:42 am

That's the point, I don't know what object will be activated. I just want to know when the player hits the physical button.
But the second may really work... I'll test it when I can. Thanks for the suggestion :wink:
User avatar
Minako
 
Posts: 3379
Joined: Sun Mar 18, 2007 9:50 pm

Post » Tue Nov 20, 2012 1:02 pm

There's no way to detect keypresses without SKSE.
User avatar
Elle H
 
Posts: 3407
Joined: Sun Aug 06, 2006 3:15 am

Post » Tue Nov 20, 2012 7:46 am

The only key I need to detect (which is not even technically a key, but an event triggered by a key assignment) is the activation. So there might be a workaround like the one Perdev suggested (the 2nd one)

But you might be right instead (and that's what I fear :ermm: ) But I'll have to check his Idea first.
User avatar
Anthony Diaz
 
Posts: 3474
Joined: Thu Aug 09, 2007 11:24 pm

Post » Tue Nov 20, 2012 3:14 pm

The OnActivate event will detect activation though, the result of the keypress, in which case you'll already be in the process of dismounting. :shrug:


Perhaps:
Int iActivationKeyScriptName MrEdScript Extends ReferenceAliasEvent OnActivate(ObjectReference akActionRef)	iActivationKey = Input.GetMappedKey("Activate")	Input.HoldKey(iActivationKey)	RegisterForKey(iActivationKey)EndEventEvent OnKeyDown(Int aiKeyCode)	Debug.Trace("Do other stuff, but don't dismount")	ReleaseKey(iActivationKey)	UnregisterForKey(iActivationKey)EndEvent
Of course, that does require SKSE, but something like that might pull off the dismount intervention.

Oh, try http://www.creationkit.com/BlockActivation_-_ObjectReference on Mr. Ed?
User avatar
DarkGypsy
 
Posts: 3309
Joined: Tue Jan 23, 2007 11:32 am

Post » Tue Nov 20, 2012 6:02 pm

If I don't find a way to circumvent this without using SkSE, I might have to and your code model will be useful. And also, this script, should I attach this to a RefAlias pointing to the horse? Thanks. If I find a way around, I'll post it here. :thumbsup:
User avatar
Beat freak
 
Posts: 3403
Joined: Thu Dec 14, 2006 6:04 am

Post » Tue Nov 20, 2012 7:59 am

BlockActivation might be all you need as the scripted OnActivate stuff attached to the horse should fire w/o triggering the mount/dismount.
User avatar
JD FROM HELL
 
Posts: 3473
Joined: Thu Aug 24, 2006 1:54 am

Post » Tue Nov 20, 2012 2:41 pm

So when you press [activate] on horseback, you're actually activating the horse (might I assume)... Clever! I'll try it!
User avatar
Sabrina Steige
 
Posts: 3396
Joined: Mon Aug 20, 2007 9:51 pm

Post » Tue Nov 20, 2012 6:20 pm

Not positive it works that way for dismount, but activating a horse seems to be what prompts the mounting.
User avatar
Yama Pi
 
Posts: 3384
Joined: Wed Apr 18, 2007 3:51 am

Post » Tue Nov 20, 2012 9:30 am

Simple: Since we're receiving the event anyway, why not check if IsOnMount() and, if not, call Activate(Player) with the ignore event flag? This would also ignore the blocked activation.
User avatar
KiiSsez jdgaf Benzler
 
Posts: 3546
Joined: Fri Mar 16, 2007 7:10 am


Return to V - Skyrim