SpartanISW108 Posted April 3, 2014 Author Share Posted April 3, 2014 The drop feature works pretty much as I want it to do so, apart from the fact it stops working after x amount of time which I don't understand :/ Link to comment Share on other sites More sharing options...
Gribbleshnibit8 Posted April 3, 2014 Share Posted April 3, 2014 In that first block up there, before the GetBaseObject, add in another if for just that that's like if IsFormValid rGrabbing ; do getbaseobject endif What I think is happening is that at some point that variable is coming up as null, and calling getbaseobject, or any function that expects an object, on a null or bad reference will cause the script to crash. Since this is a quest script, that means it'll never restart on its own unless you do a refresh on it. You could get around that by either using NVSE4's user functions to make a function script that does the actual checks, or calling a quest stage that does the check. Since those scripts only exist while they run, if they crash they can still run the next time they're called, and they won't stop the main script from working. Link to comment Share on other sites More sharing options...
irswat Posted April 3, 2014 Share Posted April 3, 2014 (edited) idea: zap the object being dropped, markfordelete, and then placeatme?dev didn't know about navmeshes not affecting objects. learn something new everyday! Edited April 3, 2014 by irswat Link to comment Share on other sites More sharing options...
SpartanISW108 Posted April 3, 2014 Author Share Posted April 3, 2014 Gribble, so I just need to put in a failsafe? To restart the script in case it crashes? Link to comment Share on other sites More sharing options...
SpartanISW108 Posted April 4, 2014 Author Share Posted April 4, 2014 I figured out what causes the script to break. It's whenever the grab function is used on a dead body. Is there a way for the script to restart after a pass so that it doesn't break in such a way? Or for it to detect whether or not the item I'm grabbing is able to be picked up and equipped via the script or not?Current iteration: scn GrabbyFingersQuestScript ref rGrabbed ref rGrabbing ref rWeaponEquipped short sEquipGrabbed short sGrabbedCount short DropKeyPressed begin gamemode set rGrabbed to rGrabbing set rGrabbing to GetPlayerGrabbedRef set rGrabbing to rGrabbing.getbaseobject IF isFormValid rGrabbing set sGrabbedCount to player.getitemcount rGrabbing ELSEif rGrabbed IF player.getitemcount rGrabbed > sGrabbedCount player.equipitem rGrabbed 0 1 ENDif ENDif endif if IsKeyPressed 45 set DropKeyPressed to 1 elseif DropKeyPressed == 1 set rWeaponEquipped to player.geteqobj 5 player.unequipitem rweaponequipped 1 player.drop rweaponequipped 1 set DropKeypressed to 0 set rWeaponEquipped to 0 endif end Link to comment Share on other sites More sharing options...
Gribbleshnibit8 Posted April 4, 2014 Share Posted April 4, 2014 I already had it done in my local version, just went ahead and uploaded it. Grab and Go now has the ability to drop the currently equipped weapon by holding Grab and tapping Activate. Will not drop if holstered. Weapon health is preserved through all transactions, but they can glitch through the ground when dropped. This seems to happen more often with some weapons than others, and less often while moving. http://www.nexusmods.com/newvegas/mods/49117/? Link to comment Share on other sites More sharing options...
SpartanISW108 Posted April 4, 2014 Author Share Posted April 4, 2014 The problem I'm facing now is the pick up weapons using grab and interact part of the script.Does grab and go use the grab + interact function to auto equip the weapon? Cause that's what I like about grabby fingers.The drop part of the script works fine, and will work on it's own. I merged it with the grabby fingers script for convenience sake.The grabby fingers part of the script is where I'm having errors (thus stopping the script from running at all) but I'd like to preserve the hotkey as "grab" + "interact" as I wouldn't like just the one key being used to auto-equip weapons (another mod used just the grab button is held to pick up and auto equip wepaons and I didn't like it) Link to comment Share on other sites More sharing options...
irswat Posted April 4, 2014 Share Posted April 4, 2014 idea: zap the object being dropped, markfordelete, and then placeatme? dev didn't know about navmeshes not affecting objects. learn something new everyday!grib could this work to stop the clipping issues? Link to comment Share on other sites More sharing options...
devinpatterson Posted April 4, 2014 Share Posted April 4, 2014 I figured out what causes the script to break. It's whenever the grab function is used on a dead body. Is there a way for the script to restart after a pass so that it doesn't break in such a way? Yeah I think so, standard disclaimer, not a script guy, blah blah. You can have another quest as a failsafe. It's quest script can check if your grabby fingers is running (as Gribbleshnibit8 suggested) by using getQuestRunning and using resetQuest or startQuest to start it back up if it's not. Use resetQuest if you want to clear any vars, but startQuest will probably work fine. Or for it to detect whether or not the item I'm grabbing is able to be picked up and equipped via the script or not? I think you can filter out actors via the isActor function or the getDead as a condition before you set your var to the ref. It's possible that one or the other may also break the script, but try it and see. Link to comment Share on other sites More sharing options...
devinpatterson Posted April 4, 2014 Share Posted April 4, 2014 dev didn't know about navmeshes not affecting objects. learn something new everyday! Just think of it as pathfinding for AIs idea: zap the object being dropped, markfordelete, and then placeatme? grib could this work to stop the clipping issues? I think a possible problem there is, your not going to get the same weapon. It's health, for instance, will probably be different, so you might need to use getWeaponHealthPerc. You'd also want to get the base form from the ref too (getBaseObject). But I think the real problem is, I'm not sure how it would handle modded weapons since I don't believe they have a different baseID (although I could be wrong) from their non modded versions. But I can understand why you would want to use placeAtMe, since you can drop it relative to the players position and avoid the clipping. BTW not a big deal, hardly even worth mentioning, but markForDelete and zap are the same function, just a shorthand. Link to comment Share on other sites More sharing options...
Recommended Posts