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

Is there a script that...

+
N

Nevada

Senior user
#1
Sep 2, 2008
Is there a script that...

Hello!I'm currently starting to mod and in the entry qest, the player has to kill an enemy.I want to enable a global flag after that enemy is dead, but at first, I need to know the variable.I think it will work a "if" script, like this:if(CharacterIsDead("bandit_boss", 1));{SetDialogFlagValue("quest_solved", 1); }But the "CharacterIsDead" variable doesn't exist, but how can i tell a script that a certain character shall be dead?
 
A

ailinon

Senior user
#2
Sep 2, 2008
"That's not how you should do it at all", my favourite line. :)"When a character is dead" should be placed in the quest's conditions, in some phase - so that you'll have:1. Quest beginning: condition "Dialogue line" "Okay, I'll go kill the bandit"2. Phase 1: condition "Character is dead" = "bandit_boss#1" - and here, if you absolutely need it, you can add an "On phase complete" action - "set dialog flag".3. (probably) Phase 2: condition "Dialogue line" "I killed the boss, now pay me"-- Sinus
 
N

Nevada

Senior user
#3
Sep 3, 2008
yes, i got that all. i just don't get the flag switched via script, as the script that changes the flag just won't start...
 
A

ailinon

Senior user
#4
Sep 3, 2008
Well, how exactly is your questfile built? What phases do you have, what conditions on them, what "on completed" actions? Where is the script attached?
 
N

nandusso

Senior user
#5
Sep 5, 2008
You can set the "script set" field of your enemy NPC's template to "custom" and then put the name of all the default scripts (def_onatkbegin, def_onblocked, etc...) except for def_ondeath. You can modify this script (rename it for example: bob_ondeath, and save) adding the command you want: SetDialogFlagValue("bob_dead", TRUE);orAddJournalEntry("Plot","etc, etc...");bye
 
R

ralf1731

Senior user
#6
Sep 25, 2008
void main() {
 
A

ailinon

Senior user
#7
Sep 25, 2008
It should work, just as you said. Doesn't it?
 
R

ralf1731

Senior user
#8
Sep 26, 2008
@Ailinon It should work, just as you said. Doesn't it?
Click to expand...
Test it yesterdayBoth options work...
 
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.