Grabby Fingers

Post » Sat May 28, 2011 12:16 pm

I'm pretty sure this would be possible (and, for the record welcome anyone to do it) but I wanted some clarifications before I attempted making it, only to have it fail miserably.

I'm a novice scripter at best, so please forgive my stupidities. A thought I've had for a couple days is what I've been calling grabby fingers - holding the grab key while activating something uses/equips the targeted item. (Note - holding. Not toggling) So with a gun in the crosshairs, and holding the grab key and tapping activate it would pick it up, and equip it on the player.

How does one go about checking what's in the crosshairs? And could one set that to a MyRef variable, activate it, and then equip the MyRef object? I swear I've seen something like this for Oblivion, but of course OBSE adds a lot of things FOSE hasn't got around to yet, so I'm still a bit wary of it.
User avatar
Smokey
 
Posts: 3378
Joined: Mon May 07, 2007 11:35 pm

Post » Sat May 28, 2011 6:50 pm

I don't know how to do this, but I hope you can figure it out because I'd definitely use a mod like that. Especially since I'm using Arwen's Realism Tweaks which likes knocking your weapon out of your hands sometimes...
User avatar
Add Me
 
Posts: 3486
Joined: Thu Jul 05, 2007 8:21 am

Post » Sat May 28, 2011 4:23 pm

Untested, but this ought to do it. Needs FOSE though. The quest delay would need to be set to something short to make sure the script doesn't miss the player pressing the activate button - like 0.01 seconds or something.

scn GrabbyFingersQuestScriptref rGrabbedshort sEquipGrabbedbegin gamemode   IF sEquipGrabbed      player.equipitem rGrabbed 0 1      set sEquipGrabbed to 0   ENDif   set rGrabbed to GetPlayerGrabbedRef   IF rGrabbed      IF isControlPressed 5         set sEquipGrabbed to 1      ENDif   ENDif      end


* Edit - or without FOSE


scn GrabbyFingersQuestScriptref rGrabbedref rGrabbingshort sEquipGrabbedbegin gamemode   set rGrabbed to rGrabbing   set rGrabbing to GetPlayerGrabbedRef   IF rGrabbing      set sGrabbedCount to player.getitemcount rGrabbing   ELSEif rGrabbed      IF player.getitemcount rGrabbed > sGrabbedCount         player.equipitem rGrabbed 0 1      ENDif   ENDif      end

User avatar
NAkeshIa BENNETT
 
Posts: 3519
Joined: Fri Jun 16, 2006 12:23 pm

Post » Sat May 28, 2011 6:59 pm

Well...now I feel like crap. You've went ahead and did it all for me, then. (Edit: Not being a [censored], I just wasn't expecting to have that just...done so quickly.)

I'll set up the Non-FOSE version first, and if it works I beg you to release it. And as you've got some seriously wicked modding mojo, you'll probably get the urge to do other things with it too.
User avatar
kristy dunn
 
Posts: 3410
Joined: Thu Mar 01, 2007 2:08 am

Post » Sat May 28, 2011 3:41 pm

If it works and you want to release it as a joint project I'd be fine with that.

It'd be cool if you could maybe rig it to where holding down the grab key wound up your arm, and then releasing it threw the object. I have no idea if that's possible though - detecting the key press would probably require FOSE, and I don't think this engine has the Unreal engine's ability to set an object's velocity via script. Even if I got that working, I think there'd definitely still be a market for a non-FOSE version that just included the grab/equipping.
User avatar
Jonathan Montero
 
Posts: 3487
Joined: Tue Aug 14, 2007 3:22 am

Post » Sat May 28, 2011 8:33 pm

Okay...I've got oddities for news. The script saves fine but when I save the ESP to test it out the GECK freezes and crashes, with the non-fose method. It's probably something I'm overlooking, as that's usually the case. Then again I've not had sleep in near on a day, and scripting has never been my strong part. I'll try the FOSE version in a little bit, but if you have a little time see if you can't get the non-FOSE script to work. That'd attract more people, I'd think. Then again, people aught to be using FOSE anyways.

Damnit...I think I'm rambling again.
User avatar
Madison Poo
 
Posts: 3414
Joined: Wed Oct 24, 2007 9:09 pm

Post » Sat May 28, 2011 10:40 pm

OK, got a chance to try it out. The GetPlayerGrabbedRef returns a reference object (the actual individual instance of the object being grabbed) rather than the base object type, so you need the FOSE function GetBaseObject to convert it before it will work. I think the non-FOSE code is probably better than the FOSE code, but it will still require FOSE for that one function. I tried it out in game though and it worked. Not sure why you'd get a CTD, although I did forget to declare the sGrabbedCount variable in the code above, so the script wouldn't have compiled as is. I'll go ahead and upload it to the Nexus, and list you as a co-author.

*Edit - Here's a http://www.fallout3nexus.com/downloads/file.php?id=14624
User avatar
Leilene Nessel
 
Posts: 3428
Joined: Sun Apr 15, 2007 2:11 am

Post » Sat May 28, 2011 7:24 pm

I saw that it hadn't been defined and I did so as a short. From there, it seemed like it was all set to go. But that was the time my GECK starts acting freaky so I didn't get to test it.

But damn you move fast. Already got it working, and packaged up. I still feel like I didn't have much to do with the development of the mod though, so putting my name on it feels awkward. I appreciate the sentiments though. It's nice to see that this was possible and it wasn't terribly hard to accomplish.

:EDIT: There's a single hitch with this, thus far. It works fine for a while, and the all the sudden it just stops working. Restarting Fallout fixes it until it happens again. Nothing major. It works perfectly when it is working, though.
User avatar
Andres Lechuga
 
Posts: 3406
Joined: Sun Aug 12, 2007 8:47 pm

Post » Sat May 28, 2011 4:29 pm

If it works and you want to release it as a joint project I'd be fine with that.

It'd be cool if you could maybe rig it to where holding down the grab key wound up your arm, and then releasing it threw the object. I have no idea if that's possible though - detecting the key press would probably require FOSE, and I don't think this engine has the Unreal engine's ability to set an object's velocity via script. Even if I got that working, I think there'd definitely still be a market for a non-FOSE version that just included the grab/equipping.


You could try placing an explosion a unit behind the object you dropped with a tiny explosion radius to minimize "collateral". Although now I can't remember if there is a radius box or if it's just determined by the force value...
User avatar
Del Arte
 
Posts: 3543
Joined: Tue Aug 01, 2006 8:40 pm

Post » Sat May 28, 2011 11:20 am

:EDIT: There's a single hitch with this, thus far. It works fine for a while, and the all the sudden it just stops working. Restarting Fallout fixes it until it happens again. Nothing major. It works perfectly when it is working, though.


Darn, I was sort of hoping I'd be able to palm the tech support off on my co-author... :bolt:

I really didn't test it very extensively, but I'll start using it in game and see if I can figure out when it messes up. This is my first time using the GetPlayerGrabbedRef so I'm sure its got some idiosyncracys that I'm unaware of.

Regarding the explosions, that would probably be the way to do it. Another thing I was thinking was possibly using the fireweapon command and the rockit launcher, though I have no idea how that would work, and I think it would be even more difficult to vary the throwing force. It'd be cool if power armor made you hurl stuff a few hundred yards.
User avatar
Tom
 
Posts: 3463
Joined: Sun Aug 05, 2007 7:39 pm

Post » Sat May 28, 2011 9:40 am

This is a great idea :) I'll playtest it as well when I get the chance :D
User avatar
Nina Mccormick
 
Posts: 3507
Joined: Mon Sep 18, 2006 5:38 pm

Post » Sat May 28, 2011 4:07 pm

I'll dig around with it. When I get home of course - my laptop can't handle Fallout, let alone the GECK.
User avatar
Richard Thompson
 
Posts: 3302
Joined: Mon Jun 04, 2007 3:49 am

Post » Sat May 28, 2011 5:57 pm

I thought up something that I think would make sense to package along with Grabby Fingers. I'd like to create a perk that lets you take the weapon directly from your opponent, and either begin using it, or put it in your inventory.

You'd need to be:

close enough (melee range)
either unarmed, or using an unarmed weapon
have an unarmed skill higher than your opponent's (and possibly strength and agility would factor in as well, along with some randomness)
have your crosshair pointing at your opponent

Then you press grab to take their weapon and equip it, or use to take it and put it in your inventory. I might add in something that prevents you from attacking for a fraction of a second after a disarm attempt, to keep things reasonably balanced.

It'd be cool if I could come up with an animation to go along with the disarming (ever player Mirror's Edge?) but for now the weapon will just sort of appear in your hands if you're successful.
User avatar
Louise Andrew
 
Posts: 3333
Joined: Mon Nov 27, 2006 8:01 am

Post » Sat May 28, 2011 11:19 am

You could just do the punch animation, implying that the player grabs the weapon in a sweep move (better than nothing) :P
User avatar
Sabrina garzotto
 
Posts: 3384
Joined: Fri Dec 29, 2006 4:58 pm

Post » Sat May 28, 2011 7:51 am

I think that would work. I should be able to find some good sounds to play too.
User avatar
Rowena
 
Posts: 3471
Joined: Sun Nov 05, 2006 11:40 am

Post » Sat May 28, 2011 5:47 pm

...

I told y'all I would dig around with GF and see why it would quit after a bit during the game, until you restart Fallout. Well, now it seems to be working fine. And I haven't tweaked it. Maybe I was just in need of a reboot or something.

Imp, that sounds epic. Maybe a complete "Grabbing Overhaul" is on the way, now. You've done spectacular with IMCP (I use it, love it) so I literally am always looking for your next big thing.
User avatar
Auguste Bartholdi
 
Posts: 3521
Joined: Tue Jun 13, 2006 11:20 am

Post » Sat May 28, 2011 9:52 am

I don't know if you've checked out that game Brink, but it has this S.M.A.R.T. system that combines a hotkey and the position of your crosshair to enable a bunch of parkour style moves, like jumps and vaults and slides. I always thought it would be cool to do something like that for melee combat - point your crosshair at your opponent's neck, and you get them in a headlock, point it at their arm and take their weapon, point it at their face or body and punch them. I don't think there's a way to do that exactly, but I could check to see if you're aiming up, down, level, or to the left or right of your opponent, and then add in a bunch of moves. UltraViolence did it for Oblivion, more or less (I think that's what it's called) but with a lot more hotkeys. That would be a major project.

But first I've got to get the disarming to work. Limited success so far, it seemed to work for a bit, though it left a dummy model of the enemy's weapon still held in their hands but swung like a club (bunch of supermutants trying to beat me to death with miniguns). I've still got a bunch of stuff left to try though.
User avatar
Leticia Hernandez
 
Posts: 3426
Joined: Tue Oct 23, 2007 9:46 am


Return to Fallout 3