Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#558807 19/11/14 05:05 AM
Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
Why would someone use "IsLocalFlag" instead of "IsFlag"?

I was trying to create an assassination quest in my game, which involved NPC A giving the PC a contract to kill NPC B. Once the PC receives the quest I wanted a new dialogue option to appear when speaking to NPC B. However, the localflags I put on NPC A's dialogue didn't work on other NPCs dialogues so I switched the IsLocalFlag conditions to Isflag. Now it works.

But what's the benefit to using a localflag then?

Joined: Oct 2014
B
enthusiast
Offline
enthusiast
B
Joined: Oct 2014
In this engine, I'm not sure.

In programming in general you want to use local variables whenever possible, it's more efficient, takes less memory and causes less global errors.

In a small project like a Divinity Mod, I use IsFlag for pretty much everything so I can reference it from script and from other dialogues more easily, even if I don't originally plan to.

IsLocalFlag would be used if it was only being referred to in that conversation for one specific reason.

That's the best I can come up with.

Last edited by Burgee; 19/11/14 06:33 AM.

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