Miloch Posted March 21, 2012 Share Posted March 21, 2012 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. Quote Link to comment
Echon Posted March 21, 2012 Share Posted March 21, 2012 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. Quote Link to comment
Miloch Posted March 22, 2012 Share Posted March 22, 2012 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.). Quote Link to comment
Echon Posted March 22, 2012 Share Posted March 22, 2012 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. Quote Link to comment
Miloch Posted March 23, 2012 Share Posted March 23, 2012 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. Quote Link to comment
Echon Posted March 23, 2012 Share Posted March 23, 2012 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. Quote Link to comment
Miloch Posted March 23, 2012 Share Posted March 23, 2012 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. Quote Link to comment
Echon Posted March 23, 2012 Share Posted March 23, 2012 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. Quote Link to comment
Miloch Posted March 23, 2012 Share Posted March 23, 2012 Just FYI, if you do end up doing anything with proficiencies, SET_BG2_PROFICIENCY is slightly easier to use than ADD_CRE_EFFECT. Quote Link to comment
CanWakhan Posted February 28, 2014 Share Posted February 28, 2014 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. Quote Link to comment
jastey Posted February 28, 2014 Share Posted February 28, 2014 Have a look at cmorgan's example code in this post: http://forums.gibberlings3.net/index.php?showtopic=10003&view=findpost&p=95109 Maybe it answers your overall question. To your script block: Keep in mind that Candlekeep is Prologue, not Chapter One. Quote Link to comment
CanWakhan Posted March 3, 2014 Share Posted March 3, 2014 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. Quote Link to comment
jastey Posted June 28, 2015 Share Posted June 28, 2015 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. Quote Link to comment
jastey Posted October 27, 2017 Share Posted October 27, 2017 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 Quote Link to comment
jastey Posted January 1, 2021 Share Posted January 1, 2021 I found a wrong entry in all current cpmvars.tpa - at least the ones I am using. For example for BG:EE, the entry for "Beregost_House08" is doubled for both floors of the house and reads currently: Quote OUTER_SPRINT "Beregost_House08" "AR3355" OUTER_SPRINT "Beregost_House08" "AR3356" I suggest changing this to the following for all cpmvars.tpa not to break existing code in mods: Adding a "_L2" to the entry of the second floor: Quote OUTER_SPRINT "Beregost_House08" "AR3355" OUTER_SPRINT "Beregost_House08_L2" "AR3356" Same for the script assignment - if it is included. This: Quote OUTER_SPRINT "Beregost_House08_BCS" "AR3355" OUTER_SPRINT "Beregost_House08_BCS" "AR3356" Should be this: Quote OUTER_SPRINT "Beregost_House08_BCS" "AR3355" OUTER_SPRINT "Beregost_House08_L2_BCS" "AR3356" Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.