Jump to content
cmorgan

Crossing the Great Divide

Recommended Posts

The areas are the only ones that really significantly differ between BGT, Tutu and BG1. The list in my signature or in the IESDP (or jastey's libraries) has these. I started using a slightly new method in my latest tri-platform mod. Since the last two digits of area names are *usually* the same between platforms, I just have a fairly small list of variables for the area prefix (either AR or FW) and the first two digits. Other than that, Tutu usually adds an underscore to references. If the reference was already 8-characters, it deletes the first character to add the underscore. And as jastey says, BGT adds BG to some resources to avoid conflict with BG2 resources. There's a fairly small list of these and it's in the Developer Documentation (under resource renaming) in BGT. Variables can account for all these things fairly easily. I also have some functions that convert resources from Tutu to BGT/BG1 on the fly when installing the mod. If you want, I can add you to the workroom or send you a link to the beta to look at the code.

Share this post


Link to post
I also have some functions that convert resources from Tutu to BGT/BG1 on the fly when installing the mod. If you want, I can add you to the workroom or send you a link to the beta to look at the code.

 

Maybe I am missing something but would that not only be useful if you already have a mod that is compatible with Tutu?

 

Anyway, thanks for the clarification. I just need to solve that function issue and then I am ready to get started.

Share this post


Link to post
Maybe I am missing something but would that not only be useful if you already have a mod that is compatible with Tutu?
Yeah, but it could be reverse-engineered fairly easily. The main reason I did from Tutu to BG1 is that you have to strip out a lot of stuff (opcodes over a certain number etc.) for the BG1 engine, which is a lot easier than adding stuff in when going from BG1 to Tutu. Also, all weapon proficiencies need to be set at zero in BG1 (or will crash the game); Tutu/BGT use BG2 proficiencies which isn't always self-evident (you may have one "large sword" that's a scimitar, another that's a bastard sword, etc.).

Share this post


Link to post
Also, all weapon proficiencies need to be set at zero in BG1 (or will crash the game); Tutu/BGT use BG2 proficiencies which isn't always self-evident (you may have one "large sword" that's a scimitar, another that's a bastard sword, etc.).

 

This is one of the issues I am aware of. Another is EFF v1 vs v2. Do you know how Tutu and BGT update the weapon proficiencies? For FotD I have been thinking about a REGEXP that looks at all the old ones, notes the number of proficiencies and assigns the equivalent new ones, so 3 slots in Large Swords will become 3 slots in every weapon that Large Sword includes, plus any new ones.

Share this post


Link to post
Do you know how Tutu and BGT update the weapon proficiencies? For FotD I have been thinking about a REGEXP that looks at all the old ones, notes the number of proficiencies and assigns the equivalent new ones, so 3 slots in Large Swords will become 3 slots in every weapon that Large Sword includes, plus any new ones.
The BG2 engine recognises BG1 proficiencies as coded on the CRE files without EFFs. So you don't really need to worry about this unless you have joinable NPCs. For those, Tutu and BGT assigned seemingly-random proficiencies, which in some case didn't make any sense at all. BGT later fixed this; Tutu did not. It should've looked at whatever weapons the original characters had and assigned the relevant BG2 proficiencies. Unless the character did not have the strength requirement to wield the weapon (this was unenforced in BG1, but e.g. Quayle hasn't the strength to wield his flail in the BG2 engine) in which case an alternate determined. Some allowances would be made for weapon styles (i.e. two weapon fighting, sword and shield). This is possibly the only thing you should consider, and only then if you have CREs where it would make sense to give them weapon style proficiencies.

Share this post


Link to post

So the old proficiencies work in BG2. Good. I am not sure what you mean by 'without EFFs', though.

 

I guess I will just have to fix the NPC proficiencies for Tutu then. :)

Share this post


Link to post

I mean BG1-style proficiencies are just byte offsets in the CRE files (from 0x6e to 0x75). BG2-style proficiencies require attached EFF structures. You do, however, want to run your BG1 CREs through the FJ_CRE_EFF_V2 function when you copy them on Tutu/BGT just in case you or someone else does add EFFs to them for something (so they use BG2 v2 EFFs instead of the BG1 v1 EFF structure). Nowadays, whatever code that does that will usually invoke FJ_CRE_EFF_V2 anyway, but might as well be safe.

 

Re: NPC proficiencies, I hammered that out with Asc64 a while back - might as well just use that for Tutu too.

Share this post


Link to post

Heh, I had no idea BG2 proficiencies were stored as EFFs. And yes, I do want to use FJ_CRE_EFF_V2, as well as that spreadsheet of yours.

Share this post


Link to post

Just FYI, if you do end up doing anything with proficiencies, SET_BG2_PROFICIENCY is slightly easier to use than ADD_CRE_EFFECT.

Share this post


Link to post

Hello. Is there anyone who could explain to me how properly use chapter numbers, by any chance? I was trying to figure out how it works, after showed up that I couldn't make it work properly at first place, but after multiple try I feel like helping hand is what I need most. I now how to go around it, but I would prefer to know how to use this one.

 

For examlpe I have had something similiar to this one, tried with different chapter number and also with GlobalGT/LT:

 

IF

%BGT_VAR%

AreaCheck("%Candlekeep_Inn_L1%")

Global("Chapter","GLOBAL",%tutu_chapter_1%)

Global("CW_SaelDoubleExists","GLOBAL",0)

THEN

RESPONSE #100

CreateCreature("CW_SaelD",[169.451],10)

SetGlobal("CW_SaelDoubleExists","GLOBAL",1)

Continue()

END

 

It spawns a creature only if I remove that stance. So I assume that I'm doing something wrong, but I have no idea what(Probably it is small and silly :) )

 

I would be glad if someone elucidate it for me.

Share this post


Link to post

Thank you jastey. I've had to missed those few posts earlier, somehow. Very helpful. And I finally understand whole idea.

 

About script: Thank you for pointing that - not because I am using that script, but I was convinced that it should be "0" when refering to prolouge. Now everything works.

Share this post


Link to post

I was sure I posted this here already, but I cannot find it anymore. Here is DavidW's very cool function for patching area scripts in crossplatform style:

 

The following goes into the ALWAYS block:

DEFINE_ACTION_FUNCTION extend_area_script 
    STR_VAR area=""
            top=""
            bottom=""
BEGIN
    // find the area script from the area file
    COPY_EXISTING "%area%.are" override
           READ_ASCII 0x94 script
    BUT_ONLY
    // if it doesn't exist, give it a default name
    ACTION_IF "%script%" STRING_EQUAL "" BEGIN
          OUTER_INNER_PATCH_SAVE script "%area%" BEGIN
                REPLACE_TEXTUALLY "FW" "_AR" // TUTU naming conventions
          END
    END
    // extend the script
    ACTION_IF "%top%" STRING_COMPARE "" BEGIN
        EXTEND_TOP "%script%.bcs" "%top%" EVALUATE_BUFFER
    END
    ACTION_IF "%bottom%" STRING_COMPARE "" BEGIN
       EXTEND_BOTTOM "%script%.bcs" "%bottom%" EVALUATE_BUFFER
    END
END 

Now we can just do area-script patches like this:

For EXTEND_TOP:

LAF extend_area_script STR_VAR area="%CandlekeepStorage%" top="bg1re/TlCher/TlCher_AR2606.baf" END

For EXTEND_BOTTOM:

LAF extend_area_script STR_VAR area="%CandlekeepStorage%" bottom="bg1re/TlCher/TlCher_AR2606.baf" END

I think this should cover EET, too.

Share this post


Link to post

All links to the "G3 Development Wikki." are dead.

 

I wrote g3_dreamscript_cpmvars.tpa with the dream scripts for BG:EE, Tutu, BGT, and EET. Since all the cmpv.tpas are already written and spread across several mods, I made it an own file to be INCLUDEd fo all games.

I'll attach it here, is there a better way to provide this?

 

To use the attached "g3_dreamscript_cpmvars.tpa", put it into your %MOD_FOLDER%/lib folder and put this into the ALWAYS block of your mod:

/* include dream scripts */
INCLUDE ~%MOD_FOLDER%/lib/g3_dreamscript_cpmvars.tpa~

g3_dreamscript_cpmvars.tpa

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...