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

Disable/Enable Scripts

+
E

Evolution101

Senior user
#1
Dec 15, 2008
Disable/Enable Scripts

I've got a script that triggers when you try to open a specific door, but I want to turn it off once a certain condition is met. I'm unsure of how to disable the "On Use" script I have there, does anyone have any ideas? Is there something like GetScript?
 
N

nayava

Senior user
#2
Dec 15, 2008
You could use a variable as condition and change it after the the script has run first.I belief it should look like that...if (!GetLocalInt(OPC,"variable name")) { Commands, that should just work once. SetLocalInt(OPC,"variable name",1);}I also but int variable name; in the first module loaded script.
 
E

Evolution101

Senior user
#3
Dec 16, 2008
Sorry you might have to hold my hand a little here, my knowledge of NWN / Witcher scripting is quite limited. How do you define a variable?
 
G

Gamewidow

Forum veteran
#4
Dec 16, 2008
at the top of your script, but after any include statements ... add something like this: object oPC = GetFirstPC(); string commentedonflag = "actual text string here";those are 2 variables oPC and commentedonflagdoes that help ?then you can use those later within your code to either compare stuff or trigger things, whatever :peace:
 
N

nandusso

Senior user
#5
Dec 17, 2008
@ evolutionHave you solved? If no, can you tell what is the condition that should be met?( a dialog line, an hour, an event in game, etc...)bye
 
E

Evolution101

Senior user
#6
Dec 17, 2008
Been playing with this a bit but no luck exactly, it's not a critical piece of the module but I'd like to get it in if I can :)I've just got a trigger right now with a script set to run when you enter the trigger.SetLocked(GetObjectByTag("inn_door"),FALSE);This is the only line I have there, which plainly unlocks the door, but I'd like to include some kind of IF -> THEN criteria for it, based on if a specific quest gets completed. Thanks for the assistance so far :witchmas:
 
N

nandusso

Senior user
#7
Dec 18, 2008
So, if you have set a quest you can put a script, that locks or unlocks the door, in the field "OnPhaseCompletedAction" of the last phase (QuestCompleted) of the quest. And the trigger is not necessary.bye
 
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.