N help with thief style guards
#1
Posté 03 juillet 2013 - 11:17
Need hints and snippets to make possible the cone-vision, aka that they see only in a certain angle cone in their facing. Normally every npc can see behind too, so I need to bypass it somehow.
Also seeking ideas how to make shadows more properly. Atm I set up interior as an exterior so shadows dont moves but i would like to control shadows, be able to pain them via script so if player put out a candle there will spawn new shadows, anyone seen a placeable that might work for this? Tried to modify darkness vfx but its over my possibilities.
#2
Posté 04 juillet 2013 - 12:13
As you mention, shadows that are preset via a tileset can easily be manipulated with triggers on their very edge, with OnEnter and OnExit scripts that fire to check if the PC is in the shadows or not, and if it is GetIsNight() for additional bonuses.
A cone effect might not be possible without scripting assistance, and even so, my knowledge is nothing like what some of the old folks had back on the old forum when it was full of action and awsome scripts. The legacy forum is something I miss a lot for script knowledge.
Anyhow, checking the relation of the player to the guard using a vector could return a placement result. You could play around with this and see what you can come up with.
#include "nw_i0_tool"
#include "x2_inc_switches"
object oPC = GetFirstPC();
object oTarget = OBJECT_SELF; // GUARD/NPC/ETC...
// Returns a string telling oPlayer where they are in relation to oTarget's position.
string GetDirection(object oTarget, object oPC);
string GetDirection(object oTarget, object oPC)
{
vector vPlayer = GetPosition(oPC);
vector vTarget = GetPosition(oTarget);
float fDist = GetDistanceBetween(oTarget, oPC);
float fCosine = (vTarget.x - vPlayer.x) / fDist;
float fDeltaY = vTarget.y - vPlayer.y;
if(fCosine > 0.7071)
return "DEBUG: Player is east of OBJECT_SELF";
else if(fCosine < -0.7071)
return "DEBUG: Player is west of OBJECT_SELF";
else if(fDeltaY > 0.0)
return "DEBUG: Player is north of OBJECT_SELF";
return "DEBUG: Player is south of OBJECT_SELF";
}
void main()
{
string sMsg = GetDirection(oTarget, oPC);
//Let's see if player is inside OBJECT_SELF personal space bubble!
float fMinDistanceToGuide = 5.0f;
vector vPCPosition = GetPosition(oPC);
vector vGuideLocation = GetPosition(OBJECT_SELF, oPC));
vector vDistance = vPCPosition - vGuideLocation;
float fDistance = VectorMagnitude(vDistance);
if (fDistance <= fMinDistanceToGuide)
{
AssignCommand(oPC, SpeakString("DEBUG: Inside of OBJECT_SELF personal space bubble!"));
return;
}
}
The torch bracket from 1.69 pulses and creates a light source radius around itself. When extinguished, the source of light vanishes returning the shadows around it.
x3_plc_torch001
Placeables -> Building Adornments -> Torch Bracket (first in the list of three).
FP!
#3
Posté 04 juillet 2013 - 01:55
int GetIsFacingTarget(object oSelf, object oTarget, int nViewArc)
{
location lSelf = GetLocation(oSelf);
location lTarget = GetLocation(oTarget);
float AngleOffset = VectorToAngle( GetPosition(oTarget) - GetPosition(oSelf)) - GetFacing(oSelf) ;
//float fViewArc = 180.0;
return (abs(FloatToInt(AngleOffset)) < nViewArc/2);
}
#4
Posté 04 juillet 2013 - 02:36
most guards are walking on waypoints, few is only changing facing
#5
Posté 04 juillet 2013 - 03:51
what tools do you have available to solve this problem?
NWNX?
is there a way to clear the perception state of an NPC with NWNX? If so you could tweak the guards' perception event. If the PC enter's a guards "visible" list, and is about to go hostile, you could check vectors at that point. If the Guard is not facing the PC, then don't send the guard after PC, and clear the PC from the guards "seen" list after a certain delay. As soon as you clear the PC from the list I imagine the guard would probably get another perception check... but that would have to be verified.
Get object in shape?
Is it possible to create a cone shaped AOE on the NPC guard?
Triggers? grid of AOE's?
Is this for specific areas that these particular guards are in? If so you could lay down a bunch of triggers along the guards' route and into which the guards would see if a PC enters them. On each on enter or on exit event you can tag the pc as being in that zone and run an artificial perception event with nearby guards
#6
Posté 04 juillet 2013 - 04:19
Modifié par ShadowM, 04 juillet 2013 - 04:21 .
#7
Posté 04 juillet 2013 - 02:08
I made a thief campaign for nwn2 (Crimmor, in signature) that did shadow based triggers to do hide bonuses for the pc. While it worked in general, the trigger would fail on rare occaisions. Over the course of the module, the adjustments to the hide skill sharply altered the player's hide skill. The code and triggers for it are still in the module, just the code is commented out because it never worked 100% reliably. Day versus night adjustments worked fine.Fester Pot wrote...
I thought about this before going the route of a class specific Wizard/Sorcerer series, and had a few ideas.
As you mention, shadows that are preset via a tileset can easily be manipulated with triggers on their very edge, with OnEnter and OnExit scripts that fire to check if the PC is in the shadows or not, and if it is GetIsNight() for additional bonuses.
I also set things up so that guards and such "own" things and would notice if they were in the "wrong" state, such as a door being open or a torch not being lit.
Not sure how much of the code in my campaign would directly port to nwn1 because of different functions, but I'd imagine someone could get it to work without too much trouble.
Modifié par kamal_, 04 juillet 2013 - 02:09 .
#8
Posté 04 juillet 2013 - 11:17
i dont know if the visibility plugin from virusman allows this, not sure its even public too, and this is for linux so i cant digg into nwnx myself but yers in theory this should workhenesua wrote...
some random ideas i have many of which probably won't work but might lead some where
what tools do you have available to solve this problem?
NWNX?
is there a way to clear the perception state of an NPC with NWNX? If so you could tweak the guards' perception event. If the PC enter's a guards "visible" list, and is about to go hostile, you could check vectors at that point. If the Guard is not facing the PC, then don't send the guard after PC, and clear the PC from the guards "seen" list after a certain delay. As soon as you clear the PC from the list I imagine the guard would probably get another perception check... but that would have to be verified.
AOE cant be that shape afaikGet object in shape?
Is it possible to create a cone shaped AOE on the NPC guard?
hmm this might work, will think about it though the pseudo hb doesnt sound that bad to me nowTriggers? grid of AOE's?
Is this for specific areas that these particular guards are in? If so you could lay down a bunch of triggers along the guards' route and into which the guards would see if a PC enters them. On each on enter or on exit event you can tag the pc as being in that zone and run an artificial perception event with nearby guards
#9
Posté 04 juillet 2013 - 11:21
yea that was my first thought too, but then realized the hide skill is quite weird for this so i reworked it so guards have true seeing and simply ignores pc if he stands in shadow triggerkamal_ wrote...
I made a thief campaign for nwn2 (Crimmor, in signature) that did shadow based triggers to do hide bonuses for the pc.
yet this method has big flaw of that onperception event doesnt fire later since they already seen you, so it must be paired with pseudohb or triffer exit or pc will be able to run around guard without problems
the biggest problem is however to paint shadows where toolset doesnt make them and to change built in interior light source state, im open to custom content but what i would need is no small project
#10
Posté 07 juillet 2013 - 10:57
A cast shadows (opposite of the cast sun lights like in forest tileset) placeable would be best if anyone seen something like that already
#11
Posté 08 juillet 2013 - 10:31
//**** Original work by virusman ****
const int VISIBILITY_TYPE_DEFAULT = 0;
const int VISIBILITY_TYPE_VISIBLE = 1;
const int VISIBILITY_TYPE_INVISIBLE = 2;
// Sets the visibility of oObject for everybody
void NWNXFuncs_SetVisibilityOverride(object oObject, int nVisibilityType);
// Sets whether oObject2 can see oObject1
void NWNXFuncs_SetVisibility(object oObject1, object oObject2, int nVisibility);
// Gets the visibility of oObject
int NWNXFuncs_GetVisibilityOverride(object oObject);
// Gets whether oObject2 can see oObject1
int NWNXFuncs_GetVisibility(object oObject1, object oObject2);
//**************************************
There's also an anti-light vfx that might work for you, I think it might have been in cep, I know I've used it before.
#12
Posté 20 juillet 2013 - 05:48
can you tell me number? checked whole cep2.4 and there is nothing like that, i mean yes there is PRCVFX_DUR_SHADOWS_ANTILIGHT but thats black shield around character, i want to simulate shadows in areaThere's also an anti-light vfx that might work for you, I think it might have been in cep, I know I've used it before.





Retour en haut







