Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Page 1 of 2 1 2
Joined: Jul 2014
D
apprentice
OP Offline
apprentice
D
Joined: Jul 2014
I've been digging around the main files and looking at the character creation level, and I can not understand where to even begin. Mainly decals, saved character presets, and then carrying the created character over to the main game.

Posting to hopefully have Larian see this and put it on their list of future tutorials.

Joined: Jul 2014
A
stranger
Offline
stranger
A
Joined: Jul 2014
I haven't gotten to this part yet, but would also like to see how this is done for a stand alone mod for my story I'm building. Thank you.

Joined: Jul 2014
member
Offline
member
Joined: Jul 2014
Originally Posted by FromHolland
here it is for the people who have trouble with character creation screens (excluding gui)
how to use: extract in mods map and open up divinity engine smile

Code
http://speedy.sh/ecgNY/CharacterCreationMod.rar

Joined: Jul 2014
R
apprentice
Offline
apprentice
R
Joined: Jul 2014
FromHolland's approach of just copy clubbing the main game's scripts works and feel free to use it, but let's see if we can peer a little deeper into the why in hopes of understanding what's going on a little better.

Character Creation is mostly hard coded into the the game, so as a result it's actually pretty easy to get working, although difficult to modify very much.

To set up Character Creation, make a new mod, drop some terrain, drop down one or two characters from Root Templates (I suggest FemalePlayer or MalePlayer) and make them Global. Sorry, you can't character create more than two characters (or, if you can, I haven't found a way), Character Creation seems to fire exactly once, just after GAMEEVENT_GameStarted is finished.

So to hook into to that hard coded magic, we need to add a new story script with this code to our mod:
IF
GameEventSet("GAMEEVENT_GameStarted")
AND
CharacterAddToCharacterCreation(CHARACTER_Player1, 0, 1)
AND
CharacterAddToCharacterCreation(CHARACTER_Player2, 0, 1)
THEN
TimerLaunch("Doesn't Matter, just need something in the then statement", 100);

Note that by default your characters will be named something like FemalePlayer_000 and you'll either need to use that name or change it to Player1 (or whatever you want to use in scripts). You can change the name in the character tab of the editor (open it up by clicking on the red person next to the box). Don't be confused and change the display name on the sidebar, the code doesn't care about that.

Once we generate definitions + build our script without any errors, we're almost there. All we need to do is close the editor and copy over the Mods/Main/CharacterCreation folder to Mods/(your mod name)/CharacterCreation

Note that CharacterCreation doesn't fire when you test the level in the editor, but if we go start it up in the game itself, we see that character creation is working. You can change classes, customize abilites, assign portraits that don't look like your character--all that good jazz. Once you click finish, the screen will fade to black then fade back and you'll have control of your characters.

Woo we did it! Now of course, the actual character creation has cool cinematic cameras, and we can add those too. To add cameras you either drop them down from Root Templates (SpectatorCameraTrigger) or you can maneuver the editor camera and the use tools -> place spec cam here to drop a camera where you're looking. You can then rename those cameras in the trigger list (list is open by default, click on the trigger box on top if you've closed it), to get Character Creation to use them.

The four camera names that the game recognizes are:
Camera_Creation_Main //The default camera you see when Character Creation starts
Camera_Creation_1 //The view for customizing first player
Camera_Creation_2 //The view for customizing second player
Camera_Creation_Start //Don't know what this is used for

Once you've added and named your cameras properly, you can again start your mod up and see that everything is working, but this time with cinematic cameras.

Now of course, you may not want to have your character creation happen on the same level or area as the beginning of the game.

If you want to teleport your characters after character creation finishes to a new area, we can add to our Story Editor the new function:

IF
CharacterCreationFinished(CHARACTER_NULL)
THEN
CharacterTeleportPartyToTrigger(TRIGGER_TheGameBegins, "");

The trigger can be named anything and can be on either the same level or another level. The only requirement is that the trigger is global. We can also do stuff like add items here without fear of them being overwritten by the character creation process.

Hold it! you say, I don't want to create boring old classes like Battlemage, I want to create sweet new classes. And I don't want to play as a human, I want to be a skeleton, can I do that? Well you can, but you're going to have to wait for the next tutorial on CharacterCreation properties and classes if you want to learn it from me. If you want though, you can just go fiddle around in CharacterCreation/properties.lsx and figure it out.

Joined: Jul 2014
member
Offline
member
Joined: Jul 2014
Originally Posted by roguelike
Sorry, you can't character create more than two characters (or, if you can, I haven't found a way)


Pretty much do the same as you have done, but you are limited by GUI, so players 3 and 4 are not customisable currently. (other than the mirror)

Joined: Feb 2011
member
Offline
member
Joined: Feb 2011
Originally Posted by roguelike
....

....
Thank you, it finally works.

Joined: Jul 2014
A
stranger
Offline
stranger
A
Joined: Jul 2014
Hi Rogue. Thank you for posting this!

The code worked great. I was able to see the character creation pop up on my screen and even teleported to my main level.

A couple of things.

1. I can't find the CharacterCreation folder in any of the main folders to copy over. I unchecked hidden folders in my windows folder options, but didn't seem to change anything.
2. While in Character Creator I wasn't able to pick any class or really change much. My characters are all "purply" when I switch to play or when I bring back up the mod in the editor.

Any thoughts on what I may be missing (other than me being a newbie modder).

Joined: Jul 2014
R
apprentice
Offline
apprentice
R
Joined: Jul 2014
Your second point is caused by the first.

Use Norbyte's unpaking tool: https://dl.dropboxusercontent.com/u/32263228/lstools.zip to unpak Main.pak somewhere (preferabbly somewhere that isn't your divinity:original sin directory, since it will read from those files instead of the .pak if they're there). From there look under Mods/Main/CharacterCreation and grab that folder.

Joined: Jul 2014
E
stranger
Offline
stranger
E
Joined: Jul 2014
Hi everybody.
This tutorial is incredibly usefulIf. There is only one thing that i can't make work as expected. If you want to teleport your characters after character creation finishes to a new area then you can use the trigger that can be named anything and can be on either the same level or another level. If I understand right, the function:
IF
CharacterCreationFinished(CHARACTER_NULL)
THEN
CharacterTeleportPartyToTrigger(TRIGGER_TheGameBegins, "");

refers to trigger that can be placed on different level with different name inside the same module. If I do this, during definitions + build generation I have an error because the script can't find the corresponding trigger. In case of CharacterCreationMod it's Teleport1 point trigger based on MILKYWAY file.

Joined: Oct 2013
enthusiast
Offline
enthusiast
Joined: Oct 2013
I just wanted to add my thanks for this tutorial! Can't believe I didn't see that wink

Joined: Jul 2014
D
apprentice
OP Offline
apprentice
D
Joined: Jul 2014
Try making your own trigger (in the case of your code listed, itll be named "TheGameBegins" without quotes) and set it to global.

Joined: Feb 2011
member
Offline
member
Joined: Feb 2011
You can't change the name of the trigger in the sidebar, you have to open the "Trigger" window. I had the same problem.

See this post for the answer: http://www.larian.com/forums/ubbthreads.php?ubb=showflat&Number=525764#Post525764

Joined: Jul 2014
F
stranger
Offline
stranger
F
Joined: Jul 2014
On the topic of character creation menu:

I am making a standalone mod where the starting characters do not get any bonus stats. That is, they are just 5 in all attributes and have no starting skills or any magical gear or potions. If I copy over the "Character Creation" folder from the main.pak and delete all the presets, then it crudely does the job. I can modify the person's looks and voice, and have no starting skills. Works fine I suppose.

However, what I'd like to do is create my own classes, where each person has a background, a different set of equipment, and possibly a couple attribute points(contrary to what I just said).

However, when I try to modify the presets to be my own, or fiddle with the properties.lsx file, it doesn't seem to do all my intended changes. Even changing the starting name from Scarlett to Player2 or something doesn't seem to work.

So my thoughts are that I have to modify several other files besides just those in character creation. Does anyone have a clue which files I will have to change? I have been searching for a while, but nothing seems to work.

I have only been playing with the editor for a couple days, so I'm still fairly new to this.

Joined: Jul 2014
R
apprentice
Offline
apprentice
R
Joined: Jul 2014
I was gonna write a big old post on this but I didn't, so here's the cheat list of stuff you need to know about tweaking character creation:

1) Classes will only load if they have distributed exactly the number of points assigned in properties.lsx. Thus if you change NumStartingAttributePoints from value=5 to value=6, you will have to go into each class preset and add an attribute point if you want it to work. Change it to 0 and you will have to go in and remove or set to 0 all the assigned attribute points.

This is also true for talents and ability points, keep in mind that it costs additional ability points to raise an ability above 1.

2) Anytime you change a node with a "handle" property, such as ClassDescription, FemaleDefaultPlayerNames, or ColorName, you need to change the UUID or it will always point to the default text description and your text changes won't be visible. The 'correct' way to do this is to generate new UUID, but all you really need to do is change one or two numbers.

3) If you use the armor nodes, Classes can only receive armor that is defined in properties.lsx. If you put the armor in their equipment set though, everything seems to work just fine. I don't really understand the purpose of the armor nodes.

4) You can change FemaleRootTemplateIDs and MaleRootTemplateIDs to any character in the game (troll, skeleton, statue), but you'll lose basically all visual customization. Also this switches your roottemplate on clicking male/female, I don't know if it's possible to change it on class selection.

4a) There's a 'race' node and in theory you could add more races, but the game's GUI doesn't seem capable of handling it at the moment.

Joined: Jul 2014
F
stranger
Offline
stranger
F
Joined: Jul 2014
Thank you roguelike. Turns out just deleting the whole
handle='UUID'
allows me to change Scarlett's name, too. Not sure what other ramifications will be caused by simply deleting it, but I don't know how to create UUID's, so this will suffice.

This is probably an unrelated question, but I cannot seem to figure it out. How do I put up a backdrop in the sky? Right now my menu just sees the end of the world. I figured it was skydome in the atmosphere section, but that doesn't appear to do anything.

Joined: Jul 2014
R
apprentice
Offline
apprentice
R
Joined: Jul 2014
Clicking the skydome in the atmosphere section does in fact do something! It creates a tiiiiny skydome at 0,0. Large enough for the world's tiniest mod.

None of the main campaign levels seem to use skydomes, so I don't think it's a feature they finished implementing. If you want a backdrop for your menu or character creation camera, you can search root templates for "dome", but there's only 3 or so.

Joined: Jul 2014
Z
stranger
Offline
stranger
Z
Joined: Jul 2014
Thanks for the tutorial. I actually managed to make a custom characters creation map with a custom game menu also(i'll make a topic later maybe).

I've noticed that if you put the cameras in certain angle, the position choosen for your characters actually swaps, I don't know why.

Joined: Oct 2013
enthusiast
Offline
enthusiast
Joined: Oct 2013
Sorry to bring this up again, but I hit a different problem and I am probably missing again something obvious ;p (to a coder)

I set up the character creation in _Start like this

Code
IF
GameEventSet("GAMEEVENT_GameStarted")
AND
CharacterAddToCharacterCreation(CHARACTER_Player1,0,1)
THEN
TimerLaunch("Doesn't Matter, just need something in the then statement", 100);


Then beneath that, I added
Code
IF
CharacterCreationFinished(CHARACTER_Player1)
THEN
CharacterTeleportPartyToTrigger(TRIGGER_TPPoint,"");


Where TPPoint is the "point trigger" in the level I want to teleport to.

Yet for some reason nothing happens after character creation finishes.

Am I doing something wrong here? And if yes, what? (The trigger is global) I tried without teleport, and for some reason doing

IF
CharacterCreationFinished(CHARACTER_Player1)
doesn't even allow me to trigger ANYTHING, I mean literally, this condition never triggers anything for me.

I am bit a confused ;P
So I am guessing I am doing something wrong?

Joined: Jul 2014
C
stranger
Offline
stranger
C
Joined: Jul 2014
Since character creation modifies both player 1 and player 2 at the same time, it looks like it's not sending a player reference back when completed.

Try checking for
Code
IF
CharacterCreationFinished(CHARACTER_NULL)
THEN
CharacterTeleportPartyToTrigger(TRIGGER_TPPoint,"");

For the record, using the mirror to change appearance on one character uses CharacterAddToCharacterCreation as well, and when this finishes it sends a character reference for CharacterCreationFinished. You can find the code for this in CYS_General

Code
IF
//using the mirror
CharacterUsedItem(_Player,ITEM_HOM_CharCreation_Mirror)
AND
//making sure the user is a playable character
_Player.isPlayer()
AND
//making sure the user is not a companion
NOT DB_DefinedCompanions(_Player)
AND
//adding it to the appearance changer. 
//note that this has a 2 instead of a 0 as second parameter
CharacterAddToCharacterCreation(_Player,2,1)
THEN
//set a variable indicating the player is respeccing
DB_Illusionist(_Player);


IF
//finished
CharacterCreationFinished(_Player)
AND
//check if the earlier variable is set to prevent conflicts
//with other CharacterCreationfinished events
DB_Illusionist(_Player)
THEN
//remove player from the variable, again to prevent conflicts
NOT DB_Illusionist(_Player);
//teleport the player
CharacterTeleportToTrigger(_Player,TRIGGER_HOM_PointCreationMirrorDest,"");


Last edited by ck06; 29/07/14 03:42 PM.

-ck06
Joined: Oct 2013
enthusiast
Offline
enthusiast
Joined: Oct 2013
Thank you, that fixed it wink

Ps.: Note to self, Don't ever use TeleportCharacter when you want to change level. ;P

Last edited by eRe4s3r; 29/07/14 04:23 PM.
Joined: Oct 2014
Location: Hogwarts
member
Offline
member
Joined: Oct 2014
Location: Hogwarts
A few questions:

1. Do you create an area for the character customization to take place? DOS uses the interior of a temple but I could have mine on a ship?

2. Do you place Player 1 and Player 2 using triggers or just leave them in the general area?

3. How do you make those camera functions work? I found the camera trigger but I wasn't sure what to do with it then. How do you make sure your game doesn't get stuck in that camera angle?

4. What level so your characters start out as after character customization ends?

Joined: Oct 2014
B
enthusiast
Offline
enthusiast
B
Joined: Oct 2014
Originally Posted by JecklynHyde
A few questions:

1. Do you create an area for the character customization to take place? DOS uses the interior of a temple but I could have mine on a ship?

2. Do you place Player 1 and Player 2 using triggers or just leave them in the general area?

3. How do you make those camera functions work? I found the camera trigger but I wasn't sure what to do with it then. How do you make sure your game doesn't get stuck in that camera angle?

4. What level so your characters start out as after character customization ends?


1.) Yes, you can create any area you like

2.)Player1 spawns at the Startpoint trigger you place, player2 you place manually I believe.

3.) Just naming the camera properly makes it work. No scripting necessary outside of character creation scripts.

4.) They start at level 1 most likely, but you can add scripts to give further levels or stats if you want.

Joined: Oct 2014
Location: Hogwarts
member
Offline
member
Joined: Oct 2014
Location: Hogwarts
Do you need to script Player 1 to move to the Startpoint trigger or is that hard coded into the game?

Joined: Oct 2014
B
enthusiast
Offline
enthusiast
B
Joined: Oct 2014
Hard coded assuming character creation is the very first thing that happens in your game.

Last edited by Burgee; 14/01/15 05:17 AM.
Joined: Oct 2017
G
stranger
Offline
stranger
G
Joined: Oct 2017
If you have the code under KB, what do you put in INIT. I can guess you have to define Character_Player1 and 2. How do you do that?

Page 1 of 2 1 2

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