Forums
Games
Cyberpunk 2077 Thronebreaker: The Witcher Tales GWENT®: The Witcher Card Game The Witcher 3: Wild Hunt The Witcher 2: Assassins of Kings The Witcher The Witcher Adventure Game
Jobs Store Support Log in Register
Forums - CD PROJEKT RED
Menu
Forums - CD PROJEKT RED
  • Hot Topics
  • NEWS
  • GENERAL
    THE WITCHER ADVENTURE GAME
  • STORY
    THE WITCHER THE WITCHER 2 THE WITCHER 3 THE WITCHER TALES
  • GAMEPLAY
    THE WITCHER THE WITCHER 2 THE WITCHER 3 MODS (THE WITCHER) MODS (THE WITCHER 2) MODS (THE WITCHER 3)
  • TECHNICAL
    THE WITCHER THE WITCHER 2 (PC) THE WITCHER 2 (XBOX) THE WITCHER 3 (PC) THE WITCHER 3 (PLAYSTATION) THE WITCHER 3 (XBOX) THE WITCHER 3 (SWITCH)
  • COMMUNITY
    FAN ART (THE WITCHER UNIVERSE) FAN ART (CYBERPUNK UNIVERSE) OTHER GAMES
  • RED Tracker
    The Witcher Series Cyberpunk GWENT
THE WITCHER
THE WITCHER 2
THE WITCHER 3
MODS (THE WITCHER)
MODS (THE WITCHER 2)
MODS (THE WITCHER 3)
Menu

Register

Messenger script?

+
U

username_2075278

Senior user
#1
Sep 8, 2008
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?
 
A

ailinon

Senior user
#2
Sep 9, 2008
#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
 
U

username_2075278

Senior user
#3
Sep 9, 2008
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
Click to expand...
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.
 
N

nandusso

Senior user
#4
Sep 9, 2008
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
 
U

username_2075278

Senior user
#5
Sep 9, 2008
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
Click to expand...
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.
 
J

jbaudrand

Senior user
#6
Sep 11, 2008
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?:)
 
A

ailinon

Senior user
#7
Sep 11, 2008
Searching for "script" is useful too :)
 
Share:
Facebook Twitter Reddit Pinterest Tumblr WhatsApp Email Link
  • English
    English Polski (Polish) Deutsch (German) Русский (Russian) Français (French) Português brasileiro (Brazilian Portuguese) Italiano (Italian) 日本語 (Japanese) Español (Spanish)

STAY CONNECTED

Facebook Twitter YouTube
CDProjekt RED Mature 17+
  • Contact administration
  • User agreement
  • Privacy policy
  • Cookie policy
  • Press Center
© 2018 CD PROJEKT S.A. ALL RIGHTS RESERVED

The Witcher® is a trademark of CD PROJEKT S. A. The Witcher game © CD PROJEKT S. A. All rights reserved. The Witcher game is based on the prose of Andrzej Sapkowski. All other copyrights and trademarks are the property of their respective owners.

Forum software by XenForo® © 2010-2020 XenForo Ltd.