Aller au contenu

Photo

assassins hunting down PC


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
Batmanis64

Batmanis64
  • Members
  • 84 messages
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?

#2
kamal_

kamal_
  • Members
  • 5 258 messages
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
Dann-J

Dann-J
  • Members
  • 3 161 messages
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).

#4
M. Rieder

M. Rieder
  • Members
  • 2 530 messages

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
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
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.

#6
Batmanis64

Batmanis64
  • Members
  • 84 messages
Thanks GhostOfGod, your script worked perfectly!