Jump to content


Darius

Member Since 13 Nov 2004
Offline Last Active Sep 06 2013 07:43 AM

Posts I've Made

In Topic: When beginning to code. . .

28 August 2013 - 05:43 AM

Hmm. . .this is a very good point, Darius!

 

I guess my problem is that I have a lot of things I want to do. I have an NPC that I'd like to create (full thief, half-elf, maybe with a custom kit) who would be a nice addition to an evil party, I'd like to see more romances for the Bioware PCs (currently pretty focused on Valygar since I missed the boat on all the Valygar romance mods that were produced and then disappeared), I'd like to work on coding .. . 

 

If you think that coding a custom NPC will cover the most learning ground, that might be a good way to go, then, huh?

 

My only problem is that getting a .cre file has been horrendously difficult! >: I don't know where my computer is keeping saves or .cre files or anything, and it's a little problematic orz

 

Yeah, .cre files are trouble in the beginning, mostly because virtually every tutorial I've found doesn't cover *all* that you need to know to get a decent *.cre file.

My current pet project mod is pretty well documented and has very in-depth Guides accompanying it, but it's pretty much a wall of text I haven't cleaned up yet, because I'm working more on coding than on the guides for fellow inexperienced-modders.

 

This is the most basic way to get a creature file: (If this looks like a wall of text, it's because it's so precise, you cannot possibly do anything wrong)

1.Start BG2

2.Create a character either in Single Player or Multiplayer, the character you create should be the creature you wish to create (if humanoid)

3.If Single Player, go past the intro Sequence, go to Character Screen (Record) and Export the Character. In Multiplayer Character creation, it will automatically force you to export the *.chr file.

4.The *.chr file is exported into "YourBG2MainFolder/characters". Be sure to EXIT the game.

5.Open NearInfinity (Download it from any Modding Site)

6.In the list on the left, browse to "Characters" and select the character you created.

7.At the top, click on "File" menu and select the "CONVERT CHR To CRE..." menu.

8.Here, either create a new Folder in your BG2 Main Folder and give it whatever mod name you wish, or if you already have one, to into that folder.

9.Save the character as creature inside that folder with your modtag+name. (Modtag such as: "MC!" - for "Minchan") (Name such as: "ElTh" - for "Elvish Thief"

Example: "MC!ElTh.cre"

Important: Make sure that the name at most has 8 letters and not a single more! Many Infinity files that have more than 8 letters are not recognized by the engine!

10.Now you've got your character as creature in your modfolder.

 

11. (Cleaning the File:) In NearInfinity, select "Game" menu, and "Open File".

12. Click on "Browse" under "Open external file". Browse to the file in your modfolder within the BG2 Mainfolder that you created a Moment ago and when you've confirmed your choice, select "Open in new Window".

13.At the top of the newly opened window, switch the Register from "View" to "Edit".

14.Ignore anything such as Name, Apparent Name or anything else that has anything to do with names or text. These things are not given via this file, but done during the installation of your mod to generate new Strings (numbers that reference your text lines) to make it compatible with other mods and to prevent problems.

15.Only do these things for now:

16.Go to the Attribute "Flags" a few lines from the Top. Click on the "Value" field at its side.

17. At the bottom, a lot of checkable Options will pop up. UNCHECK "Export allowed(11) so that it's NOT selected.

18.Scroll further down, you'll come to a section with many "Sound: xyz" Attributes.

19.At every single sound reference where the value next to it is NOT "No such index", click on the Value field.

20.At the bottom, a field will appear where text can be entered. Above the field is a Box called "StringRef" in which there is a number.

21. In EVERY "Sound:xyz" Attribute field where the value is NOT "No such Index" (The StringRef in the Box for this is "-1"), click into the StringRef box, DELETE the String written (eg. StringRef: [734664]) and REPLACE it with "-1". Then ALWAYS click on the "Update Value" button right next to it, so the Value field in the list above is changed to "No such index".

This removes ANY and ALL remnants of PC/Multiplayer soundsets that would otherwise cause strange sentences to pop up.

BE SURE to set this in every field, even fields where the Value is empty and you only see a white field. Everything has the attribute "Sound: xyz" MUST have the Value of "No such index".

22.A little further below the "Sound" Attributes, past the "Stat" attributes, you'll come to the Attribute "Override script". Change it to the SAME name as your creature (e.g. "MC!ElTh") but without any suffix (so no *.something"

23.At the Attributes "Class script", "Race script", "General script" and "Default script" click on the Value field. In the box that appears at the buttom, search for the "None" line and select it. Click on "Update value" so the "Value" field in the list above changes.
24.OPTIONAL: If you wish to create an NPC that greets your character, change the "Class script" Value field to "INITDLG.BCS" (can be found in the list) instead of "None".

25. Below "Default script" you'll come to the Attribute field "Enemy-Ally". In the Value field next to it, change the Value in the list that appears below the main list to "NEUTRAL - 128" if you wish to create a neutral NPC, or a joinable NPC, or - if you wish to create a hostile enemy - select "ENEMY - 255" and click on Update value so the Value field in the main list changes.

26.Further down, you'll come to the Attribute field: "Death variable". Right-click on the value field to its side and select "Edit as String". You can now click on the field and delete the entry and instead, write your own "Death variable". You should enter the name of your character (e.g. "MC!ElTh"). Be sure that you end up with your character Name in the "Value" field beside the "Death variable" Attribute field.

27.A bit further down, you'll find the "Dialog" attribute. Right-click in the "Value" field next to it, select "Edit as String", delete the current value and replace it with your character name (e.g. "MC!ElTh) but no suffix (because NearInfinity won't find a dialog script with that existance yet, but you don't have to worry about that. It will work even without the suffix, because the game will assume you mean a dlg file either way). You don't have to do this Step 27 if you wish to create a creature that never says anything (e.g. an enemy with no dialogue whatsoever)

28. At the Bottom right, click on SAVE and confirm to overwrite the creature.
29. Now you have a creature file, and NO leftovers from its previous existance as a "*.chr" file inside your mod folder.


In Topic: When beginning to code. . .

19 August 2013 - 05:03 PM

This looks like the right place, but all the current topics also look really complicated from my non-coding perspective and background! @n@

 

I haven't had much experience with modding (o-or the game, to be honest otl) as of yet -- I've installed a bunch of mods, and gotten aaaaall the way to Spellhold (which was exciting for me), but haven't gotten the hang of CLUAC yet. I haven't finished a vanilla run of the game at any point /)(\, but I'm sure that's not too relevant to my question (it's not like I'm not going to finish the game at some point, even if I have to cheat constantly to do so! >:[a) so I'll stop rambling.

 

I would like to contribute to the modding community as well, and I have a few ideas of what I'd like to dom, but I'm not sure where to start. I've dug up a lot of tutorials, so that's not what I mean, but between a romance expansion mod (like Laufey's Edwin romance, and Aeryn's Haer'Dalis and Sarevok romances) and an NPC mod with a romance path, which ones would be easier for a beginner coder? I'm not worried about writing or characterization, since I have a lot of experience with both, so from a purely coding perspective, which would be more suitable to a beginner . . . ?

 

I think the best way to approach it would be more along the lines of: what's fun for you? What are you interested in?

If you just want to have your own little personal mod - expanding on dialogue is probably the easiest. Most of the code is very, very simple (as long as you don't look for complicated things to be done) and rather easy to get it into the game.

 

If you're looking for the joy of just about putting anything into the game - creating an item mod for a simple set of items is a matter of half an hour, an hour tops, and the only real coding you need to do is copying and modifying a few lines in the "*.tp2" file to get it into the game. Very, very simple.

 

If you're more interested about *learning* rather than producing, I find the best way is to create your own NPC and go from there. Simply because it gives you very satisfying results quickly, can quite change your game experience, and it's very, very, very modular.
Which means you first find out how to create a "*.cre" file, then you go on and discover how to put it into the game, add dialogue to make it joinable. And then you go from there. Maybe the NPC gets a custom item, maybe you'll add a little bit of banter. Then you find yourself making a quest, and you realize how the journal works. Then you need enemies, so you program enemies, give them special items. Then you find for them to be immersive and believeable, you need a little AI script that fits their skills and personality/behaviour, so you go into AI scripting. At every turn you discover new things you could do and learn, and you start very simple and learn more and more complicated things as you go.
Plus, custom NPCS can very easily be created in such fashion, that they're perfectly compatible with virtually anything.

So, since the only thing that will really drive you part the few frustrations that you'll encounter is your joy in whatever you wish to do, you should ask yourself what you desire the most, what you want to get from BG2 modding and start there.