Skip to content

npcs start looking to the left for no reason

sarevok57sarevok57 Member Posts: 6,002
so for my NPCs i have them standing in place and have scripts set on heartbeat and on spawn to look at a certain object ( a waypoint )

once the player character spawns in, all is good, but then after a couple of rounds or so, then EVERY NPC starts looking towards the left

what gives? i'm not telling them to do that, plus there is nothing tagged over there for them to even look in that direction so i have no clue why it's doing this

Comments

  • ForSeriousForSerious Member Posts: 466
    May we have a look at the script?
    I tried to make a script to do this on my own, and I'm not sure how it would be done. The only options I'm seeing are: ANIMATION_FIREFORGET_HEAD_TURN_LEFT, ANIMATION_FIREFORGET_HEAD_TURN_RIGHT and ANIMATION_LOOPING_LOOK_FAR.
  • ZephiriusZephirius Member Posts: 419
    Is your player character to the left? I think if you get close enough they will automatically train their gaze on you.
  • sarevok57sarevok57 Member Posts: 6,002
    the script i am using is this;

    void main()
    {
    // If running the lowest AI, abort for performance reasons.
    if ( GetAILevel() == AI_LEVEL_VERY_LOW )
    return;

    // If busy with combat or conversation, skip this heartbeat.
    if ( IsInConversation(OBJECT_SELF) || GetIsInCombat() )
    return;



    // Have us perform a sequence of actions.
    ActionDoCommand(SetFacingPoint(GetPosition(GetNearestObjectByTag("goliron001"))));
    }


    with "goliron001" being changed for each way point they are supposed to look at or i suppose "face" would be the better term

    now in the screenshots im about to show, when i come into the area they are doing as they are supposed to do, but then "x" amount of rounds later, they all face to the east for no reason so why is this? in fact ALL of the NPCs in the area are doing this

    v0b21thqu9uf.jpg
    f89pn3okwjfi.jpg

  • ForSeriousForSerious Member Posts: 466
    Where's the object with the tag goliron001? I tried the script on a bunch of creatures, and I put two objects with the tag goliron001. They turned and looked to the object with the tag nearest them.
    I deleted the the objects with the tag and tried again, and the creatures all turned and faced southwest-ish.
  • sarevok57sarevok57 Member Posts: 6,002
    so i found out what the problem was; it was way points

    i had it set so if these golems were to wonder off, then they would come back to their way points

    but apparently even if you script a creature to face a certain way, if they have a way point, then they will ALWAYS face east once they hit their way point

    so what i had to do was instead of giving them way points was tell them to go to location "x" first, then face towards location "y" and now it is working 100% as i wanted in the first place
  • ZephiriusZephirius Member Posts: 419
    Nice job. I love it when a plan comes together!
Sign In or Register to comment.