Jump to content

Need help with making a mod


Animositisomina

Recommended Posts

I'm currently working on a mod for Fallout 3 that features a hostile NPC that is supposed to use a stealth boy so that he's "invisible". I've tried searching Google, various forums, and BethSoft's GECK tutorials, but I can't figure out how to achieve the desired effect.

 

Anyone know of a way to do this?

Edited by Animositisomina
Link to comment
Share on other sites

Oh yeah, good suggestion. I forgot all about those Crimson Dragoon characters. I'll take a look at one and see what I can find. Thanks!

 

Edit: Found what I needed and got it working. +1 Kudos to you, M48A5. Thanks again for the suggestion!

Edited by Animositisomina
Link to comment
Share on other sites

I found the script required and have it working the way I want. In case this might be useful to someone else in the future, here is my modified version:

scn SSBNPCScript
;This script tells the NPC what to do in certain stages of combat.

float hitTimer			;Length of time after last hit that the stealth spell gets put back on
float entranceTimer		;Length of time before the NPC first turns on stealth
short firstStealth		;0 - not doing first stealth, 1 - doing first stealth
short firstPackage		;1 - not doing first package, 0 - doing first package
short wasHit			;Was the NPC hit?
short inStealthMode		;1 - if Stealth Effect is enabled, 0 - if it isn't


BEGIN ONLOAD
	set entranceTimer to 0.01
	set firstStealth to 1
END


BEGIN ONHIT
	set inStealthMode to 0
	if getDead == 0
		set wasHit to 1
		set hitTimer to 600
	endif
END


BEGIN GAMEMODE


	if (firstStealth == 1)
		if (entranceTimer < 0)					
			set inStealthMode to 1	
			set firstStealth to 0
		else
			set entranceTimer to (entranceTimer - GetSecondsPassed)
		endif
	endif


	if (wasHit == 1)                        ;if NPC is hit
		if (hitTimer < 0)               ;and his hit timer reaches zero
			set inStealthMode to 1	;go back into stealth
			set wasHit to 0
		else
			set hitTimer to (hitTimer - GetSecondsPassed)
		endif
	endif

	if (inStealthMode == 1)
		addspell stealthBoyInvisibilitySpell
	elseif (inStealthMode != 1)
		removespell stealthBoyInvisibilitySpell
	endif


END

begin OnDeath
	set inStealthMode to 0
	set wasHit to 0
end

A couple notes: I set the entranceTimer to 0.01 because I wanted the NPC to basically be "instantly" invisible when they load. I also changed the hitTimer to 600 seconds (10 minutes) because I didn't want the NPC to re-apply the stealth effect. I knew the fight would never last that long, so I set it high. I've also removed the "rez in" and "rez out" portions of the script, which apply a visual effect to the NPC when they load and also when they die, to make the body disappear. I didn't want the NPC to disappear, so that's why I removed that.

 

For reference, the default Crimson Dragoon script (Operation Anchorage DLC) is called DLC02ArtilleryBaseDragoonSCRIPT.

Edited by Animositisomina
Link to comment
Share on other sites

  • Recently Browsing   0 members

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