MaiYass Posted May 17, 2019 Share Posted May 17, 2019 (edited) So I'm trying to edit an NPC for a mod so that they go invisible during combat, like stay normal when they're simply wandering around, but once they detect an enemy go invisible/use the stealth field, then lose the effect once they exit combat or die, is there some kind of scripting I can do to make this possible, or maybe somehow make it possible to have them use stealth boys once they enter combat? Also, I do not want to simply edit whatever armor they're using, because I'm afraid that might cause conflicts with other stat changing mods. Edited May 17, 2019 by TomSkele Link to comment Share on other sites More sharing options...
Mktavish Posted May 17, 2019 Share Posted May 17, 2019 Invisibility is called the "Chameleon" effect .And it can be adjusted for render refraction , relating to what the player sees.But also adds to the not detected calculation , like sneak does . The caveat being what you the player sees on screen , cannot be equally levied across AI detection. NPC's do not literally have eyes. So not an easy comparison to translate from human to AI . Anyways ... you could turn the "Chameleon" effect on/off with "IsInCombat" Link to comment Share on other sites More sharing options...
MaiYass Posted May 17, 2019 Author Share Posted May 17, 2019 Invisibility is called the "Chameleon" effect .And it can be adjusted for render refraction , relating to what the player sees.But also adds to the not detected calculation , as does sneak. The caveat being what you the player sees on screen , cannot be equally levied across AI detection. NPC's do not literally have eyes. So not an easy comparison to translate from human to AI .Regardless, is there any way I can add this "Chameleon" effect to NPCs in the way I described above? Link to comment Share on other sites More sharing options...
GamerRick Posted May 18, 2019 Share Posted May 18, 2019 (edited) Looking at a script used by the Anchorage DLC on the Dragoon NPCs I found the way to add the spell to a NPC: begin OnStartCombat addspell stealthBoyInvisibilitySpell end begin OnCombatEnd removespell stealthBoyInvisibilitySpell endif OnDeath removespell stealthBoyInvisibilitySpell endYou may need to add a check to see if the NPC has the spell before adding it or removing it. If the above doesn't work well, then there is another way: short hasSpell begin GameMode if GetDead == 0 .....if IsInCombat && hasSpell == 0 .........addspell stealthBoyInvisibilitySpell .........set hasSpell to 1 ....elsif IsInCombat == 0 && hasSpell ........removespell stealthBoyInvisibilitySpell ........set hasSpell to 0 ....endif else ....if hasSpell ........removespell stealthBoyInvisibilitySpell ........set hasSpell to 0 ....endif endif end Edited May 18, 2019 by GamerRick Link to comment Share on other sites More sharing options...
Mktavish Posted May 19, 2019 Share Posted May 19, 2019 LOL thanks Rick ... yes there is many ways to get it done. Link to comment Share on other sites More sharing options...
GamerRick Posted May 19, 2019 Share Posted May 19, 2019 LOL thanks Rick ... yes there is many ways to get it done. I posted that, but am curious why he/she ignored your last sentence and was a tad rude about it. Link to comment Share on other sites More sharing options...
Mktavish Posted May 27, 2019 Share Posted May 27, 2019 Nah , I didn't take it as rude. Would guess they didn't listen to my last sentence because I left it vague how to accomplish that. I lacked a script block fire to then tell it to check "IsInCombat" Link to comment Share on other sites More sharing options...
MaiYass Posted May 28, 2019 Author Share Posted May 28, 2019 Nah , I didn't take it as rude. Would guess they didn't listen to my last sentence because I left it vague how to accomplish that. I lacked a script block fire to then tell it to check "IsInCombat"Apologies, I'm new with scripting so was a little confused about what you meant with "IsInCombat" Link to comment Share on other sites More sharing options...
Mktavish Posted May 28, 2019 Share Posted May 28, 2019 Exactly ... see was my fault. But "IsInCombat" should be run after an actor is the subject in some script logic train. And being an "Is" instead of a "Get" will have less cpu cycle dependence. Link to comment Share on other sites More sharing options...
MaiYass Posted May 28, 2019 Author Share Posted May 28, 2019 Exactly ... see was my fault. But "IsInCombat" should be run after an actor is the subject in some script logic train. And being an "Is" instead of a "Get" will have less cpu cycle dependence.So remember how I said I was new to scripting? What I really meant was I have no experience with scripts... Is there some sort of tutorial of some kind that can help me with creating scripts? Because nothing I've seen when Googling this subject has helped with where to go... Link to comment Share on other sites More sharing options...
Recommended Posts