Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

So I've created my first .cre file... Now what?

IcecreamtubIcecreamtub Member Posts: 547
Title. Don't think I can export the .cre file either without the text files missing, but I'll post what I've done so far just to make sure I didn't miss anything else?

Comments

  • PaulaMigratePaulaMigrate Member Posts: 1,201
    edited June 2017
    There are loads of tutorials about how to enter your creature (with name, dialogues etc) into the game (not only your current install but any install).
    My advice is to go to a mod that does this. Look at the folder in your game directory and see those files. Open a file with the ending xxxx.tp2 with a text editor. It will introduce you to the magic world of Weidu which is what you need to progress.

    Just a hint: You can add the creture's script name, override script or dialogue file with Weidu actions through your mod install. However you can just as easily put them right into the cre file (like you did for the portrait).
    And maybe give the poor girl something to wear and some minimum equipment?

  • badungubadungu Member Posts: 53
    So, you have created your first creature, what do you want to do with it? Only copy it with weidu and assign a name?

    Example code:
    COPY ~filepath/Noa.cre~ ~override~ SAY NAME1 ~Noa~ SAY NAME2 ~Noa~

    If you want to change the override script with Weidu for example add something like this:

    WRITE_ASCII 0x248 ~scriptname~ #8

    If you want to add an 100 Arrows for example in Quiver 1:

    ADD_CRE_ITEM ~AROW01~ #100 #0 #0 ~IDENTIFIED~ ~QUIVER1~

    If you want to add 2 long sword pips:

    LPF ADD_CRE_EFFECT INT_VAR opcode = 233 parameter1 = 2 parameter2 = 90 timing = 9 END

    Also maybe you should reset the string references for offset 0xa4-0x230 or your creature couldstart talking gibberish, I would use some code like this:

    FOR (i = 0; i <= 396; i+=4) BEGIN SAY 0xa4+i #-1 END</code>

  • IcecreamtubIcecreamtub Member Posts: 547
    Well, the problem with all this is either that everyone is assuming I know even one thing (outside of multiple lines of code) about Weidu or I'm really just this stupid when it comes to text-based tutorials ._.

    Huh? Her... Equipment? I mean, he has gear, It's just not on that file yet. @PaulaMigrate

    @badungu It's a character mod, the likes of which I have no idea what I'm doing when things start to operate outside of Infinity Engine... I can understand those lines of text and what they reference too, but anything else :sweat:...

  • AstroBryGuyAstroBryGuy Member Posts: 3,414
    If you're interested in creating an NPC mod, check out the Branwen BG2 mod from @kulyok. It's a mod and a tutorial for modders. It will teach you how to create an NPC mod.

    http://forums.pocketplane.net/index.php?topic=28623.0

    tbone1
  • PaulaMigratePaulaMigrate Member Posts: 1,201
    Here are some hints
    http://gibberlings3.net/forums/index.php?showtopic=28564&hl=

    The example code by @badungu is something to put into your MyNoaMod.tp2 file. To install the file you make a simple copy of any setup-xxxxmod.exe you have in your game and rename the file to setup-MyNoaMod.exe. Then you create yourself a mod folder and put your tp2 and cre file into it + all the other files you later create.
    After you have done all that, you can C:CreateCreature("Noa") in the game and the named creature will appear. If you want heer to appear automatically you need to add her to a script etc. etc...

  • badungubadungu Member Posts: 53
    Hmm, maybe also the WeiDU Documentation should be mentioned, it helped me a lot when I started to learn WeiDU: http://www.weidu.org/~thebigg/README-WeiDU.html

    The IESDP is also a good place to look for Triggers/Actions/Opcodes/File Formats: https://gibberlings3.github.io/iesdp/index.htm

    PaulaMigrate
  • PaulaMigratePaulaMigrate Member Posts: 1,201
    badungu said:

    Hmm, maybe also the WeiDU Documentation should be mentioned, it helped me a lot when I started to learn WeiDU: http://www.weidu.org/~thebigg/README-WeiDU.html

    The IESDP is also a good place to look for Triggers/Actions/Opcodes/File Formats: https://gibberlings3.github.io/iesdp/index.htm

    Those are essential sources for details - the reason to say *look at a mod that does similar things* is, that it is about the only place where you see where all the individual pieces and files go and how they interact.
    Near Infinity is a great tool to see and experiment with file contents but again it tells you nothing about how you get your changes into the game or package your work for a mod.

  • IcecreamtubIcecreamtub Member Posts: 547
    @PaulaMigrate @AstroBryGuy

    I've gone over the Branwen Mod before (As she's my go-to anyway and it's funny that she became the tutorial staple for Modding), but I don't understand any of this stuff I'm reading... I'm super retarded and need very strict step-by-step instructions and for some blasted reason I don't understand anything about the Branwen Mod... I feel like a lost cause at this point. >.> It's really embarrassing. There's just something about reading tutorials and steps without someone around that really stifles me understanding capabilities. I'm going to assume it's entirely to do with my Autism. Thanks for all the help regardless though. Maybe someday I'll develop the human ability to understand all this stuff, one can only hope !

    semiticgod
  • semiticgodsemiticgod Member, Moderator Posts: 14,089
    edited June 2017
    @Icecreamtub: You'll need several things to start:

    1. First, download WeiDu from the WeiDu home page. When you unzip it, there's an executable file named weidu.exe. Rename it "Setup-Icecreametubmod.exe" or something to that effect. But it has to start with "Setup-" and has to end with the .exe suffix (which should already be there).
    2. You'll also need a folder for your mod. Copy the Branwen mod wholesale and rename it "Icecreamtubmod." A lot of the files in that folder will have nothing to do with your mod, but you can leave them inside the folder anyway; it won't hurt. This just makes sure you have all the little pieces in place.
    3. Open up a basic text document from Notepad or a similar program and rename it to give it the suffix

    .tp2

    If you don't know how to add a suffix (you add a period and then the suffix at the end of the file name), you can just copy the .tp2 file from the Branwen mod and delete all of its contents in Notepad.

    Anyway, that's your TP2 file, named "Icecreamtubmod.tp2."

    What are all these things? Well, the WeiDu file named "Icecreametubmod.exe" is the program that installs the mod for you. But the WeiDu program needs directions, and the TP2 file gives it directions. If you type the right commands into the TP2 file, the WeiDu program will do what you want when you run it.

    But first, these three things need to be in specific locations:

    1. The Icecreametubmod.exe file should be in your BG directory.
    2. The Icecreametubmod folder should be in your BG directory.
    3. The Icecreametubmod.tp2 file should be in the Icecreametubmod folder.

    If they're not in the right place, WeiDu won't know where to find the right files.

    So what do you type into the TP2 file? Well, start with this:

    BACKUP ~Icecreamtubmod/backup~
    AUTHOR ~Icecreamtub's email address~

    VERSION ~1.0~

    //MODDER

    AUTO_TRA ~Icecreamtubmod/tra/%s~

    /*
    * This mod does not use any chapter checks
    *
    ALWAYS
    ACTION_IF GAME_IS ~eet~ BEGIN
    OUTER_SET bg2_chapter = 12
    END ELSE BEGIN
    OUTER_SET bg2_chapter = 0
    END
    OUTER_FOR (i=1; i<=10; i=i+1) BEGIN
    OUTER_SET bg2_chapter = bg2_chapter + 1
    OUTER_SPRINT name_source ~bg2_chapter_%i%~
    OUTER_SET EVAL ~%name_source%~ = bg2_chapter
    END
    END
    */

    LANGUAGE ~English~
    ~English~
    ~Icecreamtubmod/tra/English/Icecreamtubmod.tra~

    BEGIN "Icecreamtub's Mod" //
    INCLUDE "Icecreamtubmod/lib/fl#add_kit_ee.tpa"

    (If you want to name the mod something besides "Icecreametubmod," just replace all instances of "Icecreametubmod" with the mod of your choice. Your folder and WeiDu file will also need to be renamed. Also, put your email in place of "Icecreametub's email address")

    (Some of those lines might not serve any purpose in your mod, but it won't hurt to include them)

    So what does that big hunk of text mean? Basically, it just initiates the mod. Without this, WeiDu won't do anything.

    After that, it depends on what you want your mod to do.

    Let's say you want to install a creature file with the file name BOATY. Let's say you want it to have the name Boaty McBoatface in-game. So you take your BOATY.cre file, copy it, and paste it into one of the subfolders in your Icecreamtubmod folder.

    Which subfolder? The one named "cre." That's where you put all of your .cre files.

    But to get the .cre file into the game, you need to tell WeiDu to copy it into the override folder. These three lines of code will do it:


    COPY ~Icecreamtubmod/cre/BOATY.cre~ ~override~
    0
    0


    The second and third lines don't show up properly on this website for some reason. The second one should be "SAY" followed by NAME1 followed by the @ sign, followed by a zero. The third one should be "SAY" followed by NAME2 (not NAME1, but NAME2) followed by the @ sign, followed by a zero. There is a space between SAY and NAME1, and a space between NAME1 and the @ sign, but there is no space between the @ sign and the zero.

    The first line, with COPY in it, just copies the BOATY.cre file from the "cre" folder and moves it to the override folder. It is now in the game. But what about those other two lines?

    Those are the in-game names of the creature in question. Critters have two names, which is why it's NAME1 and NAME2. Both of them are set to @0, which corresponds to a specific line in your TRA file.

    Wait, what's a TRA file?

    The TRA file is where you store names and dialog strings and stuff like that. To find it, go to the Icecreamtubmod folder, then go to the subfolder named "tra," then go to the next subfolder named "English," and inside, you should find a file name "Branwen." Rename it "Icecreamtubmod" and open it up.

    (If you're not copy all of your stuff from the Branwen folder, you can create the TRA folder yourself by creating a text document and giving it the suffix .tra)

    Delete everything in the Icecreamtubmod.TRA file; you won't need any of the Branwen stuff. Type this at the top of the document:

    @0 = ~Boaty McBoatface~

    That's all you need for now. With that name in the TRA file, your TP2 file now knows what "@0" means. So when you run WeiDu, it will not just copy over the .cre file. It will also give it the name "Boaty McBoatface," taken from your TRA file!

    So if you wanted to create a mod named "Icecreametubmod," and the only thing you wanted to do is copy over a single creature and give it a new name, your entire TP2 file would be this:

    BACKUP ~Icecreamtubmod/backup~
    AUTHOR ~Icecreamtub's email address~

    VERSION ~1.0~

    //MODDER

    AUTO_TRA ~Icecreamtubmod/tra/%s~

    /*
    * This mod does not use any chapter checks
    *
    ALWAYS
    ACTION_IF GAME_IS ~eet~ BEGIN
    OUTER_SET bg2_chapter = 12
    END ELSE BEGIN
    OUTER_SET bg2_chapter = 0
    END
    OUTER_FOR (i=1; i<=10; i=i+1) BEGIN
    OUTER_SET bg2_chapter = bg2_chapter + 1
    OUTER_SPRINT name_source ~bg2_chapter_%i%~
    OUTER_SET EVAL ~%name_source%~ = bg2_chapter
    END
    END
    */

    LANGUAGE ~English~
    ~English~
    ~Icecreamtubmod/tra/English/Icecreamtubmod.tra~

    BEGIN "Icecreamtub's Mod" //
    INCLUDE "Icecreamtubmod/lib/fl#add_kit_ee.tpa"

    COPY ~Icecreamtubmod/cre/BOATY.cre~ ~override~
    0
    0

    And your entire TRA file would be this:

    @0 = ~Boaty McBoatface~

    And your Icecreamtubmod folder would have only a few things in it:

    1. Your TP2 file, named Icecreamtubmod.tp2.
    2. Your "lib" folder, which contains the "English" folder, which contains your TRA file, named Icecreamtubmod.tra.
    3. Your "cre" folder, which contains the BOATY.cre file.
    4. All of the random crap that comes with the Branwen mod.

    What else do you need to know?

  • semiticgodsemiticgod Member, Moderator Posts: 14,089
    edited June 2017
    As I mentioned, two of the lines for your TP2 file won't show up properly on the website. To see them, click "quote" underneath this post and look at the text inside the following spoiler:




    COPY ~Icecreamtubmod/cre/BOATY.cre~ ~override~
    0
    0



  • IcecreamtubIcecreamtub Member Posts: 547
    @semiticgod You're my new favourite person. Like, seriously (Not more than Shandyr, but 2nd/joint 1st is still great, right?!). This couldn't have possibly been anymore help than I needed. ;-; I've been struggling over tutorial posts (since freakin' March last year when I started up my Mod) and now I can get on with actually throwing things into WeiDu... >.>; #LongestModEver

    I still feel very embarrassed and emotionally raw, but at least it's good embarrassment and tears of joy ! ...Right?

    Uhm, I'll try to get on with naming everything first before I ask any questions, but just in-case the first question I'll be asking is "Does this save all the text files I wrote up when I export the .cre file/Do I have to write everything outside of Infinity Engine so it creates new files? (I assume the latter since this would not rename any other strings beyond "THE SCOURGE OF BAELOTH'S PITS!" in BG2)

    I'm not sure what the semantic order of writing speech lines is, but I'm currently making sure they all are in order from start to finish so that things don't get jumbled and end up with files half-way down the list that should technically all be one long string.

  • IcecreamtubIcecreamtub Member Posts: 547
    Perhaps this would also all be easier over something less finicky as the Forums? Voice chat always does wonders >.<

  • semiticgodsemiticgod Member, Moderator Posts: 14,089
    @Icecreamtub: Learning WeiDu can be tricky. I think the only reason I ever learned it was because @Musigny gave me a template for my first kit, and I got many other bits of code from people like @subtledoctor and @kjeron and @Grammarsalad. I owe it to them.

    I'm not sure I understand your question. Your TP2 and TRA files will never get overwritten by anything, and as for the names of your critters, using the SAY function in WeiDu will always overwrite whatever you've given them in Near Infinity or DLTCEP.

    The general rule is to never edit any strings using Near Infinity or DLTCEP. Whenever you need to create a new description or name or dialogue or any form of text, you only use WeiDu. All strings are contained in one big honkin' dialog.tlk file, which means directly tweaking it without causing adverse effects is virtually impossible. WeiDu was designed specifically to address that problem by creating a systematic and consistent way of creating and storing new strings.

  • IcecreamtubIcecreamtub Member Posts: 547
    edited June 2017
    @semiticgod

    Well, the stuff seems easy enough if you already spent all your freetime in RPG Maker growing up and Infinity Engine since coming to this Forum back in like, 2012. (I remember the day I signed up! Woooo!)

    It's just the whole WeiDu thing is completely outside of my other hobbies, creating the lines looks tedious to most but to me it seems simple enough. Just never used WeiDu before and every time I think about using it, this random pressure and anxiety just kill off my drive... Or, well, it did before you explained everything to me. Now it's just the time constraint and "crowd pleasing" of my already beyond dead original Mod Post.

    Oh. That'll be why you didn't understand what I meant then... I made all my files in the dialogue.txt file, so I will go reset that. Thankfully I backed it up, so I can just copy-paste every line to a notepad before a second game refresh... >.> At least I've only had to refresh Dialogue.tlk twice since March 2016!

    Can I please make you my agony uncle and just pester you for all my future worries and needs? *coughs*

    semiticgod
  • semiticgodsemiticgod Member, Moderator Posts: 14,089
    @Icecreamtub: I can probably answer some basic questions. Other, more experienced modders will be able to help you with more complicated stuff.

Sign In or Register to comment.