Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#559876 15/12/14 07:36 AM
Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
Any idea why I'm getting errors with the following script? I tried adding AND and changing around the parentheses but nothing seemed to help. This script gives the error message [syntax error: "DialogStartTwoSpeakerDialog" unexpected.

IF
ItemAddedToCharacter(ITEM_Artifact,CHARACTER_Player1)
THEN
TimerLaunch("GodwinLeave", 10000);

IF
TimerFinished("GodwinLeave")
THEN
CharacterTeleportToTrigger(CHARACTER_Godwin1,TRIGGER_GodwinAppearLocation,"")
DialogStartTwoSpeakerDialog("GodwinAngry",CHARACTER_Godwin1,_Player);

Joined: Jul 2014
R
addict
Offline
addict
R
Joined: Jul 2014
You're missing a semicolon at the end of the teleport line.

Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
The error message I receive now is [parameter 3 is an unbound variable]

Joined: Oct 2014
B
enthusiast
Offline
enthusiast
B
Joined: Oct 2014
Originally Posted by JecklynHyde
IF
TimerFinished("GodwinLeave")
THEN
CharacterTeleportToTrigger(CHARACTER_Godwin1,TRIGGER_GodwinAppearLocation,"")
DialogStartTwoSpeakerDialog("GodwinAngry",CHARACTER_Godwin1,_Player);


You can't use _Player in this case, because the object _Player is not used in the IF line. _Player is undefined in this script.

Change it to _Player1 or _Player2 OR you can add an additional IF statement to define _Player.


Joined: Jul 2014
R
addict
Offline
addict
R
Joined: Jul 2014
I think it would have to be CHARACTER_Player1 or CHARACTER_Player2 if you're specifying which character it is.

If you don't care which character it is, then it could go like this:

Code
IF
ItemAddedToCharacter(ITEM_Artifact, _Player)
AND
NOT DB_GodwinFinished(1)
THEN
DB_Godwin(_Player);
TimerLaunch("GodwinLeave", 10000);

IF
TimerFinished("GodwinLeave")
AND
DB_Godwin(_Player)
THEN
CharacterTeleportToTrigger(CHARACTER_Godwin1,TRIGGER_GodwinAppearLocation,"");
DialogStartTwoSpeakerDialog("GodwinAngry",CHARACTER_Godwin1, _Player);
DB_GodwinFinished(1);

Last edited by Rhidian; 15/12/14 04:53 PM.
Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
I used Rhidan's script because I want the script to fire for both P1 and P2 and it worked, thanks both! smile

Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
Using an old post for some troublesome new scripts:

#1. I want to change the atmosphere from rainy back to the default sunny one:
Call: TriggerSetAtmosphere((STRING)_TriggerUUID,(STRING)_Atmosphere)
Mine: TriggerSetAtmosphere("","default");

#2. I want my characters to face the player during dialog.
Call: CharacterLookAtCharacter((CHARACTER)_Character, (CHARACTER)_TargetCharacter, (INTEGER)_SnapToTarget)
Mine: CharacterLookAtCharacter(CHARACTER_Conrad, CHARACTER_Player1, 1);

#3. I want my Companion to have the crafting skill
Call: CharacterAddTalent((CHARACTER)_Character, (STRING)_Talent);
Mine: CharacterAddTalent(CHARACTER_Rogue, "Crafting");

Joined: Oct 2014
B
enthusiast
Offline
enthusiast
B
Joined: Oct 2014
Are you getting errors or are they just not working?

I see a few issues:

Call: TriggerSetAtmosphere((STRING)_TriggerUUID,(STRING)_Atmosphere)
Mine: TriggerSetAtmosphere("","default");

TriggerSetAtmosphere is used to set the atmosphere settings of an atmosphere trigger. It doesn't set an overall general atmosphere, it changes the settings of an atmosphere trigger. You're not referencing a trigger ("") so it's not going to do anything.

-------------

Call: CharacterLookAtCharacter((CHARACTER)_Character, (CHARACTER)_TargetCharacter, (INTEGER)_SnapToTarget)
Mine: CharacterLookAtCharacter(CHARACTER_Conrad, CHARACTER_Player1, 1);

Not sure, never used it. If it's not working it's probably something to do with the integer. Try playing with it.

----------------

Call: CharacterAddTalent((CHARACTER)_Character, (STRING)_Talent);
Mine: CharacterAddTalent(CHARACTER_Rogue, "Crafting");

I think you want to be adding an Ability, not a talent.

Try CharacterAddAbility

Last edited by Burgee; 07/01/15 02:53 AM.
Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
Script #1 didn't produce an error but it also didn't change the atmosphere. I received an error (object "TRIGGER_AtmosphereTyphoon is not defined) when I changed it to:

IF
TimerFinished("CrystalReturned")
THEN
TriggerSetAtmosphere(TRIGGER_AtmosphereTyphoon, "default");

What's the difference between (String)_Event and (STRING)_TriggerUUID?

On the Triggers side bar I noticed there is a "GUID" so I'm going to test that next.

_____________________
Still stuck with #2
_____________________

#3 works now! laugh


Last edited by JecklynHyde; 07/01/15 05:53 AM.
Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
For me "TriggerSetAtmosphere" never worked because if I recall there was a problem with making atmosphere triggers global or something like that (which kind of looks like the problem you're having with the atmosphere not being defined). Not sure if someone's gotten it to work, though maybe Burgee has.

Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Originally Posted by JecklynHyde
Script #1 didn't produce an error but it also didn't change the atmosphere. I received an error (object "TRIGGER_AtmosphereTyphoon is not defined) when I changed it to:

IF
TimerFinished("CrystalReturned")
THEN
TriggerSetAtmosphere(TRIGGER_AtmosphereTyphoon, "default");

What's the difference between (String)_Event and (STRING)_TriggerUUID?

On the Triggers side bar I noticed there is a "GUID" so I'm going to test that next.


Yes, you're on the right track. Atmosphere triggers aren't reckoned as triggers in the normal sense and hence they can't be referenced by simple names. You need that long GUID hash for the name. Here is an example of mine that worked:

IF
DB_SCHED_CurrentHour(_Hour)
AND
DB_Atmos_Setting(_Hour, _atmos)
THEN
TriggerSetAtmosphere("45da1980-1e2f-4ade-bcd4-552588a9d2da", _atmos);

The stuff beforehand was just a way to make it easier to define all my atmospheres at a given hour using databases.


Last edited by Windemere; 07/01/15 02:09 PM.

DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
Yeah, the atmosphere changed when I set it to TriggerSetAtmosphere("375fb183-cd31-4cf4-929d-064657297f5c", "default"); so thats two scripts down now laugh

Still trying to figure out how to make NPCs face the player.

Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
I want an NPC to teleport to a location if a certain global event is set and if he is currently in the party. So I suppose I need the script to check for two events. Or alternatively, for a timer and an event. But I always get a DIV event allowed only as the first condition of a rule error. Any ideas how I could make this script work?

IF
GlobalEventSet("ConradHired")
AND
TimerFinished("TPconrad")
THEN
CharacterTeleportToTrigger(CHARACTER_Conrad, TRIGGER_ConradLocation,"");

Edit: Since he's in the party he always teleports with Player1 to that location, but I need him to follow Player2. I tried to edit his hiring script to attach to Player2 but that made no difference

Last edited by JecklynHyde; 10/01/15 07:56 AM.
Joined: Apr 2013
N
addict
Offline
addict
N
Joined: Apr 2013
Just use a temporary db:

IF
GlobalEventSet("ConradHired")
THEN
DB_ConradHired(1);


IF
TimerFinished("TPconrad")
AND
DB_ConradHired(1)
THEN
CharacterTeleportToTrigger(CHARACTER_Conrad, TRIGGER_ConradLocation,"");


Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5