Jump to content

Is there any way to add the invisibility effect to NPCs?


MaiYass

Recommended Posts

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 by TomSkele
Link to comment
Share on other sites

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

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

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
end

You 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 by GamerRick
Link to comment
Share on other sites

  • 2 weeks later...

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

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

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

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

  • Recently Browsing   0 members

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