Jump to content

Recommended Posts

Posted (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 by TomSkele
Posted

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"

Posted
  On 5/17/2019 at 11:33 PM, Mktavish said:

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?

Posted (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
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
Posted
  On 5/19/2019 at 8:40 PM, Mktavish said:

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.

  • 2 weeks later...
Posted

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"

Posted
  On 5/27/2019 at 11:02 PM, Mktavish said:

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"

Posted

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.

Posted
  On 5/28/2019 at 6:29 AM, Mktavish said:

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...

  • Recently Browsing   0 members

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