Messenger script?

+
Messenger script?

In the main game, there are a couple of occasions when a messenger finds you wherever you are - in Chapter Two Raymond Marlouve sends a child to find you, and in Chapter Three a child messenger tells you that Velerad wants you to help resolve the bank breakin.Does anyone have a script I can fire which will do that - i.e. move a specific character to the player's location, and have it initiate conversation?
 
#include "inc_dialog"void main() { TeleportAndTalk(GetObjectByTag("messenger_tag_here"));}Don't forget to despawn/destroy the messenger later, so that they don't loiter around unnecesarily.-- Sinus
 
Ailinon said:
#include "inc_dialog"void main() { TeleportAndTalk(GetObjectByTag("messenger_tag_here"));}Don't forget to despawn/destroy the messenger later, so that they don't loiter around unnecesarily.-- Sinus
Thanks, that looks like exactly what I need. Modified to add: Yes, that works brilliantly, thanks. For the benefit of anyone who's trying to do the same thing, the final script I used is as follows:
Code:
// If Geralt didn't take Friend To Watch Over Her, then// at the appropriate time for We Can't Go On Meeting// Like This he needs to be told... we'll leave it an hour// because he might get there by himself.void MaybeInitialiseWCGOMLT() {	int iHour = GetTimeHour();		if ( iHour == 19 &&		! HasJournalEntry( "Plot", "plot/ftwoh") &&		! HasJournalEntry( "Character", "hela/3") &&		! HasJournalEntry( "Plot", "plot/wcgomlt") &&		! HasJournalEntry( "Character", "hela/missing")) {		PrintString( "Instructing Martyna to call Geralt to WCGOMLT"); 				object oMartyna = GetObjectByTag( martTag);		TeleportAndTalk( oMartyna, "bv_dlg_martwcg");		AddJournalEntry( "Character", "hela/missing");	}}
On each of its terminal nodes the dialog 'bv_dlg_martwcg' calls a script 'bv_mart_despawn', as follows:
Code:
//////////////////////////////////////////////////////////////////////////	bv_mart_despawn.nss// 	Forcibly despawn Martyna////	(c) 2008 The Medusa Collective////////////////////////////////////////////////////////////////////////#include "inc_bv_phases"void main(){	object oMartyna = GetObjectByTag( martTag);	DespawnCreature(oMartyna);}
This has the added benefit that Martyna goes directly to her despawn point at the end of the conversation, and by putting the despawn point close to the action we want Geralt to deal with I can lead him right there.
 
Sorry for the possible stupid question, but why don't you use the inverted commas for martTag? What's the trick, is it something in inc_bv_phases?At least I learn something more..bye
 
nandusso said:
Sorry for the possible stupid question, but why don't you use the inverted commas for martTag? What's the trick, is it something in inc_bv_phases?At least I learn something more..bye
Because we have the tags for all our characters defined in an include file, thus:
Code:
string helaTag = "bv_npct_hela";string szczTag = "bv_npct_szczepan";string agnTag = "bv_npct_agnieszka";string barnTag = "bv_npct_barnabas";string josTag = "bv_npct_josef";string martTag = "bv_npct_martyna";string revTag = "bv_npct_reverend";string gutkTag = "bv_npct_gutka";string rozTag = "bv_npct_rozalia";string agnsTag = "bv_npct_agn_s";string gutsTag = "bv_npct_gut_s";string revsTag = "bv_npct_rev_s";string szsTag = "bv_npct_sz_s";
The reason for this is simple software engineering - it saves mistakes. If you mistype a variable name you get a compiler error, so you know you have a mistake and can fix it; if you mistype a string then the thing just mysteriously doesn't work, and that's hard to track down.
 
Simon, and others who help: a big thanks! Simon and the administrator of the site: there's planty other topics like this one that are really helpfull, but it become very difficult to find them. could it be possible to add something like [Script] in the beginning of the topic's name? so everyone can easily track a [script] messenger?:)
 
Top Bottom