Jump to content

Home

How Do Beast Trick/Mind Trick avoid breaking stealth?


quantumpencil

Recommended Posts

I've noticed that these two abilities do not break stealth, yet every other force power seems to do so. At first I thought it was the SignalEvent() call present in most force functions, but even after commenting that out, my own custom force powers still break stealth -- enemies just won't respond if no signal is sent.

 

I'd very much like to expand the Watchman's uniqueness by giving it some powers that don't break stealth. Is this possible?

 

EDIT:

 

I found a possible workaround using EffectInvisibility(By making Force Camou/Etc apply the effect) which lets me easily control what breaks it and what doesn't.

 

Now I'm having a different problem -- Invisibility is not removed in cutscenes or via dialogue. I would like to modify this, but I'm running into trouble. This is my modified k_def_dialogue01 script -- which doesn't seem to be doing anything.

Show spoiler
(hidden content - requires Javascript to show)

#include "k_inc_debug"

#include "k_inc_switch"

 

void QP_RemovePowerEffects(int nPower, object oTarget) {

if (GetHasSpellEffect(nPower, oTarget)) {

effect eEff = GetFirstEffect(oTarget);

while (GetIsEffectValid(eEff)) {

if( GetEffectSpellId(eEff) == nPower) {

RemoveEffect(oTarget, eEff);

}

eEff = GetNextEffect(oTarget);

}

}

}

 

void QP_InvisibilityRemove(){

object oEnemy = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1);

if (GetHasSpellEffect(FORCE_POWER_FORCE_CAMOUFLAGE, oEnemy)) {

QP_RemovePowerEffects(FORCE_POWER_FORCE_CAMOUFLAGE, oEnemy);

}

if (GetHasSpellEffect(FORCE_POWER_IMPROVED_FORCE_CAMOUFLAGE, oEnemy)) {

QP_RemovePowerEffects(FORCE_POWER_IMPROVED_FORCE_CAMOUFLAGE, oEnemy);

}

if (GetHasSpellEffect(FORCE_POWER_MASTER_FORCE_CAMOUFLAGE, oEnemy)) {

QP_RemovePowerEffects(FORCE_POWER_MASTER_FORCE_CAMOUFLAGE, oEnemy);

}

location lLoc = GetLocation(oEnemy);

oEnemy = GetFirstObjectInShape(SHAPE_SPHERE, 30.0, lLoc, TRUE);

while (GetIsObjectValid(oEnemy)) {

if (GetHasSpellEffect(FORCE_POWER_FORCE_CAMOUFLAGE, oEnemy)) {

QP_RemovePowerEffects(FORCE_POWER_FORCE_CAMOUFLAGE, oEnemy);

}

if (GetHasSpellEffect(FORCE_POWER_IMPROVED_FORCE_CAMOUFLAGE, oEnemy)) {

QP_RemovePowerEffects(FORCE_POWER_IMPROVED_FORCE_CAMOUFLAGE, oEnemy);

}

if (GetHasSpellEffect(FORCE_POWER_MASTER_FORCE_CAMOUFLAGE, oEnemy)) {

QP_RemovePowerEffects(FORCE_POWER_MASTER_FORCE_CAMOUFLAGE, oEnemy);

}

}

oEnemy = GetNextObjectInShape(SHAPE_SPHERE, 30.0, lLoc, TRUE);

}

 

void main()

{

QP_InvisibilityRemove();

ExecuteScript("k_ai_master", OBJECT_SELF, KOTOR_DEFAULT_EVENT_ON_DIALOGUE);

}

 

I feel like this should work. Whenever the dialogue script fires, The first PC is returned and then the effects (including invisibility) of The Force Camou family are stripped from him and anyone around him (including team mates). However it does nothing, which leads to my whole party staying invisible through dialog -_-

Link to comment
Share on other sites

I would just like to say that I've resolved this problem, and share my solution with others. There are a few things to work out, and they might be pretty annoying -- but this is good base functionality.

 

If you want to use force camouflage to apply a true invisibility effect -- you can do it using an Invisibility Effect and applying that effect through a force power. This will enable you to easily choose what spells break invisibility just by setting them as hostile or not when you Signal the cast even to the game engine.

 

To make enemies have a chance of noticing you, use this modified k_def_heartbeat script:

 

Show spoiler
(hidden content - requires Javascript to show)

#include "k_inc_switch"

#include "k_inc_debug"

 

void QP_RemovePowerEffects(int nPower, object oTarget);

void QP_InvisibilityCheck();

 

void QP_RemovePowerEffects(int nPower, object oTarget) {

if (GetHasSpellEffect(nPower, oTarget)) {

effect eEff = GetFirstEffect(oTarget);

while (GetIsEffectValid(eEff)) {

if( GetEffectSpellId(eEff) == nPower) {

RemoveEffect(oTarget, eEff);

}

eEff = GetNextEffect(oTarget);

}

}

}

 

void QP_InvisibilityCheck(){

object oEnemy = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);

int Awareness = GetSkillRank(SKILL_AWARENESS, OBJECT_SELF);

int Stealth = GetSkillRank(SKILL_STEALTH, oEnemy);

if(Awareness > Stealth && (GetDistanceBetween(oEnemy, OBJECT_SELF) <= 25.0f)){

effect eLink1 = EffectSeeInvisible();

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink1, OBJECT_SELF, 6.0);

if (GetHasSpellEffect(FORCE_POWER_FORCE_CAMOUFLAGE, oEnemy)) {

QP_RemovePowerEffects(FORCE_POWER_FORCE_CAMOUFLAGE, oEnemy);

}

if (GetHasSpellEffect(FORCE_POWER_IMPROVED_FORCE_CAMOUFLAGE, oEnemy)) {

QP_RemovePowerEffects(FORCE_POWER_IMPROVED_FORCE_CAMOUFLAGE, oEnemy);

}

if (GetHasSpellEffect(FORCE_POWER_MASTER_FORCE_CAMOUFLAGE, oEnemy)) {

QP_RemovePowerEffects(FORCE_POWER_MASTER_FORCE_CAMOUFLAGE, oEnemy);

}

location lLoc = GetLocation(oEnemy);

object oEnemy = GetFirstObjectInShape(SHAPE_SPHERE, 30.0, lLoc, TRUE);

while (GetIsObjectValid(oEnemy)) {

if (GetIsEnemy(oEnemy) && !GetIsDead(oEnemy)) {

if (GetHasSpellEffect(FORCE_POWER_FORCE_CAMOUFLAGE, oEnemy)) {

QP_RemovePowerEffects(FORCE_POWER_FORCE_CAMOUFLAGE, oEnemy);

}

if (GetHasSpellEffect(FORCE_POWER_IMPROVED_FORCE_CAMOUFLAGE, oEnemy)) {

QP_RemovePowerEffects(FORCE_POWER_IMPROVED_FORCE_CAMOUFLAGE, oEnemy);

}

if (GetHasSpellEffect(FORCE_POWER_MASTER_FORCE_CAMOUFLAGE, oEnemy)) {

QP_RemovePowerEffects(FORCE_POWER_MASTER_FORCE_CAMOUFLAGE, oEnemy);

}

}

oEnemy = GetNextObjectInShape(SHAPE_SPHERE, 30.0, lLoc, TRUE);

}

}

}

 

 

void main()

{

QP_InvisibilityCheck();

ExecuteScript("k_ai_master", OBJECT_SELF, KOTOR_DEFAULT_EVENT_ON_HEARTBEAT);

}

 

Enemies who have more awareness than you have Stealth will notice you and remove your invisibility.

 

To deal with invisibility showing up in dialogue, you can use this:

Show spoiler
(hidden content - requires Javascript to show)

#include "k_inc_debug"

#include "k_inc_switch"

 

void QP_RemovePowerEffects(int nPower, object oTarget) {

if (GetHasSpellEffect(nPower, oTarget)) {

effect eEff = GetFirstEffect(oTarget);

while (GetIsEffectValid(eEff)) {

if( GetEffectSpellId(eEff) == nPower) {

RemoveEffect(oTarget, eEff);

}

eEff = GetNextEffect(oTarget);

}

}

}

 

void QP_InvisibilityRemove(){

object oEnemy = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1);

if (GetHasSpellEffect(FORCE_POWER_FORCE_CAMOUFLAGE, oEnemy))

{

QP_RemovePowerEffects(FORCE_POWER_FORCE_CAMOUFLAGE, oEnemy);

}

if (GetHasSpellEffect(FORCE_POWER_IMPROVED_FORCE_CAMOUFLAGE, oEnemy))

{

QP_RemovePowerEffects(FORCE_POWER_IMPROVED_FORCE_CAMOUFLAGE, oEnemy);

}

if (GetHasSpellEffect(FORCE_POWER_MASTER_FORCE_CAMOUFLAGE, oEnemy))

{

QP_RemovePowerEffects(FORCE_POWER_MASTER_FORCE_CAMOUFLAGE, oEnemy);

}

location lLoc = GetLocation(oEnemy);

oEnemy = GetFirstObjectInShape(SHAPE_SPHERE, 30.0, lLoc, TRUE);

while(GetIsObjectValid(oEnemy))

{

if (GetHasSpellEffect(FORCE_POWER_FORCE_CAMOUFLAGE, oEnemy))

{

QP_RemovePowerEffects(FORCE_POWER_FORCE_CAMOUFLAGE, oEnemy);

}

if (GetHasSpellEffect(FORCE_POWER_IMPROVED_FORCE_CAMOUFLAGE, oEnemy))

{

QP_RemovePowerEffects(FORCE_POWER_IMPROVED_FORCE_CAMOUFLAGE, oEnemy);

}

if (GetHasSpellEffect(FORCE_POWER_MASTER_FORCE_CAMOUFLAGE, oEnemy))

{

QP_RemovePowerEffects(FORCE_POWER_MASTER_FORCE_CAMOUFLAGE, oEnemy);

}

oEnemy = GetNextObjectInShape(SHAPE_SPHERE, 30.0, lLoc, TRUE);

}

}

 

void main()

{

QP_InvisibilityRemove();

ExecuteScript("k_ai_master", OBJECT_SELF, KOTOR_DEFAULT_EVENT_ON_DIALOGUE);

}

 

This will remove invisibility effects from force camou line whenever you start a dialogue with most things in the game. There are a few dialogues where this doesn't seem to work (mostly if the dialog starts not through you talking to the character, but by getting close enough to them... which is annoying -_-). Not sure how to work around that yet, but this is a good start.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...