Fantasy Posted October 9, 2008 Share Posted October 9, 2008 Hello everyone. I have a problem with an area (AR0903 Order of the Radiant Heart) or more specifically with the detail that it requires the entire party to be close to the exit to be able to leave the area. Normally this isn't an issue, but with this one area we would like our npc to leave (without leaving the party) and wait for the rest outside. Unfortunately, that would result in the party not being able to leave the area, unless she would come back inside and they would leave before she's triggered to leave again. You can probably understand that this would be slightly problematic, not to mention annoying for the player. Is there any way to remove the 'party required' flag of that area, and preferably without it somehow causing problems for other mods? I don't know if there are other mods that alter that area, but I wouldn't want to cause trouble for them. If there is a way, please let us know. If not... I guess we'll have to think of another way to solve this problem. Either way, though, thanks for taking the time to read all this. Link to comment
Icendoan Posted October 9, 2008 Share Posted October 9, 2008 No, the only way would have no autosaves. I think. Icen Link to comment
Ardanis Posted October 9, 2008 Share Posted October 9, 2008 Unless someone knows better, the third bit of flags serves as both "party required" and "make autiosave upon leaving". So, I can think of 3 ways to solve your problem: 1) to disable the said flag 2) to exclude NPC from party for a time 3) to script the cutscene that would teleport the remainders outside, as soon as they approach the exit Link to comment
plainab Posted October 9, 2008 Share Posted October 9, 2008 Here is an untested idea that I think might solve the situation. That is allow you to leave the character outside or have the character leave on their own and still have the auto-save take place when the protagonist leaves. 1) Disable the flag that was previously mentioned. 2) Apply floor trigger (similar to a reputation trap) in front of the door. 3) Use a script similar to this on that floor trigger IF Entered(Player1) Global("ab_pc_entered",0) Global("ab_autosaved_0903",0) THEN RESPONSE #100 Wait(5) SetGlobal("ab_pc_entered",1) END IF Entered(Player1) Global("ab_pc_entered",1) THEN RESPONSE #100 SaveGame(0) //slot 0 should be the autosave slot SetGlobal("ab_pc_entered",0) SetGlobal("ab_autosaved_0903",1) END 4) Modify the adjoining area scripts with this added block IF Global("ab_autosaved_0903",1) !AreaCheck("ar0903") THEN RESPONSE #100 SetGlobal("ab_autosaved_0903",0) END As I said, I don't know for sure if this works. The theory seems sound, but when it comes to the SaveGame action I am unsure of the game's mechanics. Also, you can replace the global names with whatever you want. The 'ab' is my prefix so definitely don't use that. The above might make the auto-save take place upon entering the area rather than leaving, but this is why I put in the Wait command - to give the player a chance to exit the floor trigger. Play around with it, maybe you can get something to work. If you do, I'd like to know. BTW, if you need code to add a floor trigger I already have some that could be modified. Link to comment
Ardanis Posted October 10, 2008 Share Posted October 10, 2008 The theory seems sound, but when it comes to the SaveGame action I am unsure of the game's mechanics.It works okay, I saw this command being used in RR's Chosen of Cyric component.BTW, you've forgotten to specify the type of globals in your script That being said, I'm unsure if a need to keep autosave was mentioned in the initial post and not by us the others. I also want to mention that altering .are file would mean a necessarity not to visit 0903 before installing the mod. Not a big deal from my point of view, but some people care about it. If it's the case then creating via script an invisible guy who'd teleport party out, should they approach the doorway out, should work. Link to comment
Fantasy Posted October 19, 2008 Author Share Posted October 19, 2008 Thanks for the suggestions, everyone. I'm sorry for not responding sooner, but I managed to become ill not long after posting the topic. Am finally able to walk around and be behind a computer for extended periods of time, with only a far too persistent headache troubeling me. If you could show me an example code for the floor trigger, that would be great. It would reduce the amount of thinking I have to force through the headache, which is always a good thing. But yes, as soon as I'll be able to think a bit more clearly overall, I'm going to mess around with all this and see what works the best in our situation. I'll let you know if the script works and all. Thanks again. Link to comment
Ardanis Posted October 20, 2008 Share Posted October 20, 2008 If you could show me an example code for the floor trigger, that would be great Stolen from SoS-Weidu and adapted to my needs. You still need to set correct XY values for your trigger. Also pay attention to ScriptName thing - that will be the script, assigned to the trigger. Good luck PS Dammit, small typo. Fixed. COPY_EXISTING ~AR0903.are~ ~override/AR0903.are~ READ_LONG 0x54 "actors_offset" READ_LONG 0x58 "actors_num" READ_SHORT 0x5a "infotrig_num" READ_LONG 0x5c "infotrig_offset" READ_LONG 0x60 "spawns_offset" READ_LONG 0x64 "spawns_num" READ_LONG 0x68 "entrances_offset" READ_LONG 0x6c "entrances_num" READ_LONG 0x70 "cont_offset" READ_SHORT 0x74 "cont_num" READ_SHORT 0x76 "items_num" READ_LONG 0x78 "items_offset" READ_LONG 0x7c "vert_offset" READ_SHORT 0x80 "vert_num" READ_SHORT 0x82 "amb_num" READ_LONG 0x84 "amb_offset" READ_LONG 0x88 "vars_offset" READ_LONG 0x8c "vars_num" READ_LONG 0xa0 "expbmp_offset" READ_LONG 0xa4 "doors_num" READ_LONG 0xa8 "doors_offset" READ_LONG 0xac "anim_num" READ_LONG 0xb0 "anim_offset" READ_LONG 0xb4 "tiled_num" READ_LONG 0xb8 "tiled_offset" READ_LONG 0xbc "songs_offset" READ_LONG 0xc0 "rest_spawns_offset" READ_LONG 0xc4 "automap_offset" READ_LONG 0xc8 "automap_num" //trigger SET offset = ("%infotrig_offset%"+0xc4*"%infotrig_num%") INSERT_BYTES offset (0xc4) WRITE_ASCII offset ~YourTrapName~ WRITE_SHORT (offset+0x20) 0 //proximity trigger aka trap WRITE_SHORT (offset+0x22) 3096 //bounding box - the most left point, same as the X coordinate of the left vertex WRITE_SHORT (offset+0x24) 2795 //bounding box - down WRITE_SHORT (offset+0x26) 3142 //bounding box - right WRITE_SHORT (offset+0x28) 2887 //bounding box - up WRITE_SHORT (offset+0x2a) 4 //number of vertices - you might need more than four of them, in that case insert here the correct amount WRITE_LONG (offset+0x2c) "%vert_num%" //first vertex index WRITE_ASCII (offset+0x7c) ~ScriptName~ //script which will, say, detect if PC is near SET "infotrig_num"="%infotrig_num%"+1 WRITE_SHORT 0x5a "%infotrig_num%" SET "info_ext"=0xc4 PATCH_IF ("%actors_offset%">="%infotrig_offset%") BEGIN "actors_offset"="%actors_offset%"+"%info_ext%" WRITE_LONG 0x54 "%actors_offset%" END PATCH_IF ("%spawns_offset%">="%infotrig_offset%") BEGIN "spawns_offset"="%spawns_offset%"+"%info_ext%" WRITE_LONG 0x60 "%spawns_offset%" END PATCH_IF ("%entrances_offset%">="%infotrig_offset%") BEGIN "entrances_offset"="%entrances_offset%"+"%info_ext%" WRITE_LONG 0x68 "%entrances_offset%" END PATCH_IF ("%cont_offset%">="%infotrig_offset%") BEGIN "cont_offset"="%cont_offset%"+"%info_ext%" WRITE_LONG 0x70 "%cont_offset%" END PATCH_IF ("%items_offset%">="%infotrig_offset%") BEGIN "items_offset"="%items_offset%"+"%info_ext%" WRITE_LONG 0x78 "%items_offset%" END PATCH_IF ("%vert_offset%">="%infotrig_offset%") BEGIN "vert_offset"="%vert_offset%"+"%info_ext%" WRITE_LONG 0x7c "%vert_offset%" END PATCH_IF ("%amb_offset%">="%infotrig_offset%") BEGIN "amb_offset"="%amb_offset%"+"%info_ext%" WRITE_LONG 0x84 "%amb_offset%" END PATCH_IF ("%vars_offset%">="%infotrig_offset%") BEGIN "vars_offset"="%vars_offset%"+"%info_ext%" WRITE_LONG 0x88 "%vars_offset%" END PATCH_IF ("%expbmp_offset%">="%infotrig_offset%") BEGIN "expbmp_offset"="%expbmp_offset%"+"%info_ext%" WRITE_LONG 0xa0 "%expbmp_offset%" END PATCH_IF ("%doors_offset%">="%infotrig_offset%") BEGIN "doors_offset"="%doors_offset%"+"%info_ext%" WRITE_LONG 0xa8 "%doors_offset%" END PATCH_IF ("%anim_offset%">="%infotrig_offset%") BEGIN "anim_offset"="%anim_offset%"+"%info_ext%" WRITE_LONG 0xb0 "%anim_offset%" END PATCH_IF ("%tiled_offset%">="%infotrig_offset%") BEGIN "tiled_offset"="%tiled_offset%"+"%info_ext%" WRITE_LONG 0xb8 "%tiled_offset%" END PATCH_IF ("%songs_offset%">="%infotrig_offset%") BEGIN "songs_offset"="%songs_offset%"+"%info_ext%" WRITE_LONG 0xbc "%songs_offset%" END PATCH_IF ("%rest_spawns_offset%">="%infotrig_offset%") BEGIN "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%" WRITE_LONG 0xc0 "%rest_spawns_offset%" END PATCH_IF ("%automap_offset%">="%infotrig_offset%") BEGIN "automap_offset"="%automap_offset%"+"%info_ext%" WRITE_LONG 0xc4 "%automap_offset%" END //vertices SET offset = ("%vert_offset%"+0x04*"%vert_num%") INSERT_BYTES offset (0x04*4) //if you're adding more than 4 vertices then use 0x04*N, where N is your number WRITE_SHORT offset 3096 // X coordinate of the first vertex WRITE_SHORT (offset+2) 2823 // Y WRITE_SHORT (offset+4) 3141 // the second vertex WRITE_SHORT (offset+6) 2795 WRITE_SHORT (offset+8) 3142 WRITE_SHORT (offset+10) 2858 WRITE_SHORT (offset+12) 3099 WRITE_SHORT (offset+14) 2887 //if you're addimg more than 4 then just continue in the same pattern SET "vert_num"="%vert_num%"+4 //if you're adding more than 4 vertices then add N, where N is your number WRITE_SHORT 0x80 "%vert_num%" SET "info_ext"=0x04*4 //if you're adding more than 4 vertices then use 0x04*N, where N is your number PATCH_IF ("%actors_offset%">="%vert_offset%") BEGIN "actors_offset"="%actors_offset%"+"%info_ext%" WRITE_LONG 0x54 "%actors_offset%" END PATCH_IF ("%spawns_offset%">="%vert_offset%") BEGIN "spawns_offset"="%spawns_offset%"+"%info_ext%" WRITE_LONG 0x60 "%spawns_offset%" END PATCH_IF ("%entrances_offset%">="%vert_offset%") BEGIN "entrances_offset"="%entrances_offset%"+"%info_ext%" WRITE_LONG 0x68 "%entrances_offset%" END PATCH_IF ("%cont_offset%">="%vert_offset%") BEGIN "cont_offset"="%cont_offset%"+"%info_ext%" WRITE_LONG 0x70 "%cont_offset%" END PATCH_IF ("%items_offset%">="%vert_offset%") BEGIN "items_offset"="%items_offset%"+"%info_ext%" WRITE_LONG 0x78 "%items_offset%" END PATCH_IF ("%infotrig_offset%">="%vert_offset%") BEGIN "infotrig_offset"="%infotrig_offset%"+"%info_ext%" WRITE_LONG 0x5c "%infotrig_offset%" END PATCH_IF ("%amb_offset%">="%vert_offset%") BEGIN "amb_offset"="%amb_offset%"+"%info_ext%" WRITE_LONG 0x84 "%amb_offset%" END PATCH_IF ("%vars_offset%">="%vert_offset%") BEGIN "vars_offset"="%vars_offset%"+"%info_ext%" WRITE_LONG 0x88 "%vars_offset%" END PATCH_IF ("%expbmp_offset%">="%vert_offset%") BEGIN "expbmp_offset"="%expbmp_offset%"+"%info_ext%" WRITE_LONG 0xa0 "%expbmp_offset%" END PATCH_IF ("%doors_offset%">="%vert_offset%") BEGIN "doors_offset"="%doors_offset%"+"%info_ext%" WRITE_LONG 0xa8 "%doors_offset%" END PATCH_IF ("%anim_offset%">="%vert_offset%") BEGIN "anim_offset"="%anim_offset%"+"%info_ext%" WRITE_LONG 0xb0 "%anim_offset%" END PATCH_IF ("%tiled_offset%">="%vert_offset%") BEGIN "tiled_offset"="%tiled_offset%"+"%info_ext%" WRITE_LONG 0xb8 "%tiled_offset%" END PATCH_IF ("%songs_offset%">="%vert_offset%") BEGIN "songs_offset"="%songs_offset%"+"%info_ext%" WRITE_LONG 0xbc "%songs_offset%" END PATCH_IF ("%rest_spawns_offset%">="%vert_offset%") BEGIN "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%" WRITE_LONG 0xc0 "%rest_spawns_offset%" END PATCH_IF ("%automap_offset%">="%vert_offset%") BEGIN "automap_offset"="%automap_offset%"+"%info_ext%" WRITE_LONG 0xc4 "%automap_offset%" END Link to comment
plainab Posted October 20, 2008 Share Posted October 20, 2008 Here is where I used it. I've included the entire patch. Before you ask, I had intended to make an external tph file to help cut down on tp2 clutter, but due to the fixpack team's methods of testing I needed to make it an inlined file instead. You may not need to make as many changes as I did. Hopefully, between what I have here and what was posted above you will be able to get something that works for you. BTW, if you are modding in BG2 you'll need to include a check (I should have done it here for the tutu portion, but didn't) to possibly update the offsets for the map notes section of the ARE file. ////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////// Fix premature Chapter 5 start Tutu & Totsc ///////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////// BEGIN @16//~Fix premature Chapter 5 start Tutu & Totsc~ REQUIRE_COMPONENT ~setup-bg1fixpack.tp2~ ~0~ @3 //~SKIPPING Required Component not installed~ REQUIRE_PREDICATE ( (GAME_IS ~totsc~) OR (FILE_EXISTS_IN_GAME ~fw1803.are~) ) @17//~SKIPPING Only for Tutu and TOTSC~ <<<<<<<< inlined_totsc/endch4.baf IF Entered([PC]) Dead("Davaeorn") // Davaeorn Global("Chapter","GLOBAL",4) THEN RESPONSE #100 RevealAreaOnMap("AR0900") IncrementChapter("Chptxt5") AddJournalEntry(15839) END IF Entered([PC]) THEN RESPONSE #100 SmallWait(1) END >>>>>>>> <<<<<<<< inlined_tutu/endch4.baf IF Entered([PC]) Dead("Davaeorn") // Davaeorn Global("Chapter","GLOBAL",4) THEN RESPONSE #100 EraseJournalEntry(78162) // ~A hidden base?Tazok is traveling to a mine site. This mine site could be the home base of whoever controls the bandits.~ EraseJournalEntry(85754) // ~A hidden base in the CloakwoodThings grow darker here, darker than I thought possible. In Tazok's tent, I came across a prisoner named Ender Sai. If he speaks true, and I suspect the documents in Tazok's chest that he mentioned will show he does, the bandits are being played as pawns by a power group called, tellingly enough, the Iron Throne. Tazok's orders are coming from some base of theirs within the Cloakwood, and I have little doubt that it is there that I must journey next if I wish to peel back the next layer of this mystery. Something still seems very wrong in this. It haunts me, dancing endlessly along the periphery of my thoughts. What it is, however, I know not.~ EraseJournalEntry(85767) // ~A hidden base in the CloakwoodThings grow darker here, darker than I thought possible. In Tazok's tent, I came across a prisoner named Ender Sai. If he speaks true, and I suspect the documents in Tazok's chest that he mentioned will show he does, the bandits are being played as pawns by a power group called, tellingly enough, the Iron Throne. They meddle in the affairs of nations as if they were gods, pushing Amn and Baldur's Gate to the brink of war in order to line their pockets. They apparently maintain a base within the Cloakwood, and I have little doubt that it is there that I must journey next if I wish to peel back the next layer of this mystery. Something still seems very wrong in this, however. It haunts me, dancing endlessly in the shadows, never coming into the light. What it is, however, I know not.~ EraseJournalEntry(80561) // ~A hidden base in the CloakwoodA girl named Faldorn has told me that that the Iron Throne's base is located to the east.~ EraseJournalEntry(80565) // ~A hidden base in the CloakwoodWe have agreed to help Faldorn against the people who have been polluting the Cloakwood forest. These people, apparently agents of the Iron Throne, dwell in a fort to the east.~ EraseJournalEntry(86317) // ~A hidden base in the CloakwoodThe Iron Throne base is to the east of the druid grove.~ EraseJournalEntry(86297) // ~A hidden base in the CloakwoodA druid named Takiyah has told me to find Faldorn. Faldorn is on a crusade against a group that 'poisons' the forest. These people dwell to the east.~ EraseJournalEntry(85810) // ~A hidden base in the CloakwoodOne of the Iron Throne soldiers told us that the entrance to the mine was in the bailey to the east.~ EraseJournalEntry(85824) // ~A hidden base in the CloakwoodAn Iron Throne guard told us that we could find Davaeorn on the fourth floor of the Cloakwood mine.~ EraseJournalEntry(85868) // ~A hidden base in the CloakwoodA miner told us that the leader of the mine lives on the fourth level.~ AddJournalEntry(85979,QUEST_DONE) IncrementChapter("Chptxt5") RevealAreaOnMap("FW0900") AddJournalEntry(74121,INFO) END IF Entered([PC]) THEN RESPONSE #100 SmallWait(1) END >>>>>>>> <<<<<<<< inlined/1803.tph COPY_EXISTING_REGEXP GLOB ~%file_name%~ ~override~ PATCH_IF (%SOURCE_SIZE% > 0xd4) BEGIN //remove area script reference READ_ASCII 0x94 script_res //update vertex indices for info points READ_LONG 0x5c info_off READ_SHORT 0x5a info_num FOR (i= 0; i < "%info_num%"; i += 1) BEGIN READ_SHORT ("%info_off%" + (%i% * 0xc4) + 0x2c) info_vertex_first_idx PATCH_IF ("%info_vertex_first_idx%" >= 0) BEGIN WRITE_SHORT ("%info_off%" + (%i% * 0xc4) + 0x2c) ("%info_vertex_first_idx%" + 10) END END //update vertex indices for containers READ_LONG 0x70 container_off READ_SHORT 0x74 container_num FOR (i = 0; i< "%container_num%"; i += 1) BEGIN READ_LONG ("%container_off%" + (%i% * 0xc0) + 0x50) container_vertex_first_idx PATCH_IF ("%container_vertex_first_idx%" >= 0) BEGIN WRITE_LONG ("%container_off%" + (%i% * 0xc0) + 0x50) ("%container_vertex_first_idx%" + 10) END END //update vertex indices for doors READ_LONG 0xa8 door_off READ_SHORT 0xa4 door_num FOR (i = 0; i < "%door_num%"; i += 1) BEGIN READ_LONG ("%door_off%" + (%i% * 0xc8) + 0x2c) door_vertex_open_first_idx PATCH_IF ("%door_vertex_open_first_idx%" >= 0) BEGIN WRITE_LONG ("%door_off%" + (%i% * 0xc8) + 0x2c) ("%door_vertex_open_first_idx%" + 10) END READ_LONG ("%door_off%" + (%i% * 0xc8) + 0x34) door_vertex_closed_first_idx PATCH_IF ("%door_vertex_closed_first_idx%" >= 0) BEGIN WRITE_LONG ("%door_off%" + (%i% * 0xc8) + 0x34) ("%door_vertex_closed_first_idx%" + 10) END READ_LONG ("%door_off%" + (%i% * 0xc8) + 0x48) door_vertex_impede_closed_first_idx PATCH_IF ("%door_vertex_impede_closed_first_idx%" >= 0) BEGIN WRITE_LONG ("%door_off%" + (%i% * 0xc8) + 0x48) ("%door_vertex_impede_closed_first_idx%" + 10) END READ_LONG ("%door_off%" + (%i% * 0xc8) + 0x50) door_vertex_impede_open_first_idx PATCH_IF ("%door_vertex_impede_open_first_idx%" >= 0) BEGIN WRITE_LONG ("%door_off%" + (%i% * 0xc8) + 0x50) ("%door_vertex_impede_open_first_idx%" + 10) END END //insert 2 triggers worth of space READ_LONG 0x5c info_off READ_SHORT 0x5a info_num WRITE_SHORT 0x5a (%info_num% + 2) SET new_bytes = (0xc4 * 2) SET cmp_loc = %info_off% SET check_num = %info_num% INSERT_BYTES (%cmp_loc%) (%new_bytes%) //check other offsets and update as needed PATCH_IF (%check_num% > 0) BEGIN READ_LONG 0x54 actor_off PATCH_IF (%actor_off% > %cmp_loc%) BEGIN WRITE_LONG 0x54 (%actor_off% + %new_bytes%) //actor_off END READ_LONG 0x60 spawn_off PATCH_IF (%spawn_off% > %cmp_loc%) BEGIN WRITE_LONG 0x60 (%spawn_off% + %new_bytes%) //spawn_off END READ_LONG 0x68 entrance_off PATCH_IF (%entrance_off% > %cmp_loc%) BEGIN WRITE_LONG 0x68 (%entrance_off% + %new_bytes%) //entrance_off END READ_LONG 0x70 container_off PATCH_IF (%container_off% > %cmp_loc%) BEGIN WRITE_LONG 0x70 (%container_off% + %new_bytes%) //container_off END READ_LONG 0x78 item_off PATCH_IF (%item_off% > %cmp_loc%) BEGIN WRITE_LONG 0x78 (%item_off% + %new_bytes%) //item_off END // READ_LONG 0x5c info_off // PATCH_IF (%info_off% > %cmp_loc%) BEGIN // WRITE_LONG 0x5c (%info_off% + %new_bytes%) //info_off // END READ_LONG 0x7c vertex_off PATCH_IF (%vertex_off% > %cmp_loc%) BEGIN WRITE_LONG 0x7c (%vertex_off% + %new_bytes%) //vertex_off END READ_LONG 0x84 ambient_off PATCH_IF (%ambient_off% > %cmp_loc%) BEGIN WRITE_LONG 0x84 (%ambient_off% + %new_bytes%) //ambient_off END READ_LONG 0x88 variable_off PATCH_IF (%variable_off% > %cmp_loc%) BEGIN WRITE_LONG 0x88 (%variable_off% + %new_bytes%) //variable_off END READ_LONG 0xa8 door_off PATCH_IF (%door_off% > %cmp_loc%) BEGIN WRITE_LONG 0xa8 (%door_off% + %new_bytes%) //door_off END READ_LONG 0xa0 explored_off PATCH_IF (%explored_off% > %cmp_loc%) BEGIN WRITE_LONG 0xa0 (%explored_off% + %new_bytes%) //explored_off END READ_LONG 0xb0 anim_off PATCH_IF (%anim_off% > %cmp_loc%) BEGIN WRITE_LONG 0xb0 (%anim_off% + %new_bytes%) //anim_off END READ_LONG 0xb8 tiled_off PATCH_IF (%tiled_off% > %cmp_loc%) BEGIN WRITE_LONG 0xb8 (%tiled_off% + %new_bytes%) //tiled_off END READ_LONG 0xbc song_off PATCH_IF (%song_off% > %cmp_loc%) BEGIN WRITE_LONG 0xbc (%song_off% + %new_bytes%) //song_off END READ_LONG 0xc0 rest_off PATCH_IF (%rest_off% > %cmp_loc%) BEGIN WRITE_LONG 0xc0 (%rest_off% + %new_bytes%) //rest_off END READ_LONG 0xc4 automap_off PATCH_IF (%automap_off% > %cmp_loc%) BEGIN WRITE_LONG 0xc4 (%automap_off% + %new_bytes%) //automap_off END READ_LONG 0xcc pro_traps_off PATCH_IF (%pro_traps_off% > %cmp_loc%) BEGIN WRITE_LONG 0xcc (%pro_traps_off% + %new_bytes%) //pro_traps_off END END ELSE PATCH_IF (%check_num% = 0) BEGIN READ_LONG 0x54 actor_off PATCH_IF (%actor_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x54 (%actor_off% + %new_bytes%) //actor_off END READ_LONG 0x60 spawn_off PATCH_IF (%spawn_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x60 (%spawn_off% + %new_bytes%) //spawn_off END READ_LONG 0x68 entrance_off PATCH_IF (%entrance_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x68 (%entrance_off% + %new_bytes%) //entrance_off END READ_LONG 0x70 container_off PATCH_IF (%container_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x70 (%container_off% + %new_bytes%) //container_off END READ_LONG 0x78 item_off PATCH_IF (%item_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x78 (%item_off% + %new_bytes%) //item_off END // READ_LONG 0x5c info_off // PATCH_IF (%info_off% >= %cmp_loc%) BEGIN // WRITE_LONG 0x5c (%info_off% + %new_bytes%) //vertex_off // END READ_LONG 0x7c vertex_off PATCH_IF (%vertex_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x7c (%vertex_off% + %new_bytes%) //vertex_off END READ_LONG 0x84 ambient_off PATCH_IF (%ambient_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x84 (%ambient_off% + %new_bytes%) //ambient_off END READ_LONG 0x88 variable_off PATCH_IF (%variable_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x88 (%variable_off% + %new_bytes%) //variable_off END READ_LONG 0xa8 door_off PATCH_IF (%door_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xa8 (%door_off% + %new_bytes%) //door_off END READ_LONG 0xa0 explored_off PATCH_IF (%explored_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xa0 (%explored_off% + %new_bytes%) //explored_off END READ_LONG 0xb0 anim_off PATCH_IF (%anim_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xb0 (%anim_off% + %new_bytes%) //anim_off END READ_LONG 0xb8 tiled_off PATCH_IF (%tiled_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xb8 (%tiled_off% + %new_bytes%) //tiled_off END READ_LONG 0xbc song_off PATCH_IF (%song_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xbc (%song_off% + %new_bytes%) //song_off END READ_LONG 0xc0 rest_off PATCH_IF (%rest_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xc0 (%rest_off% + %new_bytes%) //rest_off END READ_LONG 0xc4 automap_off PATCH_IF (%automap_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xc4 (%automap_off% + %new_bytes%) //automap_off END READ_LONG 0xcc pro_traps_off PATCH_IF (%pro_traps_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xcc (%pro_traps_off% + %new_bytes%) //pro_traps_off END END //insert space for vertices for 2 triggers READ_LONG 0x7c vertex_off READ_SHORT 0x80 vertex_num WRITE_SHORT 0x80 (%vertex_num% + 10) SET new_bytes = (0x4 * 10) SET check_num = %vertex_num% SET cmp_loc = %vertex_off% INSERT_BYTES (%cmp_loc%) (%new_bytes%) //check other offsets and update as needed PATCH_IF (%check_num% > 0) BEGIN READ_LONG 0x54 actor_off PATCH_IF (%actor_off% > %cmp_loc%) BEGIN WRITE_LONG 0x54 (%actor_off% + %new_bytes%) //actor_off END READ_LONG 0x60 spawn_off PATCH_IF (%spawn_off% > %cmp_loc%) BEGIN WRITE_LONG 0x60 (%spawn_off% + %new_bytes%) //spawn_off END READ_LONG 0x68 entrance_off PATCH_IF (%entrance_off% > %cmp_loc%) BEGIN WRITE_LONG 0x68 (%entrance_off% + %new_bytes%) //entrance_off END READ_LONG 0x70 container_off PATCH_IF (%container_off% > %cmp_loc%) BEGIN WRITE_LONG 0x70 (%container_off% + %new_bytes%) //container_off END READ_LONG 0x78 item_off PATCH_IF (%item_off% > %cmp_loc%) BEGIN WRITE_LONG 0x78 (%item_off% + %new_bytes%) //item_off END READ_LONG 0x5c info_off PATCH_IF (%info_off% > %cmp_loc%) BEGIN WRITE_LONG 0x5c (%info_off% + %new_bytes%) //info_off END // READ_LONG 0x7c vertex_off // PATCH_IF (%vertex_off% > %cmp_loc%) BEGIN // WRITE_LONG 0x7c (%vertex_off% + %new_bytes%) //vertex_off // END READ_LONG 0x84 ambient_off PATCH_IF (%ambient_off% > %cmp_loc%) BEGIN WRITE_LONG 0x84 (%ambient_off% + %new_bytes%) //ambient_off END READ_LONG 0x88 variable_off PATCH_IF (%variable_off% > %cmp_loc%) BEGIN WRITE_LONG 0x88 (%variable_off% + %new_bytes%) //variable_off END READ_LONG 0xa8 door_off PATCH_IF (%door_off% > %cmp_loc%) BEGIN WRITE_LONG 0xa8 (%door_off% + %new_bytes%) //door_off END READ_LONG 0xa0 explored_off PATCH_IF (%explored_off% > %cmp_loc%) BEGIN WRITE_LONG 0xa0 (%explored_off% + %new_bytes%) //explored_off END READ_LONG 0xb0 anim_off PATCH_IF (%anim_off% > %cmp_loc%) BEGIN WRITE_LONG 0xb0 (%anim_off% + %new_bytes%) //anim_off END READ_LONG 0xb8 tiled_off PATCH_IF (%tiled_off% > %cmp_loc%) BEGIN WRITE_LONG 0xb8 (%tiled_off% + %new_bytes%) //tiled_off END READ_LONG 0xbc song_off PATCH_IF (%song_off% > %cmp_loc%) BEGIN WRITE_LONG 0xbc (%song_off% + %new_bytes%) //song_off END READ_LONG 0xc0 rest_off PATCH_IF (%rest_off% > %cmp_loc%) BEGIN WRITE_LONG 0xc0 (%rest_off% + %new_bytes%) //rest_off END READ_LONG 0xc4 automap_off PATCH_IF (%automap_off% > %cmp_loc%) BEGIN WRITE_LONG 0xc4 (%automap_off% + %new_bytes%) //automap_off END READ_LONG 0xcc pro_traps_off PATCH_IF (%pro_traps_off% > %cmp_loc%) BEGIN WRITE_LONG 0xcc (%pro_traps_off% + %new_bytes%) //pro_traps_off END END ELSE PATCH_IF (%check_num% = 0) BEGIN READ_LONG 0x54 actor_off PATCH_IF (%actor_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x54 (%actor_off% + %new_bytes%) //actor_off END READ_LONG 0x60 spawn_off PATCH_IF (%spawn_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x60 (%spawn_off% + %new_bytes%) //spawn_off END READ_LONG 0x68 entrance_off PATCH_IF (%entrance_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x68 (%entrance_off% + %new_bytes%) //entrance_off END READ_LONG 0x70 container_off PATCH_IF (%container_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x70 (%container_off% + %new_bytes%) //container_off END READ_LONG 0x78 item_off PATCH_IF (%item_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x78 (%item_off% + %new_bytes%) //item_off END READ_LONG 0x5c info_off PATCH_IF (%info_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x5c (%info_off% + %new_bytes%) //vertex_off END // READ_LONG 0x7c vertex_off // PATCH_IF (%vertex_off% >= %cmp_loc%) BEGIN // WRITE_LONG 0x7c (%vertex_off% + %new_bytes%) //vertex_off // END READ_LONG 0x84 ambient_off PATCH_IF (%ambient_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x84 (%ambient_off% + %new_bytes%) //ambient_off END READ_LONG 0x88 variable_off PATCH_IF (%variable_off% >= %cmp_loc%) BEGIN WRITE_LONG 0x88 (%variable_off% + %new_bytes%) //variable_off END READ_LONG 0xa8 door_off PATCH_IF (%door_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xa8 (%door_off% + %new_bytes%) //door_off END READ_LONG 0xa0 explored_off PATCH_IF (%explored_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xa0 (%explored_off% + %new_bytes%) //explored_off END READ_LONG 0xb0 anim_off PATCH_IF (%anim_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xb0 (%anim_off% + %new_bytes%) //anim_off END READ_LONG 0xb8 tiled_off PATCH_IF (%tiled_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xb8 (%tiled_off% + %new_bytes%) //tiled_off END READ_LONG 0xbc song_off PATCH_IF (%song_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xbc (%song_off% + %new_bytes%) //song_off END READ_LONG 0xc0 rest_off PATCH_IF (%rest_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xc0 (%rest_off% + %new_bytes%) //rest_off END READ_LONG 0xc4 automap_off PATCH_IF (%automap_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xc4 (%automap_off% + %new_bytes%) //automap_off END READ_LONG 0xcc pro_traps_off PATCH_IF (%pro_traps_off% >= %cmp_loc%) BEGIN WRITE_LONG 0xcc (%pro_traps_off% + %new_bytes%) //automap_off END END // Write info for Chapter trigger 1 READ_LONG 0x5c info_off WRITE_ASCII (%info_off% + 0) ~Chapter trigger 1~ (32) WRITE_SHORT (%info_off% + 0x20) 0 WRITE_SHORT (%info_off% + 0x22) 380 WRITE_SHORT (%info_off% + 0x24) 1062 WRITE_SHORT (%info_off% + 0x26) 541 WRITE_SHORT (%info_off% + 0x28) 1277 WRITE_SHORT (%info_off% + 0x2a) 6 //num of vertices WRITE_LONG (%info_off% + 0x2c) 0 //index of vertices WRITE_LONG (%info_off% + 0x30) 0 WRITE_LONG (%info_off% + 0x34) 0 WRITE_ASCII (%info_off% + 0x38) ~~ (8) WRITE_ASCII (%info_off% + 0x40) ~~ (32) WRITE_LONG (%info_off% + 0x60) 2 WRITE_LONG (%info_off% + 0x64) 0 WRITE_SHORT (%info_off% + 0x68) 100 WRITE_SHORT (%info_off% + 0x6a) 100 WRITE_SHORT (%info_off% + 0x6c) 1 WRITE_SHORT (%info_off% + 0x63) 0 WRITE_SHORT (%info_off% + 0x70) 404 WRITE_SHORT (%info_off% + 0x72) 1300 WRITE_BYTE (%info_off% + 0x74) 0 WRITE_BYTE (%info_off% + 0x75) 0 WRITE_BYTE (%info_off% + 0x76) 0 WRITE_BYTE (%info_off% + 0x77) 0 WRITE_BYTE (%info_off% + 0x78) 0 WRITE_BYTE (%info_off% + 0x79) 0 WRITE_BYTE (%info_off% + 0x7a) 0 WRITE_BYTE (%info_off% + 0x7b) 0 WRITE_ASCII (%info_off% + 0x7c) ~endch4~ (8) WRITE_SHORT (%info_off% + 0x84) 0 WRITE_SHORT (%info_off% + 0x86) 0 WRITE_SHORT (%info_off% + 0x88) 0 WRITE_SHORT (%info_off% + 0x8a) 0 WRITE_ASCII (%info_off% + 0xbc) ~~ (8) FOR (y=0x8c; y<0xbc; y+=1) BEGIN WRITE_BYTE (%info_off% + %y%) 0 END // Write info for Chapter trigger 2 WRITE_ASCII (%info_off% + 0xc4 + 0) ~Chapter trigger 2~ (32) WRITE_SHORT (%info_off% + 0xc4 + 0x20) 0 WRITE_SHORT (%info_off% + 0xc4 + 0x22) 1523 WRITE_SHORT (%info_off% + 0xc4 + 0x24) 272 WRITE_SHORT (%info_off% + 0xc4 + 0x26) 1629 WRITE_SHORT (%info_off% + 0xc4 + 0x28) 356 WRITE_SHORT (%info_off% + 0xc4 + 0x2a) 4 //num of vertices WRITE_LONG (%info_off% + 0xc4 + 0x2c) 6 //index of vertices WRITE_LONG (%info_off% + 0xc4 + 0x30) 0 WRITE_LONG (%info_off% + 0xc4 + 0x34) 0 WRITE_ASCII (%info_off% + 0xc4 + 0x38) ~~ (8) WRITE_ASCII (%info_off% + 0xc4 + 0x40) ~~ (32) WRITE_LONG (%info_off% + 0xc4 + 0x60) 2 WRITE_LONG (%info_off% + 0xc4 + 0x64) 0 WRITE_SHORT (%info_off% + 0xc4 + 0x68) 100 WRITE_SHORT (%info_off% + 0xc4 + 0x6a) 100 WRITE_SHORT (%info_off% + 0xc4 + 0x6c) 1 WRITE_SHORT (%info_off% + 0xc4 + 0x63) 0 WRITE_SHORT (%info_off% + 0xc4 + 0x70) 1620 WRITE_SHORT (%info_off% + 0xc4 + 0x72) 340 WRITE_BYTE (%info_off% + 0xc4 + 0x74) 0 WRITE_BYTE (%info_off% + 0xc4 + 0x75) 0 WRITE_BYTE (%info_off% + 0xc4 + 0x76) 0 WRITE_BYTE (%info_off% + 0xc4 + 0x77) 0 WRITE_BYTE (%info_off% + 0xc4 + 0x78) 0 WRITE_BYTE (%info_off% + 0xc4 + 0x79) 0 WRITE_BYTE (%info_off% + 0xc4 + 0x7a) 0 WRITE_BYTE (%info_off% + 0xc4 + 0x7b) 0 WRITE_ASCII (%info_off% + 0xc4 + 0x7c) ~endch4~ (8) WRITE_SHORT (%info_off% + 0xc4 + 0x84) 0 WRITE_SHORT (%info_off% + 0xc4 + 0x86) 0 WRITE_SHORT (%info_off% + 0xc4 + 0x88) 0 WRITE_SHORT (%info_off% + 0xc4 + 0x8a) 0 WRITE_ASCII (%info_off% + 0xc4 + 0xbc) ~~ (8) FOR (y=0x8c; y<0xbc; y+=1) BEGIN WRITE_BYTE (%info_off% + 0xc4 + %y%) 0 END // Chapter trigger 1 -- verticies READ_LONG 0x7c vertex_off WRITE_SHORT (%vertex_off% + 0) 380 WRITE_SHORT (%vertex_off% + 2) 1076 WRITE_SHORT (%vertex_off% + 4) 510 WRITE_SHORT (%vertex_off% + 6) 1160 WRITE_SHORT (%vertex_off% + 8) 439 WRITE_SHORT (%vertex_off% + 10) 1263 WRITE_SHORT (%vertex_off% + 12) 468 WRITE_SHORT (%vertex_off% + 14) 1277 WRITE_SHORT (%vertex_off% + 16) 541 WRITE_SHORT (%vertex_off% + 18) 1148 WRITE_SHORT (%vertex_off% + 20) 393 WRITE_SHORT (%vertex_off% + 22) 1062 // Chapter trigger 2 -- verticies WRITE_SHORT (%vertex_off% + 24) 1523 WRITE_SHORT (%vertex_off% + 26) 292 WRITE_SHORT (%vertex_off% + 28) 1607 WRITE_SHORT (%vertex_off% + 30) 356 WRITE_SHORT (%vertex_off% + 32) 1629 WRITE_SHORT (%vertex_off% + 34) 334 WRITE_SHORT (%vertex_off% + 36) 1550 WRITE_SHORT (%vertex_off% + 38) 272 END BUT_ONLY_IF_IT_CHANGES >>>>>>>> ACTION_IF (GAME_IS ~totsc~) THEN BEGIN OUTER_SPRINT file_name ~ar1803.are~ INCLUDE ~inlined/1803.tph~ COMPILE ~inlined_totsc/endch4.baf~ COPY_EXISTING ~%file_name%~ ~override~ WRITE_ASCII 0x94 ~~ (8) BUT_ONLY_IF_IT_CHANGES END ACTION_IF (FILE_EXISTS_IN_GAME ~fw1803.are~) THEN BEGIN OUTER_SPRINT file_name ~fw1803.are~ INCLUDE ~inlined/1803.tph~ COMPILE ~inlined_tutu/endch4.baf~ COPY_EXISTING_REGEXP GLOB ~%script_res%.bcs~ ~override~ DECOMPILE_BCS_TO_BAF REPLACE_TEXTUALLY ~IF Dead("davaeorn") Global("Chapter","GLOBAL",4) THEN RESPONSE #100 EraseJournalEntry(78162) EraseJournalEntry(85754) EraseJournalEntry(85767) EraseJournalEntry(80561) EraseJournalEntry(80565) EraseJournalEntry(86317) EraseJournalEntry(86297) EraseJournalEntry(85810) EraseJournalEntry(85824) EraseJournalEntry(85868) AddJournalEntry(85979,QUEST_DONE) IncrementChapter("Chptxt5") RevealAreaOnMap("FW0900") AddJournalEntry(74121,INFO) END~ ~~ COMPILE_BAF_TO_BCS BUT_ONLY_IF_IT_CHANGES END Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.