[Search] [FAQ] [Register] [Login] [Usergroups] [Members] [Rules]
[Terra Arcanum] [Forums] [Gallery] [Downloads] [Troikapedia] [Arcanum Wikia] [Troika Games]
 
Support Terra
Arcanum:
Good Old Games
 
 


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 PostPosted: Wed May 30, 2012 11:50 pm Post subject:  Npcs talking to each other and starting dialogue question
 
Expert
User avatar

Joined: Dec 28, 2011
Posts: 65
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)


Top
 Profile  
 PostPosted: Thu May 31, 2012 4:25 am Post subject: 
 
Master

Joined: Nov 28, 2007
Posts: 205
Location: Not where you'd think
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.


Top
 Profile  
 PostPosted: Thu May 31, 2012 5:37 am Post subject: 
 
Master
User avatar

Joined: Jun 13, 2011
Posts: 161
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.

_________________
"Violence is glamor, i'm glamorous"


Top
 Profile  
 PostPosted: Thu May 31, 2012 10:33 am Post subject: 
 
Expert
User avatar

Joined: Jun 19, 2011
Posts: 90
Location: Marseille, France
Wims wrote:
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.


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)

Wims wrote:
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)


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.

_________________
"Pray for the children you lost along the way
Still remember the names and faces…
Cold and abandoned they cry, their fate put in your hands.
When it’s over they come to haunt you…"


Top
 Profile  
 PostPosted: Fri Jun 01, 2012 4:41 pm Post subject: 
 
Expert
User avatar

Joined: Dec 28, 2011
Posts: 65
Alright cool thanks guys! Ill try and get it to work in a bit =)


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group