I'm glad you think this thread is worth favoriting!
I made a few more changes to the stealth indicator:
;Stealth Indicator
;Healthless Indicator
desc = Shows How Hidden You Are
;Triggers
:state=0:hudreset,hudx=10,hudy=90,hudimage=texturebank/user/eye1.png,hudname=eye1,hudhide=1,hudmake=display
:state=0:hudreset,hudx=10,hudy=90,hudimage=texturebank/user/eye2.png,hudname=eye2,hudhide=1,hudmake=display
:state=0:hudreset,hudx=10,hudy=90,hudimage=texturebank/user/eye3.png,hudname=eye3,hudhide=1,hudmake=display
:state=0:hudreset,hudx=10,hudy=90,hudimage=texturebank/user/eye4.png,hudname=eye4,hudhide=1,hudmake=display
:state=0:hudreset,hudx=10,hudy=90,hudimage=texturebank/user/eye5.png,hudname=eye5,hudhide=1,hudmake=display
:state=0:hudreset,hudx=10,hudy=90,hudimage=texturebank/user/eye6.png,hudname=eye6,hudhide=1,hudmake=display
:state=0:hudreset,hudx=10,hudy=90,hudimage=texturebank/user/eye7.png,hudname=eye7,hudhide=1,hudmake=display
:state=0:hudreset,hudx=10,hudy=90,hudimage=texturebank/user/eye8.png,hudname=eye8,hudhide=1,hudmake=display
:state=0:hudreset,hudx=10,hudy=90,hudimage=texturebank/user/eye9.png,hudname=eye9,hudhide=1,hudmake=display
:state=0:hudreset,hudx=10,hudy=90,hudimage=texturebank/user/eye10.png,hudname=eye10,hudhide=1,hudmake=display
;Dim global variables
:state=0:dimvar=stealth,dimvar=sound,state=10
:isrunning=1:setvar=sound 1000
:isrunning=0:setvar=sound 500
:scancodekeypressed=46:setvar=sound 0
:state=10,vargreater=stealth 900:hudunshow=eye1,hudunshow=eye2,hudunshow=eye3,hudunshow=eye4,hudunshow=eye5,hudunshow=eye6,hudunshow=eye7,hudunshow=eye8,hudunshow=eye9,hudshow=eye10
:state=10,vargreater=stealth 800,varless=stealth 900:hudunshow=eye1,hudunshow=eye2,hudunshow=eye3,hudunshow=eye4,hudunshow=eye5,hudunshow=eye6,hudunshow=eye7,hudunshow=eye8,hudshow=eye9,hudunshow=eye10
:state=10,vargreater=stealth 700,varless=stealth 800:hudunshow=eye1,hudunshow=eye2,hudunshow=eye3,hudunshow=eye4,hudunshow=eye5,hudunshow=eye6,hudunshow=eye7,hudshow=eye8,hudunshow=eye9,hudunshow=eye10
:state=10,vargreater=stealth 600,varless=stealth 700:hudunshow=eye1,hudunshow=eye2,hudunshow=eye3,hudunshow=eye4,hudunshow=eye5,hudunshow=eye6,hudshow=eye7,hudunshow=eye8,hudunshow=eye9,hudunshow=eye10
:state=10,vargreater=stealth 500,varless=stealth 600:hudunshow=eye1,hudunshow=eye2,hudunshow=eye3,hudunshow=eye4,hudunshow=eye5,hudshow=eye6,hudunshow=eye7,hudunshow=eye8,hudunshow=eye9,hudunshow=eye10
:state=10,vargreater=stealth 400,varless=stealth 500:hudunshow=eye1,hudunshow=eye2,hudunshow=eye3,hudunshow=eye4,hudshow=eye5,hudunshow=eye6,hudunshow=eye7,hudunshow=eye8,hudunshow=eye9,hudunshow=eye10
:state=10,vargreater=stealth 300,varless=stealth 400:hudunshow=eye1,hudunshow=eye2,hudunshow=eye3,hudshow=eye4,hudunshow=eye5,hudunshow=eye6,hudunshow=eye7,hudunshow=eye8,hudunshow=eye9,hudunshow=eye10
:state=10,vargreater=stealth 200,varless=stealth 300:hudunshow=eye1,hudunshow=eye2,hudshow=eye3,hudunshow=eye4,hudunshow=eye5,hudunshow=eye6,hudunshow=eye7,hudunshow=eye8,hudunshow=eye9,hudunshow=eye10
:state=10,vargreater=stealth 100,varless=stealth 200:hudunshow=eye1,hudshow=eye2,hudunshow=eye3,hudunshow=eye4,hudunshow=eye5,hudunshow=eye6,hudunshow=eye7,hudunshow=eye8,hudunshow=eye9,hudunshow=eye10
:state=10,vargreater=stealth 0,varless=stealth 100:hudshow=eye1,hudunshow=eye2,hudunshow=eye3,hudunshow=eye4,hudunshow=eye5,hudunshow=eye6,hudunshow=eye7,hudunshow=eye8,hudunshow=eye9,hudunshow=eye10
:state=10,varequal=stealth 0:hudunshow=eye1,hudunshow=eye2,hudunshow=eye3,hudunshow=eye4,hudunshow=eye5,hudunshow=eye6,hudunshow=eye7,hudunshow=eye8,hudunshow=eye9,hudunshow=eye10
;End of Script
Basically the indicator while change a bit more smoothly and show more degrees of stealth than just "highly visible" "somewhat visible" and "not visible". The huds are made from PNG files instead of DDS files so that it is easier to modify the appearance of the indicator. Correspondingly, I've altered the stealth-lights to produce a more variable amount of light:
;Artificial Intelligence Script
;Header
desc = Stealth Allowed Light for Static
;Triggers
;stealth is the universal stealth variable
;Normal Light Intensity
:state=0:state=10
;Visibility
:state=10,plrdistwithin=20:addvar=stealth 1000,state=20
:state=10,plrdistfurther=20,plrdistwithin=40:addvar=stealth 900,state=21
:state=10,plrdistfurther=40,plrdistwithin=60:addvar=stealth 800,state=22
:state=10,plrdistfurther=60,plrdistwithin=80:addvar=stealth 700,state=23
:state=10,plrdistfurther=80,plrdistwithin=100:addvar=stealth 600,state=24
:state=10,plrdistfurther=100,plrdistwithin=120:addvar=stealth 500,state=25
:state=10,plrdistfurther=120,plrdistwithin=140:addvar=stealth 400,state=26
:state=10,plrdistfurther=140,plrdistwithin=160:addvar=stealth 300,state=27
:state=10,plrdistfurther=160,plrdistwithin=180:addvar=stealth 200,state=28
:state=10,plrdistfurther=180,plrdistwithin=200:addvar=stealth 100,state=29
;reset stealth when out of high light zone
:state=20,plrdistfurther=20:subvar=stealth 1000,state=10
:state=21,plrdistfurther=40:subvar=stealth 900,state=10
:state=21,plrdistwithin=20:subvar=stealth 900,state=10
:state=22,plrdistfurther=60:subvar=stealth 800,state=10
:state=22,plrdistwithin=40:subvar=stealth 800,state=10
:state=23,plrdistfurther=80:subvar=stealth 700,state=10
:state=23,plrdistwithin=60:subvar=stealth 700,state=10
:state=24,plrdistfurther=100:subvar=stealth 600,state=10
:state=24,plrdistwithin=80:subvar=stealth 600,state=10
:state=25,plrdistfurther=120:subvar=stealth 500,state=10
:state=25,plrdistwithin=100:subvar=stealth 500,state=10
:state=26,plrdistfurther=140:subvar=stealth 400,state=10
:state=26,plrdistwithin=120:subvar=stealth 400,state=10
:state=27,plrdistfurther=160:subvar=stealth 300,state=10
:state=27,plrdistwithin=140:subvar=stealth 300,state=10
:state=28,plrdistfurther=180:subvar=stealth 200,state=10
:state=28,plrdistwithin=160:subvar=stealth 200,state=10
:state=29,plrdistfurther=200:subvar=stealth 100,state=10
:state=29,plrdistwithin=180:subvar=stealth 100,state=10
;End of Script
The coding's a little bit more brute force than I would've liked, but it gets the job done. Attached are copies of some of the stealth scripts and the huds, in case anyone wants to try them out. I didn't include any enemy scripts, since I've been mostly modifying the TF341 scripts, but it isn't too hard to make the enemy use the stealth stuff.
To make it so that the enemy has to spot you before attacking, include this line before any "shootplr" commands:
...
:state=1,plrcanbeseen,plrdistwithin=%stealth:shootplr
...
or at least something along those lines.
To make it so that the enemy can hear you, include this piece:
...
:state=1,aiheardsound=%sound:state=2,etimerstart.aisettarget
:state=2:airotatetosound,aimovetosound,rotateheadrandom=30
:state=2,etimergreater=2000:aistop,state=3,etimerstart
:state=3:state=1
...
These are pretty basic, and really are just to demonstrate that they can be used.