Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Page 1 of 2 1 2
Joined: Sep 2017
C
journeyman
OP Offline
journeyman
C
Joined: Sep 2017
Hi.

I want to make some of my NPCs being able to follow the party around as followers (not companions at this stage).

My campaign has NPCs that the party will have to team up with - but they do not need to be able to control them as regular party members/companions.

I have read here: http://larian.com/forums/ubbthreads.php?ubb=showflat&Number=632089#Post632089

But my scripting and Engine skills are bad.

Can someone please walk me through it like I am six years old? That would make my week.
For instance, the flag, is that made as a new script? Basic things like that.

Joined: Oct 2017
Location: United Kingdom
journeyman
Offline
journeyman
Joined: Oct 2017
Location: United Kingdom
Go into the Story Editor, then right click on the "Start" category on the left and "Add sub item" (or something like that) and type a name for the goal. Then go into the goal you made and put in the KB section something like:

Code
IF
DialogEnded("DialogName", _ID)
THEN
CharacterSetFollowCharacter(_NPCGUID,_PLAYERGUID);


Which would make the NPC follow the player once the dialog with the name "DialogName" (the dialog for an NPC you made and saved in the dialog editor) ended. Replace "_NPCGUID" and "_PLAYERGUID" with the CHARACTERGUID of the NPC and player. Can get these by right clicking on the character in the editor and then "Copy TypeGUID" (or something like that) then copying and pasting it. Or you can start typing the Name of the NPC/Player in the script then hitting control+space bar, then you can select them from the drop down. Make sure you do File > Generate Definitions first.

Once it's all done do File > Generate Definitions, Build and Reload. Then you can test it.

Joined: Sep 2017
C
journeyman
OP Offline
journeyman
C
Joined: Sep 2017
Thank you so much Branvex.

I will test this a s a p. One (stupid) question:

Where do I find the Players GUID?


Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
How to obtain the player GUID depends a lot on the context of the event that drives the action. It can't be answered too confidently without more details about how you plan to have this work. If we dovetail with Branvex's suggestion, then it would be something like:

Code
IF
DialogEnded("DialogName", _ID)
AND
DialogGetInvolvedNPC(_ID, 1, _NPCGUID)
AND
DialogGetInvolvedPlayer(_ID, 1, _Player) 
THEN
CharacterSetFollowCharacter(_NPCGUID, _Player);


But again, this assumes certain things like there is only 1 player and 1 NPC involved in the dialog and that you want to assign the NPC to follow the player in the dialog regardless of any choices made in the conversation. Presumably you want to have some choice in the matter, in which case you would want to handle this with flags instead of merely ending the dialog.

I highly recommend spending time learning the language and going through some of the scripting tutorials out there. If you plan to create some kind of campaign, there is no getting around learning Osiris.


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Sep 2017
C
journeyman
OP Offline
journeyman
C
Joined: Sep 2017
Thx Windmere.

Sorry for not being all clear. This is for GM mode and I am GM, so no alternatives or anvanced dialog needed.
I only want the pure functionality of an npc following the party. Easiest way possible.

Joined: Jul 2014
member
Offline
member
Joined: Jul 2014
It would be nice if this was a part of the GM tool. Like a condition you could add to a NPC. "Follow Player 1 around".

Joined: Sep 2017
C
journeyman
OP Offline
journeyman
C
Joined: Sep 2017
Yes, absolutely!

I have tried to follow the instructions here above but it doesn't work when testing inside the editor at least, maybe I must test it in my GM-campaign for it to work? Will try that, hopefully tonight.




Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
If you post the code here maybe we can find out what the issue is. If it's not working in the editor I'm doubtful it will work in game.


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Jul 2014
enthusiast
Offline
enthusiast
Joined: Jul 2014
Clunky workaround would be using the follow party function already in GM Mode , before changing scene saving npc amd respawm in new level.

Joined: Sep 2017
C
journeyman
OP Offline
journeyman
C
Joined: Sep 2017
@Windemere

Hi. I cannot access the game from this computer but for example I have tried this:

IF
DialogEnded("DialogName", _ID)
AND
DialogGetInvolvedNPC(_ID, 1, _NPCGUID)
AND
DialogGetInvolvedPlayer(_ID, 1, _Player)
THEN
CharacterSetFollowCharacter(_NPCGUID, _Player);

Where I put int the dialog name between "".
NPCGUID (by starting the NPCs name and then ctrl+space)
Player (The GUID of the player which I guess is the top one that shows when I write Player then ctrl+space (GM_player_1_something)
Then NPCGUID + Player again in last row.

Maybe it is because the NPC I test with has multiple versions in my campaign, i e he exists in another version as well (this one had ...001). Gonna try more tonight.

The dialog I created seems to work, but the NPC won't start follow my Dummy when it is ended. (when I test in game mode inside the Editor). Maybe it is because the dummy doesn't work as placeholder for Player 1 in this case?

Last edited by chazzreinholdt; 17/11/17 07:17 AM.
Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Actually you don't fill in the _NPCGUID with a specific value in this case. The Query DialogGetInvolvedNPC() finds the value for you and stores it in the variable _NPCGUID, which gets used later in the CharacterSetFollowCharacter(). Let Osiris do the work for you here. wink So try the code as is, only replaceing the "DialogName" with the real dialog file.


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Sep 2017
C
journeyman
OP Offline
journeyman
C
Joined: Sep 2017
Oh, ok. That clears things up a bit I guess;) Thank you for all your help friend!

Joined: Sep 2017
C
journeyman
OP Offline
journeyman
C
Joined: Sep 2017
@Windemere

Hi again.

I got it to work, but at the same time not. I put down the NPC with the dialog in my NPC level. There are other NPCs there as well.

The NPC had the dialog as usual, but when it ended another NPC came running from the other side of the level and started following the dummy character.

So I got an NPC to follow, but not the right one. And then I tried some more and tried to go back and redo that other NPC following, but could never replicate that again...

Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Check the assigned speakers in your dialogue and make sure they are the ones you expect.


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Sep 2015
A
addict
Offline
addict
A
Joined: Sep 2015
I suppose the problem is related to 'DialogGetInvolvedNPC' and 'DialogGetInvolvedPlayer' already being false at this point. I'd look for another solution (setting a flag on the NPC during dialog, catching the event, checking for the involved player and setting the NPC to follow).


My mods for DOS 1 EE: FasterAnimations - QuietDay - Samaritan
Joined: Sep 2017
C
journeyman
OP Offline
journeyman
C
Joined: Sep 2017
Thanks for trying to help a lost soul...

@windemere
I changed the speaker several times and tried with different NPCs. I think I handled that right, but hey, I am never sure.

@abraxas
Thanks. How do you do what you describe?

Joined: Sep 2017
C
journeyman
OP Offline
journeyman
C
Joined: Sep 2017
@windemere
I set the speakers to GROUP_players and the NPC. Maybe that is wrong?

Joined: Sep 2015
A
addict
Offline
addict
A
Joined: Sep 2015
I'm not modding D:OS 2, but it should look like this:

Code
IF
ObjectFlagSet("EventName", _NPC, _ID)
AND
DialogGetInvolvedPlayer(_ID, 1, _Player) 
THEN
CharacterSetFollowCharacter(_NPC, _Player);
ObjectClearFlag(_NPC, "EventName");


For setting character flags in dialog see this wiki-entry:

Dialog editor (the relevant information should be under: Node Actions).


My mods for DOS 1 EE: FasterAnimations - QuietDay - Samaritan
Joined: Sep 2017
C
journeyman
OP Offline
journeyman
C
Joined: Sep 2017
@abraxas

Thank you!

So "EventName" is the character flag?


Joined: Sep 2015
A
addict
Offline
addict
A
Joined: Sep 2015
Yes, it's the name of this character flag. Choose whatever name you like (as long as it isn't identical with the name of another character flag).

If you want to keep this flag (so you can check for this flag sometime later), remove the 'ObjectClearFlag' call.

Last edited by Abraxas*; 20/11/17 01:46 PM.

My mods for DOS 1 EE: FasterAnimations - QuietDay - Samaritan
Page 1 of 2 1 2

Moderated by  Larian_KVN 

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