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