Jump to content

Begin OnFire Script and Unarmed weapons?


Imca

Recommended Posts

I am trying to make an unarmed weapon that runs a script every time the player punches... however "Begin OnFire" does not seem to be working.

 

Can unarmed weapons even use this script command? If not is there a begin on attack or something similar in NVSE?

Link to comment
Share on other sites

That's an interesting question.

I can think of two ways to achieve this. The first is to make the weapon score a critical hit with every successful strike, and use a critical effect to apply all the additional hit-effects. The second would involve a script. I won't go into details (unless you would like to try it), since I think it's unreliable.

Link to comment
Share on other sites

it would be best if it would activate without having to score a hit.

 

If the script is supposed to run every time the player punches, regardless of whether he actually hit someone, then it would probably make things much simpler. I'll need to know more. What, exactly, is the script intended to do?

Link to comment
Share on other sites

It is intended to run on every punch yes, I am trying to make a thing right now that detonates all the players explosives when the punch, but this is just a test really as I plan to be making more unarmed weapons in general, and if I can get a script to do that, I can make some really unique ones.... like posibly even a rocket fist.

 

Thats kind of an issue I have with mods right now, there is no love for unarmed players, dispite punching being very fun. >.>

Link to comment
Share on other sites

I came upon something very interesting when reading about the OnHit block type in the GECK wiki:

"This function has been altered in New Vegas to run when a weapon hits a target."

 

It is confirmed to work both with melee and ranged weapons:

begin OnHit

	set rTarget to GetOwnerLastTarget	; (Returns the actor that was hit by the weapon)
	; Do stuff on the target.

end
Link to comment
Share on other sites

In that case, this will work:

short	bEquipped
short	iAction

begin OnUnequip

	set bEquipped to 0

end

begin OnEquip player

	set bEquipped to 1

end

begin GameMode

	if bEquipped
		if player.IsWeaponOut
			if iAction != player.GetAnimAction
				set iAction to player.GetAnimAction
				if iAction == 2
					; Do stuff.
				endif
			endif
		endif
	endif

end
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...