Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Aug 2014
D
stranger
OP Offline
stranger
D
Joined: Aug 2014
Back again, sorry cry
Okay so I'm having an issue of the story not recognizing when the dialogue creates a global event. I basically followed the simple steps in the official tutorial video for scripting quests, but this code isn't working:
Code
IF
GlobalEventSet("help")
AND
ItemGetVarInteger(ITEM_cell1_door,"door_open",1)
THEN
DialogStartTwoSpeakerDialog("prisoner1_dialogue_helped",CHARACTER_prisoner1,CHARACTER_Main_Char);
(tried removing the and getvar just 'cuz).
And just for clarity in one of the dialogue action boxes I have
Code
ACTION SetFlag("help",1)
and I have no code to change that value.

When I set a global event in my story, however, the dialogue recognizes it. I do remember having problems with this too but I have no idea what I did to solve it, maybe just restarting the editor a bunch. But that doesn't seem to be helping with this specific problem. Any advice?

Joined: Jul 2014
member
Offline
member
Joined: Jul 2014
Originally Posted by Daphreak
Back again, sorry cry
Okay so I'm having an issue of the story not recognizing when the dialogue creates a global event. I basically followed the simple steps in the official tutorial video for scripting quests, but this code isn't working:
Code
IF
GlobalEventSet("help")
AND
ItemGetVarInteger(ITEM_cell1_door,"door_open",1)
THEN
DialogStartTwoSpeakerDialog("prisoner1_dialogue_helped",CHARACTER_prisoner1,CHARACTER_Main_Char);
(tried removing the and getvar just 'cuz).
And just for clarity in one of the dialogue action boxes I have
Code
ACTION SetFlag("help",1)
and I have no code to change that value.

When I set a global event in my story, however, the dialogue recognizes it. I do remember having problems with this too but I have no idea what I did to solve it, maybe just restarting the editor a bunch. But that doesn't seem to be helping with this specific problem. Any advice?


theres plenty of reasons it can not trigger. But your code is right.

I can tell you the var triggers are notorious for not working properly. I've fooled with them enough to know sometimes they just are a little wonky.(I wouldn't say.. unusable. But i know sometimes they just dont work. If you want the door to be open when it triggers use the door opened query. I'm away from my computer atm so i cant tell ya what its exactly called. either dooropened or itemopened something like that.

Last edited by Demonata08; 21/08/14 10:38 PM.
Joined: Jul 2014
enthusiast
Offline
enthusiast
Joined: Jul 2014
Are you saying that you want the game to remember a flag being set in a previous dialog? So, the character talks to someone which sets a flag "help", then the dialog ends (but the flag is now 'activated'), the character has a wacky adventure or maybe just some lunch, then later on opens a room and has a specific dialog with the occupant only because of the previous flag earlier in the day?

Sorry if that's not what you want!

If it is, try the following. We're going to make an entry in INIT, effectively stating that the prisoner is not yet met. When we hit the flag in the first dialog, we're going to remove that entry. In the second dialog, the specific dialog will only show if the entry in INIT is removed.

Try this, noting that we're putting a line in INIT and the rest going in KB.

Code
INIT

DB_PrisonerUnmet(1);



KB

IF
GlobalEventSet("help")
THEN
NOT DB_PrisonerUnmet(1);

IF
DialogStartRequested(CHARACTER_prisoner1,CHARACTER_Main_Char)
AND
NOT DB_PrisonerUnmet(1)
THEN
DialogStartTwoSpeakerDialog("prisoner1_dialogue_helped",CHARACTER_prisoner1,CHARACTER_Main_Char);


I've removed the stuff with the 'AND ItemGetVarInteger()' only because I haven't used that myself yet and also to keep the example as simple as I can. If this works (no promises it will!) you should be able to easily modify it to work as you like.

Last edited by Noaloha; 21/08/14 10:40 PM.

Escape From Smalcatraz: Steam/Nexus. Forum thread.
Joined: Jul 2014
member
Offline
member
Joined: Jul 2014
Actually now that i think about it. That code isn't going to work xD


See when you use the call "Globaleventset" It will only trigger the moment that event is set.

If you have a query under it like the var one you have. it will activate if the event is set and then check the query. If the query doesnt come back as positive it won't follow through and it will not activate. even when the var is set to 1. Because that globaleventset has already been set.


Heres what you need. And keep in mind i dont know what it is you're trying to accomplish lol.

What i think you're trying to accomplish is there's a dialog between characters. The dialog leads to the flag being set. When the flag is set and the door is opened, the second dialog triggers.

Code
IF GlobalEventSet("Help")
THEN
CharacterSetVarInteger(CHARACTER_Main, "whatever", 1);

IF ItemOpened("door")
AND
CharacterGetVarInteger(Character_Main, "whatever", 1)
THEN
DialogStartTwoSpeakerDialog("thedialog", Character_prisoner1, Character_main);

Keep in mind to change the names of everything to fit your game.

And what that does is turn that event "help" into a variable that is 1.

Then i think you're trying to get this to trigger when the a certain door is opened and the flag is set. So that checks to see when the door is opened if that integer is 1.


Database entries can be hard for noobies and aren't necessary in most cases. Especially in this case. Not to say you shouldnt practice it. But a lot of the time it isn't required.

Last edited by Demonata08; 21/08/14 11:09 PM.
Joined: Aug 2014
D
stranger
OP Offline
stranger
D
Joined: Aug 2014
I tried it but it didn't work for me sad But thanks anyhow, you've been extremely helpful lately!

Last edited by Daphreak; 22/08/14 07:07 PM. Reason: Made a mistake, Noaloha's code did work
Joined: Aug 2014
D
stranger
OP Offline
stranger
D
Joined: Aug 2014
Quote
See when you use the call "Globaleventset" It will only trigger the moment that event is set.

Ahhhhhh, well that's definitely helpful. Thank you!

Joined: Jul 2014
member
Offline
member
Joined: Jul 2014
Yeah like i said. Sometimes the var calls can be tricky.

If i were you i'd probably try to replace the dialog box with something visible. I usually use characteraddabilitypoint i think its called. That way you can diagnose where the problem is. If you see it adding ability points you know its triggering properly and the problem lies with the dialog. If it doesnt add ability points then you know the trigger is wonky haha

Joined: Jul 2014
R
addict
Offline
addict
R
Joined: Jul 2014
The Get/Set Var calls only work with variables defined within Char/ItemScripts. If no such variable exists within the scripts the Character/Item uses, then nothing occurs.

Joined: Jul 2014
enthusiast
Offline
enthusiast
Joined: Jul 2014
I use roguelike's trademark MIGHTY SPARK! from his standalone tutorial - PlayEffectAtCharacter("FX_Skills_Air_Storm_Impact_A",CHARACTER_whatever); - for all of my script checks. Thanks again for that video roguelike. smile

Daphreak, did you try the option I posted? I'm looking at it, thinking how it works correctly in the situation I use it in, and I think it will achieve what you're after. Obviously change the DialogStartRequested() to a door opening event if that's how you want the conversation to begin.

Last edited by Noaloha; 22/08/14 06:17 AM.

Escape From Smalcatraz: Steam/Nexus. Forum thread.
Joined: Jul 2014
member
Offline
member
Joined: Jul 2014
Originally Posted by Rhidian
The Get/Set Var calls only work with variables defined within Char/ItemScripts. If no such variable exists within the scripts the Character/Item uses, then nothing occurs.


I don't think that's quite true actually, I'm using a couple variables calls in my story and none of them point to anything used in char/item scripts though they work perfectly. I've also tried using them and them not work so well.. Not sure what the issue is there.

Joined: Aug 2014
D
stranger
OP Offline
stranger
D
Joined: Aug 2014
Yes - and it did work, my apologies. Made a mistake the first time I tried it.

Joined: Jul 2014
enthusiast
Offline
enthusiast
Joined: Jul 2014
Woohoo!


Escape From Smalcatraz: Steam/Nexus. Forum thread.

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