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

Drinking script

+
N

nayava

Senior user
#1
Oct 31, 2008
Drinking script

In my module I often have the following Situation.Geralt talks to someone. Then the conversation view ends, Geralt and the npc he is talking to drink and the conversation continues. I tried the script from shani's party. But Geralt just gets drunk. So I tried making an own script.void main(){ object OPC = GetFirstPC(); object OCHARACTER = GetObjectByTag("..."); ActionPauseConversation(); AssignCommand(OPC, PlayAnimation(113, 1.0)); AssignCommand(OCHARACTER, PlayAnimation(113, 1.0)); SetCurrentDrunkState(GetCurrentDrunkState(OCHARACTER)+10, OCHARACTER); SetCurrentDrunkState(GetCurrentDrunkState(OPC)+10, OPC); ActionResumeConversation();}But this do not work too. So could someone give or make me a working script?
 
G

Gamewidow

Forum veteran
#2
Nov 1, 2008
I gave Simon a nudge to look at your file :) ... hopefully he can spot the problemapparently you need to use ClearAllActions() before you use ActionPauseConversation() to clear the event queue ... that's all i can seeEdit: hubby mentioned that it's also possible that the initial value of the "drunk state" is not what you think it is and that adding 10 to it may not be achieving what you think it does ... you could add some code to print out what the value is before you change it.
 
U

username_2075278

Senior user
#3
Nov 1, 2008
NayAva said:
In my module I often have the following Situation.Geralt talks to someone. Then the conversation view ends, Geralt and the npc he is talking to drink and the conversation continues. I tried the script from shani's party. But Geralt just gets drunk. So I tried making an own script.void main(){ object OPC = GetFirstPC(); object OCHARACTER = GetObjectByTag("..."); ActionPauseConversation(); AssignCommand(OPC, PlayAnimation(113, 1.0)); AssignCommand(OCHARACTER, PlayAnimation(113, 1.0)); SetCurrentDrunkState(GetCurrentDrunkState(OCHARACTER)+10, OCHARACTER); SetCurrentDrunkState(GetCurrentDrunkState(OPC)+10, OPC); ActionResumeConversation();}But this do not work too. So could someone give or make me a working script?
Click to expand...
OK, I haven't done anything like this. But what I have done is action scripts which run when a conversation ends, which start a new conversation. What I'd be inclined to do is: have the thing that Geralt or the NPC says immediately before they drink a terminal node, obviously with an action script on it, and then
Code:
void main(){	object OPC = GetFirstPC();	object OCHARACTER = GetObjectByTag("character_tag");		AssignCommand(OPC, PlayAnimation(113, 1.0));	AssignCommand(OCHARACTER, PlayAnimation(113, 1.0));		SetCurrentDrunkState(GetCurrentDrunkState(OCHARACTER)+10, OCHARACTER);	SetCurrentDrunkState(GetCurrentDrunkState(OPC)+10, OPC);		DelayCommand( 5.0f, AssignCommand( OCHARACTER, ActionStartConversation( OPC, "", FALSE)));}
I have tested this, it works for me here. The key point is to delay the re-entry into the conversation until the animation has had a chance to play, so your PauseConversation()... ResumeConversation(0 might also work provided you wrap a DelayCommand() around the resume. If you do it my way - ending and restarting the conversation - then obviously you will need to set a dialogue flag, and test for it on re-entry, so that the conversation flows smoothly.On stylistic points, it's often conventional to use all upper case characters for constant names rather than for variable names, and to use a lowercase letter for at least the initial letter of variable names, with the rest either all lowers or camel case. What you are doing is not wrong, but you will probably find it easier to communicate with other programmers if you had
Code:
void main(){	object oPlayer = GetFirstPC();	object oCharacter = GetObjectByTag("character_tag");		AssignCommand(oPlayer , PlayAnimation(113, 1.0));	AssignCommand(oCharacter , PlayAnimation(113, 1.0));		SetCurrentDrunkState(GetCurrentDrunkState(oCharacter )+10, oCharacter );	SetCurrentDrunkState(GetCurrentDrunkState(oPlayer )+10, oPlayer );		DelayCommand( 5.0f, AssignCommand( oCharacter , ActionStartConversation( oPlayer , "", FALSE)));}
 
N

nayava

Senior user
#4
Nov 1, 2008
It works partial. The npc does not drink when he is walking to the next action point during the conversation break. Geralt also stops drinking, when he walk during this break.
 
U

username_2075278

Senior user
#5
Nov 1, 2008
NayAva said:
It works partial. The npc does not drink when he is walking to the next action point during the conversation break. Geralt also stops drinking, when he walk during this break.
Click to expand...
Could you post the mod somewhere I could download it, and give me a walkthrough path which takes me to the bit that's going wrong?
 
N

nayava

Senior user
#6
Nov 1, 2008
No. ^^Uploading this huge mod just because of this tiny script, for that I need just one little command that avoids Geralt and Zoltan from moving for 3 seconds?I will not show my mod to anyone except my translator till it is finished.
 
R

ralf1731

Senior user
#7
Nov 1, 2008
It is only a guess (like all i write here
 
N

nayava

Senior user
#8
Nov 1, 2008
At the moment I use this script. It works great, except that Geralt can still walk, when he should drink.#include "inc_dialog"void main(){ object OPC = GetFirstPC(); object OCHARACTER = GetObjectByTag("c217"); AssignCommand (OPC, ClearAllActions(1)); AssignCommand (OCHARACTER, ClearAllActions(1)); AssignCommand(OPC, ActionWait(3.0)); AssignCommand(OCHARACTER, ActionWait(3.0)); AssignCommand(OPC, PlayAnimation(113, 2.0)); AssignCommand(OCHARACTER, PlayAnimation(113, 2.0)); SetCurrentDrunkState(GetCurrentDrunkState(OPC)+10, OPC ); SetCurrentDrunkState(GetCurrentDrunkState(OCHARACTER)+10, OCHARACTER ); DelayCommand(2.0, TeleportAndTalk(OCHARACTER));}
 
K

Kageru

Senior user
#9
Nov 2, 2008
Try to set Cutscene mode, it should paralyze Geralt.#include "inc_dialog"void main(){ object OPC = GetFirstPC(); object OCHARACTER = GetObjectByTag("c217"); SetCutsceneMode(OPC, TRUE); AssignCommand (OPC, ClearAllActions(1)); AssignCommand (OCHARACTER, ClearAllActions(1)); AssignCommand(OPC, ActionWait(3.0)); AssignCommand(OCHARACTER, ActionWait(3.0)); AssignCommand(OPC, PlayAnimation(113, 2.0)); AssignCommand(OCHARACTER, PlayAnimation(113, 2.0)); SetCurrentDrunkState(GetCurrentDrunkState(OPC)+10, OPC ); SetCurrentDrunkState(GetCurrentDrunkState(OCHARACTER)+10, OCHARACTER ); DelayCommand(2.0, SetCutsceneMode(OPC, FALSE)); DelayCommand(2.0, TeleportAndTalk(OCHARACTER));}
 
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.