Jump to content

Script Check


TBGT

Recommended Posts

As the description says I am looking for someone who could check a script for me.

 

The idea was to make a dart gun which knocks people out on the first shot and if still unconscious ODs them on the second.

 

I also tried using resetAI in order to annul any hostilities from the attack but it didn't work.

 

scn DartGUNFatigueOnHitScript

float fFatigueDam

Begin OnHit

Player.RewardXP 15

Ref DartgunTarget
Set DartgunTarget to GetOwnerLastTarget

	

	If (DartgunTarget != PlayerRef) && (DartgunTarget.GetIsCreatureType 6 != 1)

		DartgunTarget.ResetAI
		set fFatigueDam to (1000 - ((GetAV Endurance * 2) + (GetAV DamageThreshold * 2)))
		DamageAV Fatigue fFatigueDam
		Player.PushActorAway Dartguntarget 1 
	
		If DartgunTarget.GetUnconscious == 1
				DartgunTarget.killactor
		Else
				DartgunTarget.DamageAV Fatigue fFatigueDam

		EndIf

	Else DartgunTarget.damageAV health 0
	
	EndIf



End

 

Thanks in advance Community

Edited by TBGT
Link to comment
Share on other sites

You haven't said much about what the problem is. Is the problem "nothing happens"? You have to attach the script to a weapon, and so forth. Are you sure all of that is working? The script itself might not be the problem. The script seems more complicated than other weapon effect scripts. If the script is attached in the right place, something much simpler like (not tested, but I have similar code working for a dart gun)

 

begin onhit
       if getunconscious
               kill
       else
               damageav fatigue 1000
       endif
end

 

should be enough. One technique to debug may be to put a setobjectivecompleted message in the script, and a related quest objective. This will show a "COMPLETED:" type message during combat. If that doesn't come, then the script isn't getting called.

Link to comment
Share on other sites

Sorry it was late when I posted.

 

The effect of knocking them out and pushing them away from the actor works, it is the bit which I have tried to get to stop the enemy from being aggro'd which doesn't.

 

I did think that by resetting the AI, its packages and combat status would be reset but I'm unsure as to whether you can do that in script using the ResetAI command or whether that is console specific.

 

I had tried by reducing Damage to 0 for the weapon but that means that a hit doesn't register in the first place meaning no hit to start the effect.

 

Thanks for the reply

Link to comment
Share on other sites

Just one addition, IS there a way to get a weapon to hit and an effect to register without aggro'ing?

Short answer: No. Unless something new was added to NV to allow this (which I wouldn't know, but I guess is unlikely).

 

You can try to clear their aggro, but it's a bit tricky and never seems to be perfect. I'd suggest looking over The Groovatron. That's what I did, although the best result I got was this (warning, loud and crappy audio):

 

http://www.youtube.com/watch?v=3En4r2XTb_E

 

I don't think the Groovatron had those problems anywhere near as bad, but I never used it in game so I'm not sure. There may be other methods and mods that do this, but as far as I know you can't actually avoid them going hostile from a weapon hit in the first place; it's always a matter of making them (and any alerted NPCs nearby) friendly again.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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