Skip to content

Random questions I have regarding modding

13»

Comments

  • argent77argent77 Member Posts: 3,478
    edited May 2015

    Stored in the .CRE file, or in the .ITM file? (Was that a typo?) If the latter, couldn't you just make two versions of the item, one of which has the 'stolen' flag, and just switch one out for the other?

    The "Stolen" flag is indeed set in the CRE file, not the ITM file itself. It wouldn't make sense to store it in ITM files anyway, because this would mark every instance of that particular item as stolen.

    @Musigny The idea of putting the item with the "stolen" flag into the creature is a great solution for this problem. :+1:
  • elminsterelminster Member, Developer Posts: 16,317
    edited May 2015
    Yep once you pointed out that it was found in the cre file I actually ended up doing that. Thanks everyone. :)
  • elminsterelminster Member, Developer Posts: 16,317
    edited May 2015
    @Isaya @argent77 or anyone else.

    If I wanted to patch an ambient sound into an area. What would I need to put into the tp2 (or any other file) to go about doing that?

    I tried this and weidu said "cannot convert are structure type or % structure type to an integer" I recall having this issue in the past I just don't know what I've done wrong hehe.

    COPY_EXISTING ~ar0705.are~ ~override~
    LPF fj_are_structure
    INT_VAR
    fj_loc_x = 500
    fj_loc_y = 900
    fj_radius = 900
    fj_loc_z = 0
    fj_volume = 100
    fj_sound_num = 1
    fj_delay = 300
    fj_variation = 0
    fj_schedule = 0b111110000000000000111111
    fj_flags = Bit0

    STR_VAR
    fj_name =~Ghost~
    fj_wav_resref0 =k9A1A

    Also when it comes to flags (so values under fj_flags) I just wanted the enable the "enabled" flag. So would it be sufficient to write in Bit0 ?
  • elminsterelminster Member, Developer Posts: 16,317
    edited May 2015
    I could delete my post but I am going to just leave it here to remind myself to next time give the fj_structure a value (Ambient in this case) :)
  • elminsterelminster Member, Developer Posts: 16,317
    edited June 2015
    Does anyone know if there is an existing global variable in BG1/BGEE for when Charname knows that they are the spawn of bhaal? I know of SPAWN_REVEAL, but it seems to be only used by Dorn.

    Edit: Ended up just making one myself. :)
    Post edited by elminster on
  • elminsterelminster Member, Developer Posts: 16,317
    edited June 2015
    Anyone know of any good guides for modifying background art?

    Edit: Totally forgot about all the guides here http://www.shsforums.net/topic/36781-comprehensive-ie-modding-tutorial-index/ :)
    Post edited by elminster on
  • elminsterelminster Member, Developer Posts: 16,317
    edited June 2015
    How does one set a launch point?

    So far I'm trying to make a travel trigger for the friendly arm inn. This is what I have so far (its leading to an area called k9bhaa).
    COPY_EXISTING ~k9EveOfWar/ARE/AR2301.are~ ~override~
    PATCH_IF (SOURCE_SIZE > 0x11b) BEGIN // checking for valid ARE resource
    LPF fj_are_structure
    INT_VAR
    fj_type = 2 // 2: travel region
    // bounding box of region
    fj_box_left = 1040
    fj_box_top = 420
    fj_box_right = 1123
    fj_box_bottom = 510
    fj_cursor_idx = 28
    fj_flags = 0b000000100
    // Actual coordinates of region polygon (required!). Specify combined X and Y coordinates.
    fj_vertex_0 = 1140 + (460 << 16)
    fj_vertex_1 = 1140 + (485 << 16)
    fj_vertex_2 = 1100 + (510 << 16)
    fj_vertex_3 = 1055 + (465 << 16)
    fj_vertex_4 = 1085 + (445 << 16)
    fj_vertex_5 = 1085 + (420 << 16)
    STR_VAR
    fj_structure_type = region
    fj_name = "Tran1004"
    fj_destination_area = "k9bhaa"
    fj_destination_name = "Door1003"
    END

    LPF fj_are_structure
    INT_VAR
    fj_loc_x = 1080
    fj_loc_y =475
    fj_orientation = 2
    STR_VAR
    fj_structure_type = entrance
    fj_name = "door1004"
    END


    END

    ACTION_DEFINE_ASSOCIATIVE_ARRAY toNewArea BEGIN
    "k9bhaa" => "Exit1003"
    END

    ACTION_DEFINE_ASSOCIATIVE_ARRAY fromNewArea BEGIN
    "k9bhaa" => "door1004"
    END
    When I put this all in though it doesn't work. I check it out in Near Infinity and it doesn't have a launch point (unlike other travel triggers).

    I checked the Weidu documentation and it seems like there are two different methods to making a new area region.
  • Red_CarnelianRed_Carnelian Member Posts: 90
    Here's an example of code I used to add a travel trigger and entrance in AR1900. I'm not a coder but I managed to edit it to get it to work. Maybe it will help.

    //NorthNashkelRoad gets new travel region and new entrance for ARS001
    COPY_EXISTING ~%NorthNashkelRoad%.ARE~ ~override~
    READ_LONG 0x54 "actors_offset"
    READ_SHORT 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"

    //adding new trigger ************************************************
    SET offset = ("%infotrig_offset%"+0xc4*"%infotrig_num%")
    INSERT_BYTES offset 0xc4
    WRITE_ASCII offset ~DoorS001~
    WRITE_SHORT (offset+0x20) 2 //travel trigger
    WRITE_SHORT (offset+0x22) 1584 //bounding box
    WRITE_SHORT (offset+0x24) 3443 //bounding box
    WRITE_SHORT (offset+0x26) 1676 //bounding box
    WRITE_SHORT (offset+0x28) 3540 //bounding box
    WRITE_SHORT (offset+0x2a) 7 //vertices number
    WRITE_LONG (offset+0x2c) "%vert_num%" //first vertex index
    WRITE_LONG (offset+0x34) 30 //cursor
    WRITE_ASCII (offset+0x38) ~ARS001~ //destination area
    WRITE_ASCII (offset+0x40) ~Entrance1~ //destination area's entrance name
    WRITE_LONG (offset+0x60) 0x00000004 //flags - party required
    WRITE_SHORT (offset+0x70) 1630 //Trap location X
    WRITE_SHORT (offset+0x72) 3491 //Trap location Y
    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

    //adding 7 new vertices for triggers
    SET offset = ("%vert_offset%"+0x04*"%vert_num%")
    INSERT_BYTES offset (0x04*7)
    WRITE_SHORT offset 1602
    WRITE_SHORT (offset+2) 3540
    WRITE_SHORT (offset+4) 1676
    WRITE_SHORT (offset+6) 3506
    WRITE_SHORT (offset+8) 1641
    WRITE_SHORT (offset+10) 3450
    WRITE_SHORT (offset+12) 1621
    WRITE_SHORT (offset+14) 3442
    WRITE_SHORT (offset+16) 1589
    WRITE_SHORT (offset+18) 3456
    WRITE_SHORT (offset+20) 1548
    WRITE_SHORT (offset+22) 3481
    WRITE_SHORT (offset+24) 1602
    WRITE_SHORT (offset+26) 3540


    SET "vert_num"="%vert_num%"+7
    WRITE_SHORT 0x80 "%vert_num%"

    SET "info_ext"=0x04*7
    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

    //adding 1 new entrance
    SET offset = ("%entrances_offset%"+0x68*"%entrances_num%")
    INSERT_BYTES offset 0x68
    WRITE_ASCII offset ~EXITARS001~
    WRITE_SHORT (offset+0x20) 1693 //X
    WRITE_SHORT (offset+0x22) 3569 //Y
    WRITE_LONG (offset+0x24) "13" // facing
    SET "entrances_num"="%entrances_num%"+1
    WRITE_LONG 0x6c "%entrances_num%"

    SET "info_ext"=0x68
    PATCH_IF ("%actors_offset%">="%entrances_offset%") BEGIN
    "actors_offset"="%actors_offset%"+"%info_ext%"
    WRITE_LONG 0x54 "%actors_offset%"
    END
    PATCH_IF ("%spawns_offset%">="%entrances_offset%") BEGIN
    "spawns_offset"="%spawns_offset%"+"%info_ext%"
    WRITE_LONG 0x60 "%spawns_offset%"
    END
    PATCH_IF ("%vert_offset%">="%entrances_offset%") BEGIN
    "vert_offset"="%vert_offset%"+"%info_ext%"
    WRITE_LONG 0x7c "%vert_offset%"
    END
    PATCH_IF ("%cont_offset%">="%entrances_offset%") BEGIN
    "cont_offset"="%cont_offset%"+"%info_ext%"
    WRITE_LONG 0x70 "%cont_offset%"
    END
    PATCH_IF ("%items_offset%">="%entrances_offset%") BEGIN
    "items_offset"="%items_offset%"+"%info_ext%"
    WRITE_LONG 0x78 "%items_offset%"
    END
    PATCH_IF ("%infotrig_offset%">="%entrances_offset%") BEGIN
    "infotrig_offset"="%infotrig_offset%"+"%info_ext%"
    WRITE_LONG 0x5c "%infotrig_offset%"
    END
    PATCH_IF ("%amb_offset%">="%entrances_offset%") BEGIN
    "amb_offset"="%amb_offset%"+"%info_ext%"
    WRITE_LONG 0x84 "%amb_offset%"
    END
    PATCH_IF ("%vars_offset%">="%entrances_offset%") BEGIN
    "vars_offset"="%vars_offset%"+"%info_ext%"
    WRITE_LONG 0x88 "%vars_offset%"
    END
    PATCH_IF ("%expbmp_offset%">="%entrances_offset%") BEGIN
    "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
    WRITE_LONG 0xa0 "%expbmp_offset%"
    END
    PATCH_IF ("%doors_offset%">="%entrances_offset%") BEGIN
    "doors_offset"="%doors_offset%"+"%info_ext%"
    WRITE_LONG 0xa8 "%doors_offset%"
    END
    PATCH_IF ("%anim_offset%">="%entrances_offset%") BEGIN
    "anim_offset"="%anim_offset%"+"%info_ext%"
    WRITE_LONG 0xb0 "%anim_offset%"
    END
    PATCH_IF ("%tiled_offset%">="%entrances_offset%") BEGIN
    "tiled_offset"="%tiled_offset%"+"%info_ext%"
    WRITE_LONG 0xb8 "%tiled_offset%"
    END
    PATCH_IF ("%songs_offset%">="%entrances_offset%") BEGIN
    "songs_offset"="%songs_offset%"+"%info_ext%"
    WRITE_LONG 0xbc "%songs_offset%"
    END
    PATCH_IF ("%rest_spawns_offset%">="%entrances_offset%") BEGIN
    "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
    WRITE_LONG 0xc0 "%rest_spawns_offset%"
    END
    PATCH_IF ("%automap_offset%">="%entrances_offset%") BEGIN
    "automap_offset"="%automap_offset%"+"%info_ext%"
    WRITE_LONG 0xc4 "%automap_offset%"
    END


    BUT_ONLY_IF_IT_CHANGES //******************************************************** ~NorthNashkelRoad~
  • elminsterelminster Member, Developer Posts: 16,317
    Yea I'm still not sure what the issue is. I don't think its the launch point. Anyways thanks for the help @Red_Carnelian
  • MusignyMusigny Member Posts: 1,027
    perhaps one of those things:
    1- party required flag + no convergence towards an exit/launch point does not seem logical.
    2- your bounding box does not match your vertices.
  • elminsterelminster Member, Developer Posts: 16,317
    Nah no dice. But thanks for the help. I'll figure it out eventually. :)
  • MusignyMusigny Member Posts: 1,027
    another try:
    - I do not really understand that flag but... bit11 in the flags (connected to door / condition on door) as I see doors are likely to be involved in your code.
    - travel to a door instead of an entrance ? or more generally a swap between names, something like destination door1003 instead of exit1003 using your naming convention.
    - copy_existing from a filesystem file ?
  • elminsterelminster Member, Developer Posts: 16,317
    Yea got it to work. Probably had something to do with the entrance names.
  • elminsterelminster Member, Developer Posts: 16,317
    edited June 2016
    Hey, so I seem to have run into a snag with an NPC mod I've been working on. If anyone could look it over and tell me why the dialogs (so the P, J, and B dialogs) mentioned in pdialog.2da /Interdia.2da aren't running I'd appreciate it (its probably something incredibly stupid that I've done that I'm just not seeing). They seem to run fine for my other npc mod that uses the same kind of format.

    (You can find Jenora in SoD in BD0020 at the front of the line to Sorcerous Sundries)
  • argent77argent77 Member Posts: 3,478
    edited June 2016
    @elminster SoD uses a bunch of extra files for all kinds of stuff which is all defined in CAMPAIGN.2DA. For example, in a clean SoD installation BDDIALOG.2DA is used instead of PDIALOG.2DA. You can use a set of WeiDU functions I created some time ago for retrieving campaign-specific information.
  • elminsterelminster Member, Developer Posts: 16,317
    Thanks!
Sign In or Register to comment.