Throughout my mod, I have assassins spawn at specified points and specified times. I want these assassins to enter stealth mode and hunt down a specific character in my party, wherever we are (their speed facter will be much faster than normal). What's the most efficient way to script this? There are a couple of problems to consider: 1) The assassin should probably NOT be hostile, as they might decide to hack at some villagers on the way, and 2) would ActionMoveToLocation keep updating based my party's movement?
assassins hunting down PC
Débuté par
Batmanis64
, févr. 21 2011 01:30
#1
Posté 21 février 2011 - 01:30
#2
Posté 21 février 2011 - 01:38
Uncle FB's npc control system from the Vault includes an assassin by default. Setting the assassin to hunt a pc instead of another npc shouldn't be too much trouble.
#3
Posté 21 février 2011 - 09:29
You could give the assassin a custom faction, which is hostile to the PC (and therefore all companions) but not to other factions. Then they'll leave other people alone. You might also have to create a custom 'commoner' faction to prevent them from attacking the assassin.
There is an OnSpawn flag that supposedly puts a creature into stealth mode if it has some rogue levels, but I haven't had much luck getting it to work (at least, not with encounter-spawned creatures).
There is an OnSpawn flag that supposedly puts a creature into stealth mode if it has some rogue levels, but I haven't had much luck getting it to work (at least, not with encounter-spawned creatures).
#4
Posté 22 février 2011 - 03:16
Batmanis64 wrote...
...2) would ActionMoveToLocation keep updating based my party's movement?
ForceFollowObject() would probably be a better function to use. That way you don't have to keep updating the location.
This sounds like a neat idea. Best of luck getting it going!
#5
Posté 22 février 2011 - 08:41
Offf the top of my head you could do something like this maybe:
Assassin's OnSpawn:
void main()
{
SetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH, TRUE);
//ExecuteScript("your default spawn", OBJECT_SELF);
}
Assassin's OnHeartbeat:
#include "NW_I0_GENERIC"
void main()
{
if (!GetIsInCombat(OBJECT_SELF))
}
//however you want/need to define oTarget
object oTarget = GetObjectByTag("blah blah blah");
float fDistance = GetDistanceBetween(oTarget, OBJECT_SELF);
if (fDistance <= 1)
{
DetermineCombatRound(oTarget);
}
else
{
ActionMoveToObject(oTarget, FALSE, 0.5);
}
}
}
Would need a bit more information on how specifically this would work but hope this at least gets things moving in your direction. Good luck.
Assassin's OnSpawn:
void main()
{
SetActionMode(OBJECT_SELF, ACTION_MODE_STEALTH, TRUE);
//ExecuteScript("your default spawn", OBJECT_SELF);
}
Assassin's OnHeartbeat:
#include "NW_I0_GENERIC"
void main()
{
if (!GetIsInCombat(OBJECT_SELF))
}
//however you want/need to define oTarget
object oTarget = GetObjectByTag("blah blah blah");
float fDistance = GetDistanceBetween(oTarget, OBJECT_SELF);
if (fDistance <= 1)
{
DetermineCombatRound(oTarget);
}
else
{
ActionMoveToObject(oTarget, FALSE, 0.5);
}
}
}
Would need a bit more information on how specifically this would work but hope this at least gets things moving in your direction. Good luck.
#6
Posté 09 mars 2011 - 03:14
Thanks GhostOfGod, your script worked perfectly!





Retour en haut






