Skip to content

General mod Questions thread

1235770

Comments

  • badungubadungu Member Posts: 53
    edited May 2017
    Hmm, did you use the GET_OFFSET_ARRAY, PHP_EACH and READ_ASCII (spawn_name) before the code?
    Also if you're using this for one area, you can't use BUT_ONLY twice, because that's the last statement for patching a file... ;)

    This should work for you:

    COPY_EXISTING ~someare.are~ ~override~ GET_OFFSET_ARRAY spawns ARE_V10_SPAWN_POINTS //get spawns array (0x60 4 0x64 4 0 0 0xc8) PHP_EACH spawns AS spawns_num => spawns_offset BEGIN //loop through spawns array READ_ASCII spawns_offset spawns_name (32) NULL //read the name of the spawn points PATCH_IF ~%spawns_name%~ STRING_EQUAL_CASE ~Spawn Point 1~ BEGIN //if spawn point name = Spawn Point 1 PATCH_FOR_EACH offset IN 0x24 0x2c 0x34 0x3c 0x44 0x4c 0x54 0x5c 0x64 0x6c BEGIN //patch for these offsets (creature 1-10) WRITE_ASCII spawns_offset+offset ~nxvart_#~ #8 END END PATCH_IF ~%spawns_name%~ STRING_EQUAL_CASE ~Spawn Point 2~ BEGIN //if spawn point name = Spawn Point 2 PATCH_FOR_EACH offset IN 0x24 0x2c 0x34 0x3c 0x44 0x4c 0x54 0x5c 0x64 0x6c BEGIN //patch for these offsets (creature 1-10) WRITE_ASCII spawns_offset+offset ~nxvart_#~ #8 END END END BUT_ONLY
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    edited May 2017
    @Ardanis: Copying it over seems more complicated than I thought.

    It seems that BGEE and BG2EE already both have the same .ini file for the juvenile green dragon, 7F62.ini. Odd thing is, in the entire text of the .ini file...

    // MDRJ_GR dragon_green_juvenile

    [general]
    animation_type=7000
    move_scale=11
    ellipse=48
    color_blood=47
    color_chunks=255
    sound_freq=8
    personal_space=9
    cast_frame=9
    new_palette=MDRJ_GR
    height_offset=220

    [monster]
    can_lie_down=1
    detected_by_infravision=1
    false_color=0
    path_smooth=1
    resref=MDRJ
    split_bams=0

    [sounds]
    attack=black01a,blank
    attack_frame=2,0
    awake=
    awake_frame=0
    cast=black02a
    cast_frame=0
    conjure=black03a
    conjure_frame=0
    damage=black06
    damage_frame=0
    die=black07
    die_frame=0
    head_turn=
    head_turn_frame=0
    ready=
    ready_frame=0
    shoot=
    shoot_frame=0
    twitch=
    twitch_frame=0
    walk=
    walk_frame=0
    attack_slash=black03a,blank
    attack_slash_frame=2,0
    attack_backslash=black04a,blank
    attack_backslash_frame=2,0
    attack_jab=black05,blank
    attack_jab_frame=2,0
    emerge=
    emerge_frame=0
    hide=
    hide_frame=0
    sleep=
    sleep_frame=0
    battle_cry=black01a,black02a
    battle_cry_frame=0,0
    selection=black01a
    selection_frame=0
    fall=fal_03b
    fall_frame=0

    ...the only apparent reference to a BAM is "MDRJ." But there is no such BAM; the closest thing is "MDRJG1" and "MGRJG2." I created a new copy of each file from BGEE, then pasted the copies into my BG2EE override folder, and then changed their names back to the original, MDRJG1 and MDRJG2.

    I can select "Dragon Green Juvenile" in EEKeeper, but it doesn't show up properly in Chateau Irenicus. It gives my character the right size circle, but the sprite doesn't show up; it's invisible.

    I notice there is a reference in the .ini file to an "MDRJ_GR" palette. If BG2 is missing the right palette, maybe the game is trying to color in the sprite with a non-existent palette, hence the invisibility. But I don't know where to find that palette or how to copy it over.

    I also notice that, comparing 1200.ini to 7F61.ini, the red dragon .ini to the juvenile red dragon .ini, the former has an extra line:

    quadrants=9

    Yet adding that line, in the same place, to the 7F62.ini does not make the juvenile green dragon appear in BG2.

    The only remaining difference I can see is that the red dragon BAM is spread out over a bunch of different BAMs, all starting with MDR1. It goes from MDR11100 to MDR15918, so there are a lot of them. Yet the green one only has 2 BAMs: MDRJ1 and MDRJ2, which have about 70 different cycles each--far more than the red dragon's BAMs. This suggests to me that SoD and BG2EE handle the BAM files differently, but I don't know how it works or how to translate it.

    Any idea what I'm missing? If not, do you know anyone who might know?
    Post edited by semiticgoddess on
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    It seems that BG2EE's ANIMATE.ids already has all the same lines as BGEE's, so there's no difference there. ANISND.ids has different lines (far fewer in BG2EE), but manually copying over the right line from BGEE's ANISND.ids file, or even copying over the entire thing, all 500 lines of it, fails to get the green dragon to show up.

    I'm still stumped.
  • badungubadungu Member Posts: 53
    edited May 2017
    @semiticgod,

    I think you only have to copy over these two files (these are the only missing dragon animations in BG2EE):
    MDRJG1.BAM
    MDRJG2.BAM

    (That's Firkraag with the DRAGON_GREEN_JUVENILE animation btw. :smiley: )

  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @badungu: That's what I did copy over, among other things. I have both of those BAMs in my BG2EE override folder now.
  • badungubadungu Member Posts: 53
    Hmm, strange, I only copied over these two files and changed Firkraags animation to DRAGON_GREEN_JUVENILE - 32610...

    Maybe the animation is invisible on your character, because he has a weapon, an armor or something else equipped?
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    I've got both BAMs; that was the first thing I did.

    But whether I assign the animation in EEKeeper or use Near Infinity to give the animation to a copy of Jaheira summoned via the console...

    ...it's invisible.
  • badungubadungu Member Posts: 53
    edited May 2017
    Hmm, tried assigning the animation to my character and it works fine:



    Maybe your MDRJ1G1.BAM should be renamed to MDRJG1.BAM... ;)

    Edit: If that doesn't help, I attached my two files, maybe you'll have to delete your edited files also...
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    Good eyes, @badungu!

    Funny thing, that. I quadruple-checked the file name, but it seems I only noticed the first file name, and overlooked the typo on the second. I'm glad I posted that screenshot, and I'm glad you saw the number I didn't. Thank you!

    It now displays properly.
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    It looks like bringing SoD animations into BG2 is a simple process:

    1. Look up the .ini file for the animation you want to move. I can't do it when using Near Infinity on my BG1 install, but I can do it in Near Infinity for BG2 because there's a button that shows you the right .ini file when you're looking up an animation on a creature file:

    2. Go through the .ini file text and find the reference to the BAM in question.
    3. Make copies of the BAMs using Near Infinity.
    4. Cut and paste the BAM files to your BG2 override folder.

    Then, you can apply the animations using Near Infinity or EEKeeper.
  • chimericchimeric Member Posts: 1,163
    @badangu , Your code for spawns works, thanks!
  • chimericchimeric Member Posts: 1,163
    edited May 2017
    Now I'm trying to edit an info trigger with

    COPY_EXISTING ~AR5000.are~ ~override~
    WRITE_SHORT 0x17fc ~-1~
    WRITE_ASCII 0x1814 ~CVTRIG_#~

    The first write is for the "info text," which I'd like to set to nothing, but "Invalid string" pops up instead. How do I make an info trigger shut up and just run my script from the second function?

    Edit: okay, triggers have a "trigger silent" flag, which should fit the bill, but how do I set it with Weidu? The offset is 0x1814 for this one, a 4-byte value.
  • kjeronkjeron Member Posts: 2,367
    @chimeric RE: How to Mark the Death of an Innocent
    IF
      Class(Myself,INNOCENT)
      AttackedBy(Player1,0)
      Die()
    THEN
      RESPONSE #100
        Do something()
        Continue()
    END
    I would put it at the top of SHOUT.BCS and its variants for each game(BDSHOUT, BDSHOUTG, GPSHOUT, etc...).
  • chimericchimeric Member Posts: 1,163
    edited May 2017
    Thank you. I've already fixed this with a patch for all creatures of the INNOCENT class. They had no class script, now they do, similar to yours.

    How about that question about setting flags?
  • ArdanisArdanis Member Posts: 1,736
    edited May 2017
    kjeron said:


    Class(Myself,INNOCENT)
    AttackedBy(Player1,0)
    Die()

    Class(Myself,INNOCENT)
    Allegiance(LastAttackerOf(Myself),[PC]) // or InParty(LastAttacker(...))
    Die()
  • chimericchimeric Member Posts: 1,163
    kjeron's version works.
  • kjeronkjeron Member Posts: 2,367
    @chimeric
    Mine triggers for only Player1 making the kill. Your post example referenced Player1 directly, so that is what I used.
    Ardanis's version triggers for any party member making the kill.
    Which one you'll want depends on how your using it.
  • chimericchimeric Member Posts: 1,163
    I'll be using it to follow the main character as he kills innocents to satisfy a demon.
  • chimericchimeric Member Posts: 1,163
    I'm looking for a way to make sure every NPC in the party and the main character have a special ability, right from the start of the game. Or perhaps when they join the party. In any case, once they are in, they should automatically have it, all of them. What's the simplest way to do that?
  • ArunsunArunsun Member Posts: 1,592
    Well it depends on what you want

    If you just want to give them an ability that already exists (but they don't have), you may just use EEKeeper and edit the creature files corresponding to the NPCs
    If you want to give them a custom ability, you will have to create it using NearInfinity, for example, and then add it to the creature files.
  • The user and all related content has been deleted.
  • chimericchimeric Member Posts: 1,163
    edited August 2017
    No, no. I mean inside the game. I can create the spell in Near Infinity, how do I thrust it on people? There are a few ways I can think of, for example, a baldur.bcs check for a marker spell state on Player1, Player2 and so on. If a Player isn't in that state, then ApplySpellRES on him giving the ability and putting on the spell state. That sort of thing. In fact, this isn't a bad solution.
  • chimericchimeric Member Posts: 1,163
    I didn't know that.
  • kjeronkjeron Member Posts: 2,367
    No spellstate needed, just check '!HaveKnownSpellRES("spellres")'
  • [Deleted User][Deleted User] Posts: 0
    edited August 2017
    The user and all related content has been deleted.
    Post edited by [Deleted User] on
  • chimericchimeric Member Posts: 1,163
    Thanks, kjeron. That's the ticket. But wait, what if the creature has expended the spell? If it's a special ability rather than something in the spellbook. Won't the engine gift the ability for the second time? I usually put a self-restoring function inside, one of the effects is to get the ability back, so there are infinite uses. But if there is moment's chink between expending the ability and the effect returning it, won't the engine insert the ability again?
  • kjeronkjeron Member Posts: 2,367
    edited August 2017
    HaveSpell (must be memorized)
    HaveKnownSpell (memorized or not)
  • chimericchimeric Member Posts: 1,163
    MakeGlobal(), as I understand it, only enables travel between areas with actions like the LUAs. It doesn't by itself transport anybody anywhere without a separate command in the scripts. But suppose that regular enemies are made global and have scripts telling them to, say, jump to Player1. Never mind now where to insert the scripts etc. Could they hike between maps this way? I think that they could not initiate it if they were abandoned in an area by the entire party - then nothing in that area would load. But I've seen that if a party member is teleported somewhere alone, say, using the console, he causes the area to "become alive." It is now part of the active gameplay. Enemies gather up, and there seems to be no obstacle to their taking advantage and hopping between areas also, even out of this one. Script Davaeorn to jump to Player1 upon seeing a PC, then teleport Player3 to the Cloakwood mine, and the wizard will leave his area (if made global). Am I right about this?

    The next question: if a player character can be made to "activate" an area with his presence, what about friendlies carrying opcode 248, Clear Fog of War (Wizard Eye)? If they were teleported to another area or just left there, could they serve to switch it on, so to speak? Has anybody tried this? Of course, the question here is partly how to flip the view to those creatures after they get whisked off and can no longer be clicked on. One of the new Torment opcodes, 349 I think, supposedly moves the view to the spell target, but I don't know if that would work between areas, and anyway those effects are no good for the other games. Maybe people familiar with cutscenes can tell how to switch the screen someplace away from the party.

    Related to this: MakeGlobal() should in most cases be inferior to MakeGlobalOverride(), because there is no reason to create multiple entries for the same creature with a script name. But what about creatures without? Recently I learned that deaths of creatures without script names get recorded on the collective tombstone of one huge death variable as NONE. Deaths of creatures specially given the NONE script name go on the same record. Well, what will happen if a nameless creature is subjected to MakeGlobal()? Is it going to get recorded, and as what? And what if several ordinaries, who in the eyes of the engine have either no name at all or NONE, get recorded with instances of MakeGlobal(), without overriding? Won't each entry for NONE (if that is how they get recorded) be unique?

    It is possible that creatures without script names only get recorded as NONE in their common death variable, and otherwise MakeGlobal() does not work without a "proper" script name. If so, is there any reason not to patch all nameless things with the script name that reads NONE? It won't do any harm, might even be useful for miscellaneous calls, such as when you need to spawn a dozen skeletons, one by one, and order them along. You don't want to give each one a unique script name and you could do without even a group name just for these bonies, like CUSTOM_SKELETON or whatever. With a group name you could, of course, command them in the order of appearance, the name changing reference as another skeleton pops up. But why bother, if you can just use the script name NONE? Spawn one skeleton, and no matter how many ordinaries of all kinds, also called NONE, may have wandered in the area already, this name will now link to the latest NONE in the doorway - your skeleton. Then just keep spawning skeletons and giving your commands to NONE. And the next time you need to spawn another group somewhere else, or an individual standard creature, just repeat this. Convenient. So dubbing ordinaries NONE may have these extra uses. But mainly it should, very likely, work for the purposes of making everyone and his mother global, because it is an actual string.

    If this NONE-globalling works, if all entries so recorded turn out to be unique and there is some way to switch the view to an area away from the party (that's the big one), for the locals to activate their jump drives, we'd be halfway towards all sorts of different dynamics: monster excursions, Flaming First mercenaries following the party inside Durlag's Tower, winter wolves descending to Nashkel or slimes bubbling up. I know I would enjoy a more simultaneous open-map gameplay along the lines of Jagged Alliance 2 rather than being limited to one area at a time. Not that it is worse, if anything, focus and gradual exploration are more mysterious, but we have played the games to death the old way.
  • chimericchimeric Member Posts: 1,163
    Okay... I used to include Remove Spell in castings so the number of uses would always be at 1, it harkens to that. Thanks again.
  • The user and all related content has been deleted.
Sign In or Register to comment.