Npcs talking to each other and starting dialogue question

Discussion in 'Modding and Scripting Support' started by Chaoswizard98, May 30, 2012.

Remove all ads!
Support Terra-Arcanum:

GOG.com

PayPal - The safer, easier way to pay online!
  1. Chaoswizard98

    Chaoswizard98 Member

    Messages:
    82
    Likes Received:
    0
    Joined:
    Dec 28, 2011
    I have 2 questions.
    1. how do you make npcs talk to each other (such as virgil talking to magnus)

    2. How do you make an npc run up and open dialogue with the player (like the hand member at the crash site)
     
  2. The Pigeon

    The Pigeon Member

    Messages:
    305
    Likes Received:
    5
    Joined:
    Nov 28, 2007
    Just a quick thought;

    In the talk between Virgil and the assassin, you advance the dialogue via a conversation option (something like [Let Virgil Keep Talking]).

    For movement, there are waypoints (I'm not sure how to script moving from one to another though) and the talking to player happens when the player enters a certain radius of the assassin.
     
  3. Wims

    Wims New Member

    Messages:
    161
    Likes Received:
    0
    Joined:
    Jun 13, 2011
    1. Actually, when two characters talk to each others, the script make each of the character talks to the player. Each time the player use "next" as a dialog, you just have to call the other player's dlg script at the right line.

    2. Make you NPC run with the "have (obj run to X: Y:). Then a script at HEARTBEAT point. If (obj) is within (num) tiles of (X: Y:) CALL (dlg script)

    It's the short version of the scripting. If don't know what I'm talking about, I'll give you the complete one.
     
  4. Nataku

    Nataku Member

    Messages:
    243
    Likes Received:
    1
    Joined:
    Jun 19, 2011
    You need a dialog line with a negatif return (exemple : -2), it will activate the dialogue script at the line. Then, you need in your script :
    2.Loop for (any npc in vicinity). (To do that, each of your npc must have an internal then you write)
    3.If (Current loop object) is named (num) (the npc's internal)
    THEN Call script attached to current loop object at num (9) (9 is for dialog script) at line (num) with trigger (player).
    ELSE Do nothing
    4.Loop end
    5. Return and SKIP default (You need a SKIP default because your are in a dialogue script)

    Actually, the best heartbeat script to do it is :
    0. Get location of (player) and store it in X(local 0) Y(local1)
    1. Distance between (player) and (attachee) store in (local2)
    2. If (local2) inferior or equal ZZZ (I prefer use 3 or 5 here)
    THEN Remove this script
    ELSE Go to line 5
    3.Call script attached to (attachee) at point 9 at line Z with trigger (player)
    4.Return and RUN default
    5. Have critter(attachee) run to X(local0), Y(local1)
    6.Return and RUN default

    With that script, the npc will run in direction to the player, even the player is moving and when it will be at least than ZZZ (3 or 5) tiles, he will talk to him/her.
     
  5. Chaoswizard98

    Chaoswizard98 Member

    Messages:
    82
    Likes Received:
    0
    Joined:
    Dec 28, 2011
    Alright cool thanks guys! Ill try and get it to work in a bit =)
     
Our Host!