Larian Banner
Previous Thread
Next Thread
Print Thread
Page 1 of 2 1 2
Making an NPC follow the party? #637130
15/11/17 12:49 PM
15/11/17 12:49 PM
Joined: Sep 2017
Posts: 81
C
chazzreinholdt Offline OP
journeyman
chazzreinholdt  Offline OP
journeyman
C

Joined: Sep 2017
Posts: 81
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.

Re: Making an NPC follow the party? [Re: chazzreinholdt] #637141
15/11/17 03:21 PM
15/11/17 03:21 PM
Joined: Oct 2017
Posts: 78
United Kingdom
Branvex Offline
journeyman
Branvex  Offline
journeyman

Joined: Oct 2017
Posts: 78
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.

Re: Making an NPC follow the party? [Re: Branvex] #637146
15/11/17 05:03 PM
15/11/17 05:03 PM
Joined: Sep 2017
Posts: 81
C
chazzreinholdt Offline OP
journeyman
chazzreinholdt  Offline OP
journeyman
C

Joined: Sep 2017
Posts: 81
Thank you so much Branvex.

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

Where do I find the Players GUID?

Re: Making an NPC follow the party? [Re: chazzreinholdt] #637152
15/11/17 05:53 PM
15/11/17 05:53 PM
Joined: Dec 2013
Posts: 872
Windemere Offline

old hand
Windemere  Offline

old hand

Joined: Dec 2013
Posts: 872
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
Re: Making an NPC follow the party? [Re: chazzreinholdt] #637154
15/11/17 06:14 PM
15/11/17 06:14 PM
Joined: Sep 2017
Posts: 81
C
chazzreinholdt Offline OP
journeyman
chazzreinholdt  Offline OP
journeyman
C

Joined: Sep 2017
Posts: 81
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.

Re: Making an NPC follow the party? [Re: chazzreinholdt] #637236
16/11/17 12:52 PM
16/11/17 12:52 PM
Joined: Jul 2014
Posts: 144
Oldest kingdom in the world
Tiqon Offline
member
Tiqon  Offline
member

Joined: Jul 2014
Posts: 144
Oldest kingdom in the world
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".

Re: Making an NPC follow the party? [Re: Tiqon] #637246
16/11/17 02:23 PM
16/11/17 02:23 PM
Joined: Sep 2017
Posts: 81
C
chazzreinholdt Offline OP
journeyman
chazzreinholdt  Offline OP
journeyman
C

Joined: Sep 2017
Posts: 81
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.

Re: Making an NPC follow the party? [Re: chazzreinholdt] #637249
16/11/17 02:45 PM
16/11/17 02:45 PM
Joined: Dec 2013
Posts: 872
Windemere Offline

old hand
Windemere  Offline

old hand

Joined: Dec 2013
Posts: 872
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
Re: Making an NPC follow the party? [Re: chazzreinholdt] #637253
16/11/17 03:40 PM
16/11/17 03:40 PM
Joined: Jul 2014
Posts: 208
morez Offline
enthusiast
morez  Offline
enthusiast

Joined: Jul 2014
Posts: 208
Clunky workaround would be using the follow party function already in GM Mode , before changing scene saving npc amd respawm in new level.

Re: Making an NPC follow the party? [Re: morez] #637333
17/11/17 07:15 AM
17/11/17 07:15 AM
Joined: Sep 2017
Posts: 81
C
chazzreinholdt Offline OP
journeyman
chazzreinholdt  Offline OP
journeyman
C

Joined: Sep 2017
Posts: 81
@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.
Re: Making an NPC follow the party? [Re: chazzreinholdt] #637347
17/11/17 01:21 PM
17/11/17 01:21 PM
Joined: Dec 2013
Posts: 872
Windemere Offline

old hand
Windemere  Offline

old hand

Joined: Dec 2013
Posts: 872
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
Re: Making an NPC follow the party? [Re: Windemere] #637348
17/11/17 01:23 PM
17/11/17 01:23 PM
Joined: Sep 2017
Posts: 81
C
chazzreinholdt Offline OP
journeyman
chazzreinholdt  Offline OP
journeyman
C

Joined: Sep 2017
Posts: 81
Oh, ok. That clears things up a bit I guess;) Thank you for all your help friend!

Re: Making an NPC follow the party? [Re: chazzreinholdt] #637466
19/11/17 05:20 PM
19/11/17 05:20 PM
Joined: Sep 2017
Posts: 81
C
chazzreinholdt Offline OP
journeyman
chazzreinholdt  Offline OP
journeyman
C

Joined: Sep 2017
Posts: 81
@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...

Re: Making an NPC follow the party? [Re: chazzreinholdt] #637468
19/11/17 05:55 PM
19/11/17 05:55 PM
Joined: Dec 2013
Posts: 872
Windemere Offline

old hand
Windemere  Offline

old hand

Joined: Dec 2013
Posts: 872
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
Re: Making an NPC follow the party? [Re: chazzreinholdt] #637469
19/11/17 06:09 PM
19/11/17 06:09 PM
Joined: Sep 2015
Posts: 458
A
Abraxas* Offline
addict
Abraxas*  Offline
addict
A

Joined: Sep 2015
Posts: 458
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
Re: Making an NPC follow the party? [Re: Abraxas*] #637475
19/11/17 07:25 PM
19/11/17 07:25 PM
Joined: Sep 2017
Posts: 81
C
chazzreinholdt Offline OP
journeyman
chazzreinholdt  Offline OP
journeyman
C

Joined: Sep 2017
Posts: 81
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?

Re: Making an NPC follow the party? [Re: chazzreinholdt] #637477
19/11/17 07:27 PM
19/11/17 07:27 PM
Joined: Sep 2017
Posts: 81
C
chazzreinholdt Offline OP
journeyman
chazzreinholdt  Offline OP
journeyman
C

Joined: Sep 2017
Posts: 81
@windemere
I set the speakers to GROUP_players and the NPC. Maybe that is wrong?

Re: Making an NPC follow the party? [Re: chazzreinholdt] #637503
20/11/17 10:29 AM
20/11/17 10:29 AM
Joined: Sep 2015
Posts: 458
A
Abraxas* Offline
addict
Abraxas*  Offline
addict
A

Joined: Sep 2015
Posts: 458
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
Re: Making an NPC follow the party? [Re: Abraxas*] #637512
20/11/17 01:24 PM
20/11/17 01:24 PM
Joined: Sep 2017
Posts: 81
C
chazzreinholdt Offline OP
journeyman
chazzreinholdt  Offline OP
journeyman
C

Joined: Sep 2017
Posts: 81
@abraxas

Thank you!

So "EventName" is the character flag?

Re: Making an NPC follow the party? [Re: chazzreinholdt] #637514
20/11/17 01:42 PM
20/11/17 01:42 PM
Joined: Sep 2015
Posts: 458
A
Abraxas* Offline
addict
Abraxas*  Offline
addict
A

Joined: Sep 2015
Posts: 458
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

Powered by UBB.threads™ PHP Forum Software 7.6.2