Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#568813 09/09/15 07:41 AM
Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
How do I make credits roll after speaking to the final NPC? I don't mind if it's the original Larian credits. It could even be a picture with "The end" written on it. I just need something to signify that the game is over.

Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
This is something I haven't tested a ton so I can only give you the quick and dirty method.

This call will end the game by playing the credits and dumping you to a menu.
EndGame();

^Yes the () are empty.

So making it run is basically just like any other call.

IF
SOMEEVENT
THEN
GameEnd();

So if you make the query a global event, the second that global event is run it will probably kill your dialog and end the game, something you probably don't want as it would look weird.

My suggestion would be something like this:

IF
GlobalEventSet("TheGameWillBeOver")
THEN
DB_GameIsOver(1);


In your dialog file, for the specific node that ends the game, use the:
ACTION SetFlag("TheGameWillBeOver",1)

All that would do is add the DB_GameIsOver(1);


But the reason for that is so we can do this:
IF
DialogEnded("NPCDIALOG",_) //the _ is very important
AND
DB_GameIsOver(1)
THEN
GameEnd();

So that way, you can talk to that NPC without specifically trying to end the game. But when you hit whatever node has the ACTION SetFlag, as soon as the player hits the Goodbye node and dialog closes credits should roll.




If this particular NPC can only be talked to once, immediately before the end of the game you don't need to do all that.

This would do fine:

IF
DialogEnded("NPCDIALOG",_) //the _ is very important
THEN
GameEnd();


But that would kill the game any time you talk to that NPC, so if the NPC is specifically there at the end only it would work. If you talk to this NPC at any other point in the mod you need to use the DB_GameIsOver(1) thing.

Last edited by SniperHF; 09/09/15 05:28 PM.
Joined: Oct 2014
Location: Hogwarts
member
OP Offline
member
Joined: Oct 2014
Location: Hogwarts
Thanks again. Looks like all I was missing was the "_" mark.

Finally, what code would I add to make the camera focus on the NPC when the dialog begins? I already have the camera in place.


Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
Cameras are tricky.
Problem #1, they are timed.
Problem #2, there can be performance issues.
Problem #3, they can really make environments look weird by showing the lack of full rotation support and sometimes they'll show region triggers.


This is something I was planning on doing a tutorial on eventually.


Basic call for a camera is:
CameraActivate(_Player,"Camera_YourCamera",15.0,0,0,1);


So do the same thing as you did for game end, and link it to a global event you can set in the ACTION section of the dialog.

The "Camera_YourCamera" part is actually the name you gave your camera in the trigger panel. I have absolutely no idea why this works, when everything else needs to be global or use the GUID.

Don't make it global.

The first number is the time in seconds, it must be REAL so include a .0 after the number.

The next integer is Hide UI. I believe this also hides the dialog UI so you do not want to set this. Leave it 0.

The third number is Smooth, which sort of does a pan effect. I think this doesn't work very well so I usually leave it 0. You can play around with it though.

The final one is HIDE Shroud. I always leave this as a 1. If it's set to 0 you can see region triggers in the distance. When you are indoors this might not be a problem, but I haven't see any real benefit from not hiding the shroud. So I leave it as a 1.


I suggest you make a little inventory item, that when activated sets the same global event intended to trigger your camera. This makes it easier to test.


Oh and on the performance side, they run poorly in the editor but usually run Okay in-game.




Last edited by SniperHF; 09/09/15 10:49 PM.
Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
This was something I did with cameras to just practice with them.



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