Jump to content

Borderlands style interactions


SpartanISW108

Recommended Posts

  • Replies 52
  • Created
  • Last Reply

Top Posters In This Topic

And done like this would mean it's 100% compatible with modded weaponry

I couldn't say since I haven't done it, but it shouold be fine with modded weapons (retain all mods etc), the same as if you dropped it via the inventory screen

 

as well as able to detect when fists and quest objects are equipped so you don't lose them?

May or may not, I don't know if fists can be dropped, but its not hard to put a condition on it != assuming fists have a form id. In regard to quests I don't know if the drop function bypasses the quest flag, or not. If it does, then I don't see any obvious way to prevent it.

Link to comment
Share on other sites

I'm looking myself and the getequipped command required you to give it a reference, not used to actually get a reference of what you have equipped. Am I using it wrong?

getEquippedObject gets us a string to fill a rVar, which is used by the drop function (it's a NVSE function), but as I mentioned it returns a base ID and we need a refID.

 

But the drop function needs to be passed a refID. getEquippedObject that can be directed to check the weapon (equip slot #5), but it returns a base value and we need a ref.

Link to comment
Share on other sites

I tried that also, and it still says I need a reference. I'm sorry I'm coming across as incompetent, I'm just really not good with scripts

Your not incompetant, we all have to learn, no one has this knowledge genetically included in our genome. Think about what your asking it. You: "What weapon is being held?" Geck: "what weapon for who/whom?" You: "playerRef.getEquippedObject" Geck: "Oh you wanna know what the player is holding, OK"

Link to comment
Share on other sites

EDIT: Got it working and merged it into the script for Grabby Fingers.
scn GrabbyFingersQuestScript

ref rGrabbed
ref rGrabbing
short sEquipGrabbed
short sGrabbedCount

float keyHeldTimer

short DropKeyPressed

ref rWeaponEquipped

begin gamemode

	set rGrabbed to rGrabbing
	set rGrabbing to GetPlayerGrabbedRef
	set rGrabbing to rGrabbing.getbaseobject
	IF 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

The weapon sometimes ends up clipping into terrain and falling under it, but oh well. Beggars can't be choosers.

 

I did the part from "if IsKeyPressed 45"

 

All from looking up similar scripts which did different things.

 

Thank you for your help.

 

If you know a way to stop some weapons clipping into and through terrain that'd be great.

Edited by ilyasw
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...