Jump to content

Trigger deactivated


Red Carnelian

Recommended Posts

Is there a way to detect the state of a travel trigger when entering an area through scripting? I have a travel trigger in which I want to check the state of the 'trigger deactivated' flag. It seems straight forward but I can't seem to find a suitable trigger.

Normally travel triggers are deactivated and re-activated through the respective area script. In most cases it will be best to evaluate with your own script the global (or area local) that provides the status change.

Example (From AR7253" BG1 (AR0153, BG0153).bcs = E Baldur's Gate: Thieves' Guild

IF

Global("DukeThanks","GLOBAL",0)

Global("InactiveDoor","GLOBAL",0)

THEN

RESPONSE #100

SetGlobal("InactiveDoor","GLOBAL",1)

TriggerActivation("Door0146",FALSE)

END

 

Here the door to the Sarevok Undercity in Baldur's Gate Shadow Thieves building is de-activated until the final chase.

 

Later in the game

IF

Global("DukeThanks","GLOBAL",1)

!Exists("DENKOD")

!Dead("DENKOD")

!Dead("blacklily")

THEN

RESPONSE #100

CreateCreature("DENKOD",[881.430],S) // Denkod

TriggerActivation("Door0146",TRUE)

END

makes the door available. So, you can just check for the respective Global("DukeThanks","GLOBAL",1) to know what the trigger would be like.

 

Most travel triggers even have a local (area specific) value that changes with the status change.

Link to comment

When I've created the travel trigger using Weidu code I've set the flag so the travel trigger is disabled by default. If I set something like this below in my area script then the second if statement will always be executing the TriggerActivation action.

 

//This works

IF
GlobalLT("CearwinQuest","GLOBAL",2)
Global("CaveDoorInActive","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("CaveDoorInActive","GLOBAL",1)
TriggerActivation("DoorS001",FALSE)
END

IF
GlobalGT("CearwinQuest","GLOBAL",1)

THEN
RESPONSE #100
TriggerActivation("DoorS001",TRUE)
END

 

However trying something like this below for the second if statement. First time in the area it activates the door but if I leave the area and then return the global variable having been set to 1 fails to activate the travel trigger which then assumes the default state of being deactivated. Initially I thought it would retain the most recent state but it doesn't. I have a solution but it doesn't feel right. I would like to be able to check the state of the trigger itself. Any suggestions? or I'm I digging a hole for myself?

 

//Something I've been trying but doesn't work

IF
GlobalGT("CearwinQuest","GLOBAL",1)

Global("AnotherDoor","GLOBAL",0)

THEN
RESPONSE #100

SetGlobal("AnotherDoor","GLOBAL",1)
TriggerActivation("DoorS001",TRUE)
END

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...