Stealthboy Mod

Post » Sat May 28, 2011 12:50 pm

I re-modded the stealthboy in FNV, I am not going to currently release this mod, since it's part of a very huge mod that attempts to fix all bugs in the game as I play it and I am not yet done with it, but I am going to post the stealthboy code here for modders. It basically works like this: If the player enters combat (which also applies if enemies are just searching for her), stealthboy is dispelled, when player drops out of combat, it's applied again, I got the idea from an old F3 chinese stealth armor mod. Also, if the damn stealthboy expires, the game will now display a message asking the player if he wants to use another stealthboy (only if player has some additional stealthboys) in inventory, because the damn stealthboy always expires right when you are sneaking amidst enemies, not funny. I was sneaking thru the REPCONN basemant, can't kill the Nightkin there, otherwise Davison becomes hostile, but I had to somehow get to Davison and then find Harland's girl-friend, I was sneaking past the Nightkin, then stealthboy expires right at this moment! Damn! Ok, here's how the mod works:

1) First, you need to create two BASE actor effects, one that controls steathbox application, the other checking if player wants to re-equip stealthboy on expiration. Call the first effect StealthBoyForCombat, effect archetype Script, second effect gets the ID RenewStealthBoyBaseEffect, also script-based. StealthBoyForCombat is then applied to the player when she "ingests" stealthboy (for 240 seconds with StealthGirl perk, 120 seconds otherwise). Now here's the code for the base effects:

scn DispelStealthOnCombatshort nInCombatbegin ScriptEffectStartAddspell StealthBoyCaution ;create a StealthBoyCaution ABILITY (in the actor effect list, 100 sneak, 75% chameleon)endbegin ScriptEffectUpdateif GetSelf != player ;only do this for player charreturnendifif IsInCombat && nInCombat == 0 ;if player is in combat, dispel the effectset nInCombat to 1dispel StealthBoyCautionelseif IsInCombat == 0 && nInCombat == 1set nInCombat to 0Addspell StealthBoyCaution ;re-add the spell when player drops out of combatendifENDbegin ScriptEffectFinishdispel StealthBoyCaution ;remove the stealthboy ability when the stealthboy ingestible effect expiresif GetSelf != playerreturnendifif getitemcount StealthBoy > 0 ;display the "do you want to re-use the stealthboy?" message if stealthboy user=player charaddspell RenewStealthBoyAbilityendifEND


RenewStealthBoyAbility takes care of re-applying the stealthboy effect to the player if she clicks the "Yes" button. Here's the code for the base effect, applied by the RenewStealthBoyAbility to the player:

scn RenewStealthBoyEffectshort nCounterbegin ScriptEffectStartshowmessage StealthBoyRenewMessage ;show message "do you want to re-use stealthboy -yes/no?"endbegin gamemodeif GetButtonPressed == 0 ;if player clicks "yes", re-equip the stealthboy. Yes, it's equipped like armorequipitem StealthBoyendifdispel RenewStealthBoyAbility ;remove the ability regardless of what button the player clicksEND


here's a screenshot:

http://s467.photobucket.com/albums/rr40/WRFan/ScreenShot61.jpg
User avatar
Andrea P
 
Posts: 3400
Joined: Mon Feb 12, 2007 7:45 am

Post » Sun May 29, 2011 12:12 am

I like the idea. I think it would be neat if the Chinese Stealth suit used a similar method for NV. Would be neat, maybe have a re-charge pack for the "stealth" aspect and you can carry extras or something
User avatar
matt oneil
 
Posts: 3383
Joined: Tue Oct 09, 2007 12:54 am


Return to Fallout: New Vegas