EiriktheScald Posted February 17, 2007 Share Posted February 17, 2007 I cobbled up Eirik's tp2 and would like someone to look it over; for peace of mind, before I try it out. BACKUP ~eirik/backup~ AUTHOR ~EiriktheScald - contact at http://forums.gibberlings3.net~ AUTO_TRA ~eirik/%s~ LANGUAGE ~English~ ~english~ ~eirik/english/setup.tra~ BEGIN @150 COPY ~eirik/graphics~ ~override~ // Compiling scripts and dialogs COMPILE ~eirik/dialogs~ USING ~eirik/%s/dialogs.tra~ COMPILE ~eirik/scripts~ USING ~eirik/%s/dialogs.tra~ COPY_EXISTING ~eseirik.bcs~ ~override/eseirik.bcs~ REPLACE_TEXTUALLY 999997 ~%Eirik%~ // Extending existing scripts EXTEND_TOP ~FW2800.bcs~ ~override/esfw2800.bcs~ // Appending .2da files APPEND ~pdialog.2da~ ~EsEirik EsEirikP EsEirikJ EsEirikD EsEir25P EsEir25J EsEir25D EsEirik25~ UNLESS ~EsEirik~ APPEND ~interdia.2da~ ~EsEirik EsEirikB EsEirB25~ UNLESS ~EsEirik~ // Creatures COPY ~eirik/creatures/eseirik.cre~ ~override/eseirik.cre~ SAY NAME1 @100 SAY NAME2 @100 SAY MORALE @102 SAY HAPPY @103 SAY UNHAPPY_ANNOYED @104 SAY UNHAPPY_SERIOUS @105 SAY UNHAPPY_BREAKING @106 SAY LEADER @107 SAY TIRED @108 SAY BORED @109 SAY BATTLE_CRY1 @110 SAY BATTLE_CRY2 @111 SAY BATTLE_CRY3 @112 SAY BATTLE_CRY4 @113 SAY DAMAGE @114 SAY DYING @115 SAY HURT @116 SAY AREA_FOREST @117 SAY AREA_CITY @118 SAY AREA_DUNGEON @119 SAY AREA_DAY @120 SAY AREA_NIGHT @121 SAY SELECT_COMMON1 @122 SAY SELECT_COMMON2 @123 SAY SELECT_COMMON3 @124 SAY SELECT_COMMON4 @125 SAY SELECT_COMMON5 @126 SAY SELECT_COMMON6 @127 SAY SELECT_ACTION1 @128 SAY SELECT_ACTION2 @129 SAY SELECT_ACTION3 @130 SAY SELECT_ACTION4 @131 SAY SELECT_ACTION5 @132 SAY SELECT_ACTION6 @133 SAY SELECT_ACTION7 @134 SAY SELECT_RARE1 @135 SAY SELECT_RARE2 @136 SAY CRITICAL_HIT @137 SAY CRITICAL_MISS @138 SAY TARGET_IMMUNE @139 SAY INVENTORY_FULL @140 SAY BIO @144 // Items COPY ~eirik/bams~ ~override~ COPY ~eirik/items/eshelm01.itm~ ~override/eshelm01.itm~ SAY NAME1 #6346 SAY NAME2 @201 SAY UNIDENTIFIED_DESC #6807 SAY DESC @202 COPY ~eirik/items/esbrooch.itm~ ~override/esbrooch.itm~ SAY NAME1 @203 SAY NAME2 @205 SAY UNIDENTIFIED_DESC @204 SAY DESC @206 // Audio install/uninstall AT_NOW ~sh Eirik/EirikUnpack.sh~ AT_UNINSTALL ~sh Eirik/EirikUninstall.sh~ Link to comment
cmorgan Posted February 17, 2007 Share Posted February 17, 2007 EiriktheScald, isn't this a Tutu mod? if so, hold on a second... ok, some changes and then some additional questions for others to answer /* * "Eirik" * Version Alpha 1 * EiriktheScald * February 17, 2007 */ /* Backup folder */ BACKUP ~eirik/backup~ /* Author */ AUTHOR ~EiriktheScald - contact at http://forums.gibberlings3.net~ ALWAYS /* Makes sure it is on Tutu or a BGT install */ ACTION_IF FILE_EXISTS_IN_GAME ~FW0100.ARE~ THEN BEGIN PRINT ~Tutu Install Detected~ END ELSE BEGIN FAIL ~Eirik is currently a Tutu-only NPC.~ END /* launch the ReadMe file on exit from install */ //AT_INTERACTIVE_EXIT ~VIEW eirik/EirikReadMe.html~ //Eirik, uncomment this when you have one! END /* Language Settings */ AUTO_TRA ~eirik/%s~ LANGUAGE ~English~ ~english~ ~eirik/english/setup.tra~ /* BEGIN EiriktheScald */ BEGIN @150 /* .2da patching */ APPEND ~interdia.2da~ ~EsEirik EsEirikB~ UNLESS ~EsEirik~ APPEND ~pdialog.2da~ ~EsEirik EsEirikP EsEirikJ~ UNLESS ~EsEirik~ /* Graphics prep */ COPY ~eirik/graphics~ ~override~ /* Compiling scripts and dialogs */ COMPILE ~eirik/dialogs~ USING ~eirik/%s/dialogs.tra~ COMPILE ~eirik/scripts~ USING ~eirik/%s/dialogs.tra~ //Another person will have to check this, as I am having troubles //with AUTO_TRA and USING. I think you are trying to have everything //in one big .tra, compiling a full directory at a time, //which should go fine... just someone else //needs to doublecheck :) // COPY_EXISTING ~eseirik.bcs~ ~override/eseirik.bcs~ // REPLACE_TEXTUALLY 999997 ~%Eirik%~ // I am not sure what you are doing here; // usually you use COMPILE to create a BCS from a BAF // and you definitely can't R_T in a precompiled BCS! //you compile this above, I assume, so // I think you want COPY_EXISTING ~eseirik.bcs~ ~override/eseirik.bcs~ DECOMPILE_BCS_TO_BAF REPLACE_TEXTUALLY 999997 ~%Eirik%~ COMPILE_BAF_TO_BCS //but why are you doing this? /* Creatures */ COPY ~eirik/creatures/eseirik.cre~ ~override/eseirik.cre~ SAY NAME1 @100 SAY NAME2 @100 SAY MORALE @102 SAY HAPPY @103 SAY UNHAPPY_ANNOYED @104 SAY UNHAPPY_SERIOUS @105 SAY UNHAPPY_BREAKING @106 SAY LEADER @107 SAY TIRED @108 SAY BORED @109 SAY BATTLE_CRY1 @110 SAY BATTLE_CRY2 @111 SAY BATTLE_CRY3 @112 SAY BATTLE_CRY4 @113 SAY DAMAGE @114 SAY DYING @115 SAY HURT @116 SAY AREA_FOREST @117 SAY AREA_CITY @118 SAY AREA_DUNGEON @119 SAY AREA_DAY @120 SAY AREA_NIGHT @121 SAY SELECT_COMMON1 @122 SAY SELECT_COMMON2 @123 SAY SELECT_COMMON3 @124 SAY SELECT_COMMON4 @125 SAY SELECT_COMMON5 @126 SAY SELECT_COMMON6 @127 SAY SELECT_ACTION1 @128 SAY SELECT_ACTION2 @129 SAY SELECT_ACTION3 @130 SAY SELECT_ACTION4 @131 SAY SELECT_ACTION5 @132 SAY SELECT_ACTION6 @133 SAY SELECT_ACTION7 @134 SAY SELECT_RARE1 @135 SAY SELECT_RARE2 @136 SAY CRITICAL_HIT @137 SAY CRITICAL_MISS @138 SAY TARGET_IMMUNE @139 SAY INVENTORY_FULL @140 SAY BIO @144 BUT_ONLY_IF_IT_CHANGES /* Items */ COPY ~eirik/bams~ ~override~ COPY ~eirik/items/eshelm01.itm~ ~override/eshelm01.itm~ SAY NAME1 #6346 SAY NAME2 @201 SAY UNIDENTIFIED_DESC #6807 //this may only work on a single platform - even on just Tutu, better to use .tra in my opinion SAY DESC @202 BUT_ONLY_IF_IT_CHANGES COPY ~eirik/items/esbrooch.itm~ ~override/esbrooch.itm~ SAY NAME1 @203 SAY NAME2 @205 SAY UNIDENTIFIED_DESC @204 SAY DESC @206 BUT_ONLY_IF_IT_CHANGES /* Audio install/uninstall */ AT_NOW ~sh Eirik/EirikUnpack.sh~ AT_UNINSTALL ~sh Eirik/EirikUninstall.sh~ Link to comment
EiriktheScald Posted February 17, 2007 Author Share Posted February 17, 2007 Yes, that's right -- tutu mod. [Edit:] I followed theacefes' tutorial, but don't know what is/is not applicable to Tutu. Link to comment
Miloch Posted February 17, 2007 Share Posted February 17, 2007 /* Language Settings */AUTO_TRA ~eirik/%s~ LANGUAGE ~English~ ~english~ ~eirik/english/setup.tra~ Wouldn't you put this before the other strings so you can TRA them too?REPLACE_TEXTUALLY 999997 ~%Eirik%~ COMPILE_BAF_TO_BCS //but why are you doing this? Same question here.SAY UNIDENTIFIED_DESC #6807 //this may only work on a single platform - even on just Tutu, better to use .tra in my opinionStandard (and unidentified in this case) item descriptions use the same string refs on BG1, Tutu, EasyTutu, BGT and BG2 (and as I've commented elsewhere, why make extra work for the translators and for yourself). If that isn't the case on your platform, you're going to have serious other issues besides installing Eirik. but don't know what is/is not applicable to Tutu.Offhand, it could probably be BGT compatible without too much work. Seems you're doing all custom items, so you don't have to worry much about underscores in BAMs or not (and if you do, it's easy to resolve either way using a variable for the underscore based on platform detection - but don't worry about that now). Edit: Oh, as to what in the tutorial is or isn't Tutu-relevant, I don't know, I haven't read it. But if it was developed for BG2, most of it should be relevant to Tutu (and BGT) I guess - same engine. Link to comment
EiriktheScald Posted February 17, 2007 Author Share Posted February 17, 2007 EiriktheScald, isn't this a Tutu mod? if so, hold on a second... ok, some changes and then some additional questions for others to answer /* Compiling scripts and dialogs */ COMPILE ~eirik/dialogs~ USING ~eirik/%s/dialogs.tra~ COMPILE ~eirik/scripts~ USING ~eirik/%s/dialogs.tra~ //Another person will have to check this, as I am having troubles //with AUTO_TRA and USING. I think you are trying to have everything //in one big .tra, compiling a full directory at a time, //which should go fine... just someone else //needs to doublecheck :) That's correct. // COPY_EXISTING ~eseirik.bcs~ ~override/eseirik.bcs~ // REPLACE_TEXTUALLY 999997 ~%Eirik%~ // I am not sure what you are doing here; // usually you use COMPILE to create a BCS from a BAF // and you definitely can't R_T in a precompiled BCS! //you compile this above, I assume, so // I think you want COPY_EXISTING ~eseirik.bcs~ ~override/eseirik.bcs~ DECOMPILE_BCS_TO_BAF REPLACE_TEXTUALLY 999997 ~%Eirik%~ COMPILE_BAF_TO_BCS //but why are you doing this? I thought this was for bgt compatibility. Are you saying I don't need this? Also, you removed this: // Extending existing scripts EXTEND_TOP ~FW2800.bcs~ ~override/esfw2800.bcs~ Without it, how does my area script get added to the game? Link to comment
Miloch Posted February 17, 2007 Share Posted February 17, 2007 // Extending existing scripts EXTEND_TOP ~FW2800.bcs~ ~override/esfw2800.bcs~ Without it, how does my area script get added to the game? I think the preferred syntax would be something like:EXTEND_BOTTOM ~_AR2800.bcs~ ~Eirik/scripts/esfw2800.baf~ But I could be wrong. You can also substitute a variable for the _AR2800 and add something like this after your Language section: ACTION_IF FILE_EXISTS_IN_GAME ~FW0100.ARE~ THEN BEGIN //Tutu OUTER_SPRINT ~cwscr~ ~_AR2800~ //Coast Way script END ELSE BEGIN ACTION_IF FILE_EXISTS_IN_GAME ~AR7200.ARE~ THEN BEGIN //BGT OUTER_SPRINT ~cwscr~ ~AR6900~ //Coast Way script END ELSE BEGIN FAIL @1 //This mod only installs on Tutu, EasyTutu and BGT. END Link to comment
Nythrun Posted February 17, 2007 Share Posted February 17, 2007 Generally, you use REPLACE on a non-binary file when that file contains a reference to a string that needs to be added to the game. If you've got a DisplayStringHead in that .baf, and the string doesn't yet exist, you'd do a REPLACE 999997 @100 (or whatever the numbers actually are, WeiDU will sort it out). It's not really a BGT issue, and ~%Eirik%~ isn't what you want to be replacing with. It's always safe to include strings in your .tra that match pre-existing strings in dialog.tlk - if your new string duplicates an existing one, WeiDU won't add it and will use the old string instead. Absolute string references are rarely needed. I'd leave the scripts decompiled (i.e. in .baf format) and COMPILE them at install time to .bcs files - people love to mess with their ids files Avoid using EXTEND_TOP unless it's really necessary (if you're using OnCreation() or suchlike) - often lots of things are jockying to be executed first, and some of them may break if they're not. Are those shell scripts cross platform in any way (unlikely, but worth asking ). You may need some ACTION_IF (%WEIDU_OS% STRING_EQUAL ~osx~) THEN BEGIN AT_NOW ~sh Eirik/EirikUnpack.sh~ AT_UNINSTALL ~sh Eirik/EirikUninstall.sh~ END ELSE BEGIN AT_NOW ~Eirik/some_crummy_bat_file~ AT_UNINSTALL ~Eirik/some_other_crummy_bat_file~ END or suchlike. Link to comment
EiriktheScald Posted February 17, 2007 Author Share Posted February 17, 2007 Are those shell scripts cross platform in any way (unlikely, but worth asking ). You may need some ACTION_IF (%WEIDU_OS% STRING_EQUAL ~osx~) THEN BEGIN AT_NOW ~sh Eirik/EirikUnpack.sh~ AT_UNINSTALL ~sh Eirik/EirikUninstall.sh~ END ELSE BEGIN AT_NOW ~Eirik/some_crummy_bat_file~ AT_UNINSTALL ~Eirik/some_other_crummy_bat_file~ END or suchlike. Funny you should ask. I created the shell scripts using alpha; saving them text only. Does line feed matter? (mac, unix or windows) If you've got a DisplayStringHead in that .baf, and the string doesn't yet exist, you'd do a REPLACE 999997 @100 Actually, I do have this in the baf: IF !InParty(Myself) Global("ESTalkedToWolf","GLOBAL",0) //ensures that it only plays once AreaCheck("FW2800") See([PC]) THEN RESPONSE #100 SetGlobal("ESTalkedToWolf","GLOBAL",1) PlaySound("esWolf") MoveViewObject(Myself,INSTANT) CreateCreature("WOLF01",[x1.y1],0) // Wolf ActionOverride("WOLF01",ChangeAIScript("None",RACE)) DisplayString(Myself,@1) ActionOverride("WOLF01",MoveToPoint([x2.y2])) DisplayString(Myself,@2) ActionOverride("WOLF01",Attack("Eirik")) END Link to comment
EiriktheScald Posted February 17, 2007 Author Share Posted February 17, 2007 Why would this ALWAYS /* Makes sure it is on Tutu or a BGT install */ ACTION_IF FILE_EXISTS_IN_GAME ~FW0100.ARE~ THEN BEGIN PRINT ~Tutu Install Detected~ END ELSE BEGIN FAIL ~Eirik is currently a Tutu-only NPC.~ END Cause a parsing error? [weidu-mac] WeiDU version 192[./Chitin.key] 274 BIFFs, 41169 resources [./dialog.tlk] 97184 string entries [weidu-mac] Using scripting style "BG" [dialog.tlk] claims to be writeable. [dialog.tlk] claims to be a regular file. [WeiDU.log] parsed [sETUP-Eirik.tp2] PARSE ERROR at line 8 column 1-6 Near Text: ALWAYS syntax error [sETUP-Eirik.tp2] ERROR at line 8 column 1-6 Near Text: ALWAYS Parsing.Parse_error ERROR: parsing [sETUP-Eirik.tp2]: Parsing.Parse_error ERROR: problem parsing TP file [sETUP-Eirik.tp2]: Parsing.Parse_error FATAL ERROR: Parsing.Parse_error Link to comment
CamDawg Posted February 17, 2007 Share Posted February 17, 2007 This is me being anal-retentive, but you should avoid using EXTEND_TOP on a script (and area scripts in particular) unless you absolutely, positively have to have your block fire first. Otherwise, it's just a compatibility issue waiting to happen. Use EXTEND_BOTTOM instead--it doesn't take the engine that long to work to the bottom of a script. As for FAIL error, post a bit more of the header. It might be a missing tilde. Link to comment
Nythrun Posted February 17, 2007 Share Posted February 17, 2007 ALWAYS has to be closed by an END ALWAYS /* Makes sure it is on Tutu or a BGT install */ ACTION_IF FILE_EXISTS_IN_GAME ~FW0100.ARE~ THEN BEGIN PRINT ~Tutu Install Detected~ END ELSE BEGIN FAIL ~Eirik is currently a Tutu-only NPC.~ END END You'll only really need it if you have multiple components, though: stuff in the ALWAYS...END section runs at the beginning of each component. If you're bent on using REPLACE, then IF !InParty(Myself) Global("ESTalkedToWolf","GLOBAL",0) //ensures that it only plays once AreaCheck("FW2800") See([PC]) THEN RESPONSE #100 SetGlobal("ESTalkedToWolf","GLOBAL",1) PlaySound("esWolf") MoveViewObject(Myself,INSTANT) CreateCreature("WOLF01",[x1.y1],0) // Wolf ActionOverride("WOLF01",ChangeAIScript("None",RACE)) DisplayString(Myself,999999) ActionOverride("WOLF01",MoveToPoint([x2.y2])) DisplayString(Myself,999998) ActionOverride("WOLF01",Attack("Eirik")) END in the .baf, then in the .tp2, COPY ~eirik/baf/nameofthisscript.baf~ ~override/nameofthisscript.bcs~ REPLACE 999999 @1 REPLACE 999998 @2 COMPILE_BAF_TO_BCS Link to comment
EiriktheScald Posted February 17, 2007 Author Share Posted February 17, 2007 This is me being anal-retentive, but you should avoid using EXTEND_TOP on a script (and area scripts in particular) unless you absolutely, positively have to have your block fire first. Otherwise, it's just a compatibility issue waiting to happen. Use EXTEND_BOTTOM instead--it doesn't take the engine that long to work to the bottom of a script. I almost forgot that berelinde had sent me some example code earlier. I'm using that now. As for FAIL error, post a bit more of the header. It might be a missing tilde. Thanks, I found the problem... me! While adding cmorgan's code tweaks, I deleted an existing line of mine. Now it's giving me fits about the .d file. I'll have a look later. it's off to a Chinese New Year party tonight. Link to comment
EiriktheScald Posted February 17, 2007 Author Share Posted February 17, 2007 If you're bent on using REPLACE, then IF !InParty(Myself) Global("ESTalkedToWolf","GLOBAL",0) //ensures that it only plays once AreaCheck("FW2800") See([PC]) THEN RESPONSE #100 SetGlobal("ESTalkedToWolf","GLOBAL",1) PlaySound("esWolf") MoveViewObject(Myself,INSTANT) CreateCreature("WOLF01",[x1.y1],0) // Wolf ActionOverride("WOLF01",ChangeAIScript("None",RACE)) DisplayString(Myself,999999) ActionOverride("WOLF01",MoveToPoint([x2.y2])) DisplayString(Myself,999998) ActionOverride("WOLF01",Attack("Eirik")) END in the .baf, then in the .tp2, COPY ~eirik/baf/nameofthisscript.baf~ ~override/nameofthisscript.bcs~ REPLACE 999999 @1 REPLACE 999998 @2 COMPILE_BAF_TO_BCS This is how I ended up doing it /* Extending existing scripts */ COPY_EXISTING ~FW2800.ARE~ ~override/FW2800.ARE~ WRITE_ASCII 0x94 ~_AR2800~ #8 BUT_ONLY_IF_IT_CHANGES EXTEND_BOTTOM ~_AR2800.bcs~ ~eirik/scripts/esFW2800.baf~ The baf file like so IF !InParty(Myself) Global("ESTalkedToWolf","GLOBAL",0) //ensures that it only plays once AreaCheck("FW2800") See([PC]) THEN RESPONSE #100 SetGlobal("ESTalkedToWolf","GLOBAL",1) PlaySound("esWolf") MoveViewObject(Myself,INSTANT) CreateCreature("WOLF01",1345.200,0) // Wolf ActionOverride("WOLF01",ChangeAIScript("None",RACE)) DisplayString(Myself,@1) ActionOverride("WOLF01",MoveToPoint(1565.200)) DisplayString(Myself,@2) ActionOverride("WOLF01",Attack("Eirik")) END Link to comment
Miloch Posted February 17, 2007 Share Posted February 17, 2007 It's always safe to include strings in your .tra that match pre-existing strings in dialog.tlk - if your new string duplicates an existing one, WeiDU won't add it and will use the old string instead. Absolute string references are rarely needed.It might be 'safe' but creates excessive work for translators and I'm pretty sure it's unnecessary in this case (for items - dialogue is a different story).I'd leave the scripts decompiled (i.e. in .baf format) and COMPILE them at install time to .bcs filesWhich EXTEND will do automatically (pretty sure I read this recently). Link to comment
berelinde Posted February 18, 2007 Share Posted February 18, 2007 Miloch is right. When you EXTEND a script (bottom or top), copilation is part of the procedure. EXTEND_BOTTOM ~someBCS.bcs~ ~MyMod/some.baf~ will compile some.baf and add it to the end of someBCS.bcs. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.