Jump to content


pro5's Content

There have been 58 items by pro5 (Search limited from 05-June 23)


By content type

See this member's


Sort by                Order  

#566897 Support for non-ANSI systems

Posted by pro5 on 15 February 2014 - 12:12 PM in Infinity Animations

OK, a quick follow-up on this while we're waiting for Miloch.
 
It seems that the Reference Picker program actually does not need any updates whatsoever - all it does is read the contents of the anims.list file from the same folder, and looks for the first open slot of appropriate type in that list when claiming a new animation slot. I swapped all slot prefixes in that file with new symbols, and it worked like a charm after that. This is very good news, 'cause I was worried someone (read: me) would have to rewrite it from scratch to make this work. I'm attaching the modified .list file and the .txt with latest reference list converted to new symbols in case someone wants to try this.
 
Locally, all ref slots have been converted to use new symbols. No significant problems so far. The only thing I haven't figured out yet are several dragon slots - they appear to be using a few non-conventional characters that are not used anywhere else in the .exe patch plus I'm yet to locate their offsets in the executable:
0x122c    XDRµ    EMPTY                                 HUGE   D Do  DRAGONS (XDR) unpaletted
0x122d    XDRР   EMPTY                                 HUGE   D Do  DRAGONS (XDR) unpaletted
0x122e    XDRÞ    EMPTY                                 HUGE   D Do  DRAGONS (XDR) unpaletted
0x122f    XDRØ    EMPTY                                 HUGE   D Do  DRAGONS (XDR) unpaletted
0x1230    XDRÑ    EMPTY                                 HUGE   D Do  DRAGONS (XDR) unpaletted
0x1231    XDRÆ    EMPTY                                 HUGE   D Do  DRAGONS (XDR) unpaletted
0x1232    XDR    EMPTY                                 HUGE   D Do  DRAGONS (XDR) unpaletted
0x1233    XDRß    EMPTY                                 HUGE   D Do  DRAGONS (XDR) unpaletted
0x1234    XDRÇ    EMPTY                                 HUGE   D Do  DRAGONS (XDR) unpaletted
Fortunately, there are 35 more dragon slots free to use apart from these, but still.
 
The next step will be thorough testing of all slots listed in anims.list to make sure I didn't miss any old symbol references, and didn't replace something I shouldn't have.
 
Current table of symbol swaps in reference names: 
 OLD:          NEW:
µ = 0xb5  ->    0x7e = ~
Æ = 0xc6  ->    0x7d = }
¢ = 0xa2   ->    0x2b = +
£ = 0xa3   ->    0x7b = {
¥ = 0xa5   ->    0x2c = ,
Ð = 0xd0   ->    0x26 = &
Þ = 0xde   ->    0x27 = '
Ø = 0xd8   ->    0x3d = =
If anyone has objections about the chosen replacements now's the time to speak out, before I start full testing of the changes.

Attached Files




#566770 Support for non-ANSI systems

Posted by pro5 on 08 February 2014 - 12:53 AM in Infinity Animations

You should ask Miloch who is working on the next version of I.A. As far as I know, it will include the remplacement of the animation codes in a way that should solve the subject of this topic. But ask him to be sure. ;)
Oh, I'm counting on Miloch to eventually notice I invaded his forum and started hacking his mod. :P I know he's one busy half-orc these days. But if you're saying he's been working on the same problem already, maybe I should wait for his input before wasting more time on this.
As far as I know, the source code was never released. I just forcefully decompiled it, but it may not have recreated the syntax to 100% of original (see the"Tidy Error"s). It's a start anyway.
Thanks, this could come very useful later if the converted patch ever gets finalized.



#566905 Support for non-ANSI systems

Posted by pro5 on 15 February 2014 - 11:57 PM in Infinity Animations

Argh !!! ;)

I will need to use new dragons slots (5 Tarasques and maybe more than a dozen new dragons if I can deal with their palettes).

So what do you mean : are the "35 more dragon slots free to use" vanilla ones (inluded in IE) or the number of free slots available in I.A. ?
As far as I can see, there are a total of 44 dragon (XDR) slots in anims.list, from entry 0x1209 to 0x1234. None of them are officially taken yet, all are free to use, judging by the latest ref list posted in this forum. Sounds like you will be taking a good chunk of them, Gwendolyne. :) Are you sure you need all the different paletted types?



#566916 Support for non-ANSI systems

Posted by pro5 on 16 February 2014 - 09:50 AM in Infinity Animations

I was referring to the adult version. The green ring should be the same as the normal dragons.
There's an adult version? The file you linked only has the young dragon, and there's no adult listed in current reference list... Yes, the foot circle used by the young animation is the same size (HUGE) as the XDR slots. The BGI MONSTER LONG 4 PART slot refspapce is split into 2 parts, entries in 0x1001 to 0x10ff range have LARGE foot circle, and 0x1101 through 0x11ff have HUGE foot circle size. The young white dragon uses the first entry (0x1101) in the second range.
Gwendolyne can just replace the palette on the creature file by the same means that ... no I actually don't know what it means... as Gwendolyne has done this, but... apparently there's problem !?!
So Gwendolyne just needs to append the animate.ids and name the files correctly... or ?
From that thread, looks like what he did was repalette a group of bam files using several different bmp palette files. Thus, he now has several sets of dragon and tarrasque BAMs, each of different "coloring". Each of them will require its own separate animation slot (entry in ANIMATE.IDS) to show up in the game, and will be treated as a standalone animation by the engine (the engine has no idea they are in any way similar, it just draws the contents of the BAM files as indicated by the animation id field in the CRE files). There's no problem, unless occupying 15-20 out of 44 available XDR slots for basically the same 2 recolored animations can be called such.



#566920 Support for non-ANSI systems

Posted by pro5 on 16 February 2014 - 10:36 AM in Infinity Animations

The second (under human) is wyvern_white_big, not a dragon. :)

It should show up on the tooltip if you hover your mouse over the picture in the readme for a bit.



#566751 Support for non-ANSI systems

Posted by pro5 on 07 February 2014 - 02:00 PM in Infinity Animations


- CLUAConsole:CreateCreature("P5Tst") - Should look like a Bovine Axe Thing. Drawn location will not match foot circle - this particular animation is not centered properly.
 

 
Strange. It should have been fixed a few months ago : http://www.shsforums...-thing-axe-bug/
 
 
 



I might have the old version archive, before it was updated (these files have been gathering dust on my hdd for a while).

Meanwhile, I think I got another ref slot to work. CHARACTER BGII WQM which used to be referenced by "¢_¢_" has been switched to "+_+_". Tested on MOINESSE_NINJA_MALE_HUMAN animation (¢A¢B --> +A+B).

I was wondering about the ia_reference_picker program that comes packaged with IA. Was its source code ever publicly shared anywhere, or was it only Erephine who had it? If I manage to get this .exe patch fully switched (that's a big IF for now), the app ideally should be updated to accept lists with new symbol references as input, as well as hand out ready-to-use slot ids when claiming new slots. Otherwise, the process of claiming a new slot could become complicated...



#566912 Support for non-ANSI systems

Posted by pro5 on 16 February 2014 - 08:15 AM in Infinity Animations

The IwD young white dragon uses one of BGI MONSTER LONG 4 PART slots, not one of the dragon slots.

I'm not sure what you're asking is even possible - all "color-cloned" animations in the vanilla game which use different palettes for the same set of BAMs still occupy different slots for each variation. For example, each type of spider takes 1 entry in ANIMATE.IDS, even though they all use the same animation with different bmp palette:
0x7A00 SPIDER_GIANT
0x7A01 SPIDER_HUGE
0x7A02 SPIDER_PHASE
0x7A03 SPIDER_SWORD
0x7A04 SPIDER_WRAITH

It's the same for vanilla dragons (except black and silver).

The "paletted" bit in the slots descriptions refers to them using character colors (major/minor/hair/metal/etc colors in the CRE file), not to them being able to swap BMP palettes in some way while only taking 1 animation entry slot. At least that's my understanding so far.



#566734 Support for non-ANSI systems

Posted by pro5 on 06 February 2014 - 02:37 PM in Infinity Animations

I could try, although exe patching is out of my usual area of expertise. But the devdoc file has some notes on offsets in the executable, and my initial attempts to decipher them have not been completely unsuccessful.

I've tinkered with 'µ' and 'Æ' refs and replaced them with '~' and '}'. The result appears to work, at least the animations show up. If a few people could check this and confirm it doesn't crash and burn on their end before I attempt the other slots, that'd be great.

Usage:
- unpack and install the test component
- start a new game or load existing save, shouldn't matter
- CLUAConsole:CreateCreature("P5Tst") - Should look like a Bovine Axe Thing. Drawn location will not match foot circle - this particular animation is not centered properly.
- CLUAConsole:CreateCreature("P5Tst2") - Should look like a Nabassu.
- CLUAConsole:CreateCreature("P5Tst3") - Should look like a Chimera.

Attached Files




#566731 Support for non-ANSI systems

Posted by pro5 on 06 February 2014 - 10:47 AM in Infinity Animations

Why not use various punctuation symbols like these instead?
 }  (ascii code 0x7D)
 `  (ascii code 0x27)
 ,  (ascii code 0x2C)
 &  (ascii code 0x26)
 ~  (ascii code 0x7E)
 {  (ascii code 0x7B)
 $  (ascii code 0x24)
 =  (ascii code 0x3D)
 +  (ascii code 0x2B)
They are valid filename symbols (in Windows at least, no idea about Mac or Linux), and they are NOT widely used in mods, despite what IA devdoc file says. Not to mention this mod will only ever use them for BAM and (very few) 2DA resources, reducing the chances for any potential conflict further. All these symbols exist with same ascii codes in Japan windows codepage 932 and russian 1251 (I think those were the ones who had problems with IA originally?).

The current solution to force a user to CHCP and reboot every time IA (or any mod using IA) needs to be (re)installed seems, frankly, horrible to me.



#564514 P5Tweaks

Posted by pro5 on 22 November 2013 - 10:48 AM in Miscellaneous Released Mods

Updated original post with current version, readme and download link.

 

Big thank you to Miloch for maintaining the mod and (apparently) fixing my mistakes. My apologies for this.:)




#564956 [RELEASE] BAM Batcher

Posted by pro5 on 04 December 2013 - 01:11 PM in IE Modding Tools

Hey Miloch. I'm hitting an error when trying to convert standard rakshasa animations (MRAK*.BAM) to bmp. It successfully converts first 14 frames but on the 15th this happens:

 

Converting frame 15 (compressed): reading datasize -21067 from offset 23429 ...
ERROR: illegal 44-byte read from offset 3080 of 0-byte file INNER_PATCH "%fm%"
ERROR: [MRAKG1.BAM] -> [bambatch/bam/MRAKG1.BAM] Patching Failed (COPY) (Failure("INNER_PATCH \"%fm%\": read out of bounds"))
Stopping installation because of error.

 

Looks like the patching goes on even if the calculated frame size was invalid.




#564983 [RELEASE] BAM Batcher

Posted by pro5 on 05 December 2013 - 12:09 PM in IE Modding Tools

Tinkered with it a bit more today, I think this should do it:

 

 

//! Convert BAMs to BMPs /////////////////////////////////////////////////////
BEGIN ~Convert BAMs to BMPs~
SUBCOMPONENT ~BAM Batcher~
NO_LOG_RECORD

//COPY_EXISTING_REGEXP GLOB ~mspi.+\.bam~ ~bambatch/bam~
COPY - ~bambatch/bam~ ~bambatch/bam~
  READ_ASCII 0x0 sg (4) //Signature
  PATCH_IF (~%sg%~ STRING_EQUAL_CASE ~BAMC~ = 1) BEGIN
    READ_LONG 0x8 dl //Uncompressed data length
    DECOMPRESS_REPLACE_FILE 0xc (SOURCE_SIZE - 0xc) dl
    sz = dl
  END ELSE BEGIN
    sz = SOURCE_SIZE
  END
  SPRINT bn ~%SOURCE_RES%~
  PATCH_PRINT ~Converting %SOURCE_FILE% to bitmaps ...~
  READ_SHORT 0x8 fc //Frame count
  READ_LONG 0x10 pf //Palette offset
  READ_ASCII pf pt (1024)
  READ_ASCII (pf + 3) nl (1) //Null
  READ_LONG 0xc fn //Frame entry offset
  FOR (f1 = 0; f1 < fc; f1 += 1) BEGIN //Frame loop
    SET BadFrameSkip = 0
    SPRINT xl ~~ //End of line
    READ_SHORT (f1 * 0xc + fn) fw //Frame width
    df = (fw / 4) * 4
    PATCH_IF df < fw BEGIN
      lz = df + 4 //Line size
      df = lz - fw //Byte difference
      FOR (g1 = 0; g1 < df; g1 += 1) BEGIN
        SPRINT xl ~%xl%%nl%~
      END
    END ELSE BEGIN
      lz = fw
      df = 0
    END
    READ_SHORT (f1 * 0xc + fn + 2) fh //Frame height
    READ_LONG (f1 * 0xc + fn + 8) fd //Frame data offset   
    cp = NOT ((fd & 0b10000000000000000000000000000000) >> 31) //Compression
    fd = (fd & 0b01111111111111111111111111111111)    
    PATCH_IF cp = 0 BEGIN
      ds = (fw * fh) //Data size     
      PATCH_IF (%ds% > 1) BEGIN     
          PATCH_PRINT ~Converting frame %f1% (uncompressed): reading datasize %ds% from offset %fd% ...~
        READ_ASCII fd fm (ds)       
      END  // PATCH_IF (%ds% > 1)
      ELSE BEGIN
        SET BadFrameSkip = 1
      END
     
    END ELSE BEGIN
      PATCH_IF f1 < (fc - 1) BEGIN
        READ_LONG ((f1 + 1) * 0xc + fn + 8) nf //Next frame data offset
        nf = (nf & 0b01111111111111111111111111111111)
        ds = (nf - fd)
      END ELSE BEGIN
        ds = (sz - fd)
      END     
      PATCH_IF (%ds% > 1) BEGIN     
          PATCH_PRINT ~Converting frame %f1% (compressed): reading datasize %ds% from offset %fd% ...~
          tx = 0 //Transparency index cleared
          SPRINT fm ~~ //Clear frame data
          cc = 0 //Column count
          FOR (f2 = 0; f2 < ds; f2 += 1) BEGIN //Crawl through frame data
            PATCH_IF tx = 0 BEGIN //If transparency set to 0 (1st byte or non-transparent reached)
              READ_BYTE (fd + f2) bt //1st byte hex value
              READ_ASCII (fd + f2) bx (1) //1st byte ASCII value
              PATCH_IF (bt = 0) AND (f2 < (ds - 1)) BEGIN //If byte is transparent and not last pixel
                READ_BYTE (fd + f2 + 1) bv //Next byte
                FOR (f3 = 0; f3 < (bv + 1); f3 += 1) BEGIN //Augment transparent pixels
                  SPRINT fm ~%fm%%bx%~ //Add byte ASCII value
                  cc += 1 //Column counter
                  PATCH_IF (cc = fw) AND (df > 0) BEGIN //If column is frame width and there's a difference
                    SPRINT fm ~%fm%%xl%~ //Pad line with extra BMP nulls
                    cc = 0 //Reset column counter
                  END
                END
                tx = 1 //Transparency set
              END ELSE BEGIN //If not transparent or last pixel
                SPRINT fm ~%fm%%bx%~ //Add byte ASCII value
                cc += 1 //Increase column counter
                PATCH_IF (cc = fw) AND (df > 0) BEGIN //If column is frame width and there's a difference
                  SPRINT fm ~%fm%%xl%~ //Pad line with extra BMP nulls
                  cc = 0 //Reset column counter
                END
              END
            END ELSE BEGIN //If transparency is not 0
              tx = 0 //Set to 0
            END
          END         
      END  // PATCH_IF (%ds% > 1)
      ELSE BEGIN
          SET BadFrameSkip = 1
      END
     
    END  // ELSE (PATCH_IF cp = 0)


    PATCH_IF %BadFrameSkip% = 0 BEGIN   
        SPRINT fk ~~
        INNER_PATCH ~%fm%~ BEGIN
          FOR (g2 = fh; g2 > 0; g2 -= 1) BEGIN //Reverse rows for BMP
            PATCH_IF cp = 0 BEGIN //If compressed
              READ_ASCII ((g2 - 1) * fw) fl (fw) //Read frame width
              SPRINT fk ~%fk%%fl%%xl%~ //Pad with extra nulls
            END ELSE BEGIN
              READ_ASCII ((g2 - 1) * lz) fl (lz) //Read padded line width
              SPRINT fk ~%fk%%fl%~
            END
          END
        END
        fz = (0x436 + (lz * fh))
        INNER_ACTION BEGIN
          COPY ~bambatch/header.bmp~ ~bambatch/bmp/%bn%%f1%.bmp~
            WRITE_LONG 0x2 fz //File size
            WRITE_LONG 0x12 fw //Width
            WRITE_LONG 0x16 fh //Height
            WRITE_LONG 0x22 (lz * fh) //Image size
            WRITE_ASCIIE 0x36 ~%pt%~ //Color table
            READ_LONG 0x36 p0
            PATCH_IF p0 = 0x9797 BEGIN
              WRITE_LONG 0x36 0xff00 //Fix cyan transparency to green
            END
            //Uncomment line below to write a brown background (similar to in-game look)
            //WRITE_LONG 0x36 0x352e21
            READ_LONG 0x3a p1
            PATCH_IF p1 = 0xff6597 BEGIN
              WRITE_LONG 0x3a 0x080808 //Fix pink shadow to dark grey
            END
            INSERT_BYTES 0x436 (lz * fh)
            WRITE_ASCIIE 0x436 ~%fk%~ //Raster data
          BUT_ONLY
        END       
    END  //  PATCH_IF %BadFrameSkip% = 0
    ELSE BEGIN
        PATCH_PRINT ~Skipping frame %f1% - invalid frame size.~
    END

    
  END  // FOR
BUT_ONLY

 

Basically, just added skipping any frame with frame size 1 x 1 or less - those "pixel" frames are really useless for editing, and if anyone needs to reinsert them later into modified animation bams it should be easy to just clone any one of them with weidu.  Rakshasa animation, as it happens, contains tons of those, so this greatly speeds up conversion process too. The loop index variable still goes up for skipped frames, so for example if out of 100 frames 14-65 were skipped, you'll get *0.bmp through *13.bmp and *66.bmp through *100.bmp in the output folder.

 

Attached Files




#565281 [RELEASE] BAM Batcher

Posted by pro5 on 17 December 2013 - 07:39 AM in IE Modding Tools

(And erm, yeah, if you are doing advanced BAM manipulation for stuff like animations, drop me a PM... might be able to hook you up...)

Done. :)  Been away from BG and IE games and modding, but the stir EE raised has brought me back home, at least for now.




#566562 [MOD in the works] Liella, the saucy bard companion

Posted by pro5 on 29 January 2014 - 08:40 PM in IE Modding Discussion

Sounds interesting, I'll be watching your progress. :)

I hope you reconsider this part though:
The current plan is to not even release the mod for playing at all if there is no voice-acting present

I for one actually prefer not to have any voicing in mods I use - it's difficult to match the performance and quality of vanilla characters in modding projects and nearly always it stands out as something that does not belong in the game.



#566888 [MOD in the works] Liella, the saucy bard companion

Posted by pro5 on 15 February 2014 - 03:06 AM in IE Modding Discussion

I think you need to PM Kaeloree for a forum here.




#567084 BP 181 bugs?

Posted by pro5 on 25 February 2014 - 06:52 AM in Big Picture

So, on a whim, I assigned Firebeard the vanilla script equivalents of the BP scripts--mage6 and wtasight. Did you try this test? I had the same results as with the BP scripts. Firebeard still attacked. So, obviously there's something going on, but BP is innocent I say. I don't see anything in his CRE file to cause this either. Not sure what exactly to expect, but if you installed just bp and bgt like I did, and BP is not to blame, nor the vanilla game, what's left? tob-ex and bgt. I don't recall ever seeing this in the early days of bgt, before there was a tob-ex, so tob-ex is my suspect.
I didn't try it, but I'm trying it now and I also tried uninstalling BP. I hate to say it, but in either case (changing script to mage6 and uninstalling) , Firebeard doesn't attack on my end. To be sure, I tried several times, because I noticed earlier there's a certain randomness to the result (in one case during my earlier tests, he didn't attack me; although in the next attempt in exact same install, he did).

The vanilla MAGE6 script only has 80 lines and every block starts with See(NearestEnemyOf(Myself)) condition... are you certain yours is the same when he's assaulting you with it? I don't think BGT includes anything from TobEx, as Ascension64 specifically did not want it to depend on the latter. It doesn't even include the exe patch to remove songlist limit - that one was outsourced into BGTMusic.

I'll understand if you don't want to waste more time on debugging this, but it'd be nice to have a bit more clarity as to what causes this.



#567090 BP 181 bugs?

Posted by pro5 on 25 February 2014 - 11:43 AM in Big Picture

Um, are you sure you're not overreacting on this, Horred?

When I tested the behavior of the empty execution blocks earlier (after you clarified that they should stop current script but move on to the next one in script stack), I confirmed that they are in fact working as you describe. Just not in the first AI round, when they fall through. I'll do more testing in the next few days to be sure, but if this is correct - it's hardly an insurmountable problem, OnCreation() triggers should help.

Also, I have to ask, is it possible it always worked like this and the "fire shield" and other buffs firing (which you admitted happened), for instance, was caused by it? After all, Firebeard is only casting offensive spells first because he doesn't have buffs like Ghost Armor memorized, otherwise the script would prioritize them...



#567093 BP 181 bugs?

Posted by pro5 on 25 February 2014 - 12:33 PM in Big Picture

We eliminated all but one theory: the new GoG.com installation broke this function. The original vanilla scripts never use it, so maybe they totally overlooked its usefulness when recompiling the engine.
I'm pretty sure my ToB copy is not GoG, it's a backup I created ages ago from some ancient CD version.

For your WeiDU code, this should do the trick
<<<<<<<< ...\p5-inlined\src.baf
IF
  OR(2)
	!Allegiance(Myself,EVILCUTOFF)
	!Detect([GOODCUTOFF])
THEN
  RESPONSE #100
END
>>>>>>>>

<<<<<<<< ...\p5-inlined\dest.baf
IF
    OR(2)
        !Allegiance(Myself,EVILCUTOFF)
        !Detect([GOODCUTOFF])
    Global("TOB_SUXX","LOCALS",0)
THEN
    RESPONSE #100
        SetGlobal("TOB_SUXX","LOCALS",1)
END

IF
    OR(2)
        !Allegiance(Myself,EVILCUTOFF)
        !Detect([GOODCUTOFF])
    Global("TOB_SUXX","LOCALS",1)
THEN
    RESPONSE #100
END
>>>>>>>>

SILENT
COPY_EXISTING_REGEXP GLOB ~BP.*\.bcs~ ~override~
	R_B_B ~...\p5-inlined\src.baf~ ~...\p5-inlined\dest.baf~
BUT_ONLY
VERBOSE
This won't catch other shutoff blocks, obviously, so you might need to repeat this for every one of them.



#567100 BP 181 bugs?

Posted by pro5 on 25 February 2014 - 08:32 PM in Big Picture

Now that you mention it... all we had to do was look in the IESDP under Continue(). :)
Use of continue in a script block will cause the parser to treater subsequent empty response blocks as though they contained a Continue() command - this parsing can be stopped by including a NoAction() in the empty response block.
Good to know EE fixes that.
 
However, @pro5 I greatly appreciate your diligence in reporting, your support and your code offer.
No problem, glad it all worked out in the end.



#567064 BP 181 bugs?

Posted by pro5 on 24 February 2014 - 02:04 PM in Big Picture

Was able to reproduce it again on a clean install with this WeiDU log:
~BG2FIXPACK/SETUP-BG2FIXPACK.TP2~ #0 #0 // BG2 Fixpack - Core Fixes: v10
~BG2FIXPACK/SETUP-BG2FIXPACK.TP2~ #0 #1000 // BG2 Fixpack - Game Text Update -> GTU Light (by Wisp): v10
~SETUP-BGT.TP2~ #0 #0 // Baldur's Gate Trilogy - Core: 1.18 (28 Apr 13)
~SETUP-BGTMUSIC.TP2~ #0 #2 // Baldur's Gate Trilogy - Music -> Full Baldur's Gate/Shadows of Amn/Throne of Bhaal Music (WARNING: patches BGMain.exe)
~BP/SETUP-BP.TP2~ #0 #0 // Big Picture, core component (required for most subcomponents): v181-b4611
~BP/SETUP-BP.TP2~ #0 #10 // Patching all the existing innate spells, setting level to one.....: v181-b4611
~BP/SETUP-BP.TP2~ #0 #500 // Generic Mages: v181-b4611
~BP/SETUP-BP.TP2~ #0 #150 // Generic Creature & Script Processing: v181-b4611

In case it matters for script targeting, I always used the same choices in character generation (and I always started a new game for each test): male, human, fighter.



#567035 BP 181 bugs?

Posted by pro5 on 23 February 2014 - 09:09 AM in Big Picture

After starting a new BGT game, I was a bit surprised to have Firebeard Elvenhair start casting hostile spells (in various attempts it was either horror, melf's acid arrow, or magic missile) at me right after first entering Candlekeep Inn. He remained neutral (blue circle) and did not cast more spells after the first one.

I tracked the problem down to BPMAGE6 script the old man had assigned.

This script block (used in most BP scripts, apparently) should be preventing the above from happening - in theory. Hostile actions follow it, so they won't get a chance to execute if this block fires:
IF
  OR(2)
  !Allegiance(Myself,EVILCUTOFF)
  !Detect([GOODCUTOFF])
THEN
  RESPONSE #100
END
However, for some reason it doesn't work on the first round after entering the area. The engine seems to treat such empty block as one with Continue() and Firebead happily proceeds to blast LastSeenBy(hisass) with all his sorcerous might.

I added NoAction() into the block and this appears to have fixed the problem:
IF
  OR(2)
  !Allegiance(Myself,EVILCUTOFF)
  !Detect([GOODCUTOFF])
THEN
  RESPONSE #100
    NoAction()
END

At first I thought this was a result of some other mod messing with BP scripts (I was running large BWS install), but then I was able to reproduce this on a cleaner BGT + BP only install, so I'm reporting the problem.

The total amount of BP scripts with exact same script block is over a hundred.



#567055 BP 181 bugs?

Posted by pro5 on 24 February 2014 - 08:44 AM in Big Picture

Thanks, and I'm glad it solved your immediate problem. There's a larger problem with doing this on a grand scale however. The action NoAction() causes all script actions to end for that parsing round. So, no scripts after this, in the entire 5 slots available for creatures, will fire either. This in turn can break far more serious things, than cause something simple like casting a buff spell. To fix this exclusively would require special scripting for Firebeard, not a generic fix that would break dozens of other situations. Honestly, it's just a buff that happens to be visible. For the harm it causes (next to none), I'm not really sure it's worth the time and effort it would take to fix this on a grand scale. It would be easier to add an exclusion for Firebeard, let him keep his vanilla scripts, and be done with it.
Ok, I didn't actually know that empty execution blocks allows lower scripts to fire. Or I did know, but completely forgot - one of those. :P

But I still think there's a better solution than to fix this on an exclusion basis (which would likely miss something somewhere and also wouldn't cover any mod-introduced NPCs unless you're volunteering to add hundreds of compatibility checks into your TP2). I can confirm that this also works:
IF
  OnCreation()
  OR(2)
  !Allegiance(Myself,EVILCUTOFF)
  !Detect([GOODCUTOFF])
THEN
  RESPONSE #100
    NoAction()
END

IF
  OR(2)
  !Allegiance(Myself,EVILCUTOFF)
  !Detect([GOODCUTOFF])
THEN
  RESPONSE #100    
END
Like I originally thought, the problem only happens in the first AI round after entering the area. Additional OnCreation() check prevents it from happening in that particular round. Personally, I'll take the risk of some script not firing at once after entering over risk of getting a fireball or something nastier in my face for no reason. But maybe that's just me. :)

Note that it's not just "buffs" - the consequences depend on the script and the creature, and in this case, Firebeard could cast for instance Melf's Acid Arrow. Which at level 1 in Candlekeep could, well, kill you. Not to mention such things are immersion-breaking.



#567057 BP 181 bugs?

Posted by pro5 on 24 February 2014 - 10:16 AM in Big Picture


Note that it's not just "buffs" - the consequences depend on the script and the creature, and in this case, Firebeard could cast for instance Melf's Acid Arrow. Which at level 1 in Candlekeep could, well, kill you. Not to mention such things are immersion-breaking.

Erhm, if that's so then who ever coded the MAA's casting script was unconsciously cheating, after all it's target needs first of all be visible to the caster--- as the LastSeenBy() by itself should never be used as the target ... but with an inner function, such as LastSeenBy(Myself) ---during the targeting phase. 
 



Targeting blocks are there, but they have Continue(), so the casting phase happens in the same first round. At least that's my guess without picking the script apart line by line.



#567059 BP 181 bugs?

Posted by pro5 on 24 February 2014 - 11:02 AM in Big Picture

Horred, when I say 'for no reason' it means just that. I enter the tavern, he starts casting. There's no fire-shield or any other kind of buff, he's casting offensive spells (usually Horror, sometimes Magic Missile or MAA depending on what the RandomNum triggers roll).

The shutoff block I'm changing is at line 439. The spells being cast (Horror, Magic Missile, MAA) are after it, at lines 1259, 1295, and 1313.

Weidu.log is this:
Spoiler

Attached Images

  • Baldr001.jpg
  • Baldr002.jpg



#567062 BP 181 bugs?

Posted by pro5 on 24 February 2014 - 12:41 PM in Big Picture

When I finish my second job of the day, after this job--if I'm not comatose, I'll dust off my copy and fire up BGT and give this a try. Forgive my skepticism but I need to see it for myself. It's very odd that a script that has been stable for 11 years suddenly acts up, when nobody has touched it.
I understand. I'll try this on a new install on my side just in case to see if maybe my "clean" BGT installation is fubared somehow.