Jump to content


Photo

When beginning to code. . .


  • Please log in to reply
14 replies to this topic

#1 Minchan

Minchan
  • Member
  • 5 posts

Posted 09 August 2013 - 06:56 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 . . . ?

 

 



#2 Kulyok

Kulyok
  • Modder
  • 2450 posts

Posted 09 August 2013 - 08:07 PM

A romance expansion mod would be easier - you'll just need to code all the dialogue, and the scripting is fairly straightforward. The downside is that you'll either have to go without a flirt pack or risk incompatibilities... and I'm not sure if there's a good Bioware character left. Cernd romance? The fourth(or fifth?) version of Valygar? Another Yoshimo?

 

NPC is a little trickier - some .tp2 scripting, a cre file - all rather annoying things. But it's still easier that some of that crazy Fixpack code. :) The downside is that there are too many NPCs around - a romance/friendship expansion for a nice Bioware guy or gal might prove to be more popular.



#3 Tempest

Tempest

    Cue Ominous Music

  • Modder
  • 6572 posts

Posted 10 August 2013 - 07:28 AM


The downside is that you'll either have to go without a flirt pack or risk incompatibilities... and I'm not sure if there's a good Bioware character left. Cernd romance? The fourth(or fifth?) version of Valygar? Another Yoshimo?

 

Mazzy springs to mind immediately.


"The righteous need not cower before the drumbeat of human progress. Though the song of yesterday fades into the challenge of tomorrow, God still watches and judges us. Evil lurks in the datalinks as it lurked in the streets of yesterday, but it was never the streets that were evil." - Sister Miriam Godwinson, Sid Meier's Alpha Centauri


#4 Kulyok

Kulyok
  • Modder
  • 2450 posts

Posted 10 August 2013 - 08:03 AM

I agree. Not for me, since she hit on Valygar pretty hard(really not a fan of PC's interest-NPC romances here), but given how she's voiced by the amazing Commander Shepard and Snowking's Mazzy Romance is sitting on the back burner pretty much dead, she's definitely an option.



#5 Minchan

Minchan
  • Member
  • 5 posts

Posted 10 August 2013 - 07:23 PM

Well, I definitely wouldn't mind writing something for Valygar, since I can't find any romance mods for him except the RE one and Tortured Souls, which adds a lot of other things I haven't been sold on, even if I could find a version that wasn't designed for Big Picture.

 

I'm definitely thinking something for Minsc or Mazzy, or a friendship with Aerie since there doesn't seem to be one yet, would all be fun to write. Or a friendship with Jaheira or Anomen, since the only love interest who's gotten a friendship mod so far has been Viconia. I feel like I might be encroaching there, though . . . . 

 

I've heard about Mazzy trying to make Valygar her squire, and from what I've gotten from that that doesn't necessarly seem like she's hitting on him to me . . . ? But as I've mentioned I haven't really gotten far. . . . I've just noticed that a lot of the time people comment that a character is totally interested in a different character, but most of the time it's not backed up. I know the Haer'Dalis / Aerie / Charname thing is a thing, but. . . 

 

Anyway, most of this isn't really relevant, whoops!

 

What I really want to ask about is -- the Edwin, Haer'Dalis and Sarevok mods all added flirts, and I've never read anything about incompatabilities for them. What kind of incompatabilities would I need to worry about? I know the Imoen Romance mod has some coding issues of that sort, but from what I understood it wasn't really coded very well to begin with, and coding techniques have marched on past it anyway . . . .



#6 Kulyok

Kulyok
  • Modder
  • 2450 posts

Posted 10 August 2013 - 10:55 PM

It means that no other mod will be able to add player-initiated dialogue to them. That's why we had to work together on BG1 NPC, for example, instead of separate releases - so that regular PID and flirts could work together. It also means that if another modder wrote a dialogue for them and didn't add WEIGHT command, the mods would be incompatible(it gets resolved, but it takes months). That's why it's recommended that NPC Flirt Pack should be installed after NPC and NPC-related mods, and most mods like Edwin romance try to make flirts a separate component.



#7 Kulyok

Kulyok
  • Modder
  • 2450 posts

Posted 10 August 2013 - 11:00 PM

Oh, Valygar - there's another romance for him by Domi, Corthala Romantique. I had an alpha, but I think I lost it - it had all the content, though. I think Meira wanted to edit it and release it, but she disappeared, and so did the romance. It's not exactly the Tortured Souls version, because it adds lots of other things(maybe 30% are the same? not sure).



#8 Crazee

Crazee
  • Modder
  • 533 posts

Posted 11 August 2013 - 02:48 AM

I certainly wouldn't worry about encroaching re: friendships with any of the characters. So far, friendships have been written as part of a collaborative mod called NPC IEP. If you write a good friendship track and think it would make a good addition, just e-mail someone from the IEP team. If you'd rather keep it separate, that's cool too. You can't have too many mods, and even if another friendship track is written, it just offers people more choice  :)



#9 Minchan

Minchan
  • Member
  • 5 posts

Posted 11 August 2013 - 08:10 AM

Oh, I see~! So it would probably be a good idea to do the same thing, and have the flirt packs be a seperately installed component. I was wondering how that would work, and I guess the answer is that it wouldn't, eheh! In the case of another modder writing dialogue for them, would that be like in the extended banter packs? I'm assuming this is it, but not sure. . . . And this is a good reminder that regardless of what I code, I will need to add weights to things!

 

Ooooh, curses! If I'd gotten Baldur's Gate working again just a little sooner . . .

 

Okay, this is good news then. *0*~

 

And I agree, having too many mods should never be a problem~ uwu



#10 Darius

Darius
  • Member
  • 3 posts

Posted 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.



#11 Minchan

Minchan
  • Member
  • 5 posts

Posted 24 August 2013 - 12:15 PM

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



#12 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 24 August 2013 - 01:00 PM

My pro tips for coding:

1. Write romances for everyone

2. Copy everyone's code

3. Insert witty banters everywhere



#13 Darius

Darius
  • Member
  • 3 posts

Posted 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.


Edited by Darius, 28 August 2013 - 05:44 AM.


#14 Aion

Aion

    Soul Of Magma

  • Member
  • 505 posts

Posted 31 August 2013 - 11:46 PM

I have an Aerie Relationship mod in progress, with new friendship track for any PC and a female PC/Aerie romance. That said, you're free to make your own Aerie expansion too, of course.

 

And yes, a full NPC is more work and more complicated, but it does cover quite a bit of the necessary coding. I'm still learning myself, but so far it's been okay. The concept of what the stuff does is understandable, though I'll never enjoy coding, that much I'll admit. Don't let anyone discourage you with the "there's too many NPC's" commentary. I personally love NPC mods and Expansion mods. Remember, you're modding for your enjoyment, to see something in the game that you enjoy. Chances are big that others will enjoy it as well, seeing there's many players still. You can't please everybody, but you can create something that will make you happy.

 

I'd also advise you to complete a vanilla run of BG2, including Throne Of Bhaal, before releasing your mod.

It becomes easier to know what to write dialogue for if you've actually seen/met the scenes and characters in the game, including the latter part of the game (after Spellhold). It opens up more options, more locations, more things for your imagination/creativity to work with.



#15 Minchan

Minchan
  • Member
  • 5 posts

Posted 21 September 2013 - 08:31 PM

Oh wow! Thank you so much!