Jump to content


Photo

Increasing existing affects in characters


  • Please log in to reply
143 replies to this topic

#21 i30817

i30817
  • Member
  • 611 posts

Posted 30 October 2011 - 03:15 PM

I see the idea. But i was thinking of (dunno if it would work, so yell if you think not):

Append this to the end of the override script for each joinable char:
Spoiler

on i3_thief:
Spoiler

Or is this swapping too dangerous somehow?

EDIT: edited the pseudo-code to use the same file so it can try to remove traps and unlock the container at the same time...

Edited by i30817, 05 November 2011 - 05:43 PM.


#22 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 30 October 2011 - 04:53 PM

I wouldn't swap out the script in the override directory slot. extending to the bottom of to handle the hotkey block is fine, but changing the override script itself is asking for trouble with other mods. No the thief actions can be lower on the script priority, if you aren't providing a party ai script leave class open in case the player wants to use one. I'd say leave race open too if they wanna use my party ai script, :P but I don't have a BG2 version yet which swaps scripts around. That leaves General... but it's up to you, race or general to house the area based thief scripts to be swapped. Also override scripts for joinable NPCs are named differently...

IF
     True()
THEN
     ActionOverride(Myself,ChangeAIScript(%original_override%,OVERRIDE))
END
don't do that... True() always returns true and without anything to check against this block will be a script stopper and not allow any blocks following to be parsed ever...

I would combine the traps & locks together... more weidu hieroglyphics :P
OUTER_SPRINT ie_file ~ar~
ACTION_IF (FILE_EXISTS_IN_GAME ~FW2600.are~) THEN BEGIN
 OUTER_SPRINT ie_file ~fw~
END
<<<<<<<< inlined/thief_hk_trap.baf
IF
HotKey(%F2%)
Global("%cont_var%","LOCALS",0)
ActionListEmpty()
!Exists([ENEMY])
AreaCheck("%area%")
!Disarmed("%trigger%")
Range("%trigger%",10)
CheckStatGT(Myself,1,TRAPS)
THEN
RESPONSE #100
SetGlobal("%cont_var%","LOCALS",1)
RemoveTraps("%trigger%")
Continue()
END
>>>>>>>>
<<<<<<<< inlined/thief_hk_lock&trap.baf
IF
HotKey(%F2%)
Global("%cont_var%","LOCALS",0)
ActionListEmpty()
!Exists([ENEMY])
!See([NOTGOOD])
AreaCheck("%area%")
!Disarmed("%trigger%")
Range("%trigger%",10)
CheckStatGT(Myself,1,TRAPS)
CheckStatGT(Myself,1,LOCKPICKING)
THEN
RESPONSE #100
SetGlobal("%cont_var%","LOCALS",1)
RemoveTraps("%trigger%")
PickLock("%trigger%")
Continue()
END
>>>>>>>>
<<<<<<<< inlined/thief_hk_lock.baf
IF
HotKey(%F2%)
Global("%cont_var%","LOCALS",0)
ActionListEmpty()
!Exists([ENEMY])
AreaCheck("%area%")
Range("%trigger%",10)
CheckStatGT(Myself,1,LOCKPICKING)
THEN
RESPONSE #100
SetGlobal("%cont_var%","LOCALS",1)
PickLock("%trigger%")
Continue()
END
>>>>>>>>
<<<<<<<< inlined/thief_hk_lock_cant_disarm.baf
IF
HotKey(%F2%)
Global("%cont_var%","LOCALS",0)
ActionListEmpty()
!Exists([ENEMY])
!See([NOTGOOD])
AreaCheck("%area%")
Range("%trigger%",10)
CheckStatGT(Myself,1,LOCKPICKING)
THEN
RESPONSE #100
SetGlobal("%cont_var%","LOCALS",1)
PickLock("%trigger%")
Continue()
END
>>>>>>>>
PRINT @16
ACTION_READLN ~hk~
OUTER_WHILE ((%hk% != 1) AND (%hk% != 2)) BEGIN
 PRINT @5
 PRINT @16
 ACTION_READLN ~hk~
END
OUTER_SPRINT F2 ~D~
ACTION_IF (%hk% = 1) THEN BEGIN
 PRINT @17
 ACTION_READLN ~F2~
 OUTER_WHILE !(~%F2%~ STRING_COMPARE_REGEXP ~[A-Z]~ =0) BEGIN
  PRINT @5
  PRINT @17
  ACTION_READLN ~F2~
 END
END

PRINT @27

OUTER_PATCH ~this_is_not_a_variable~ BEGIN
 FOR ("i1" = 0x0; "i1" < 0x100; "i1" += 0x1) BEGIN
  WRITE_BYTE 0x0 "i1"
  READ_ASCII 0x0 ~c~ (0x1)
  SPRINT EVALUATE_BUFFER ~0t%i1%~ ~%c%~
 END
END
COPY_EXISTING_REGEXP GLOB ~^%ie_file%.*\.are$~ ~override~
 PATCH_IF (SOURCE_SIZE > 0x11b) THEN BEGIN
  SPRINT area ~%SOURCE_RES%~
  READ_SHORT 0x5a "tc"
  READ_LONG  0x5c "to"
  READ_LONG  0x70 "co"
  READ_SHORT 0x74 "cc"
  READ_LONG  0xa4 "dc"
  READ_LONG  0xa8 "do"
  FOR ("i1" = 0x00; "i1" < ("tc" * 0xc4); "i1" += 0xc4) BEGIN
   SPRINT ~trigger~ ~~
   SPRINT ~co_name~ ~~
   READ_SHORT ("to" + "i1" + 0x68) "trap_detect"
   READ_SHORT ("to" + "i1" + 0x6a) "trap_disarm"
   READ_SHORT ("to" + "i1" + 0x6c) "trapped"
   READ_SHORT ("to" + "i1" + 0x20) trig_type
   READ_LONG ("to" + "i1" + 0x60) flag
   PATCH_IF ( (%trig_type% = 0)
          AND ("trap_detect" < 0x64)
          AND ("trap_disarm" < 0x64)
          AND ((%flag% BAND 0b1000) = 0b1000)
          AND (("trapped" & 0x01) = 0x01) ) THEN BEGIN
    FOR ("i2" = 0x00; "i2" < 0x20; "i2" += 0x01) BEGIN
     READ_BYTE ("to" + "i1" + "i2") "char"
     READ_ASCII ("to" + "i1" + "i2") "char2" (1)
     PATCH_IF (~%char%~ = 32) AND (~%char2%~ STRING_COMPARE_REGEXP ~ ~ =0) BEGIN
      SPRINT ~char2~ ~_~
     END
     PATCH_IF (%char% != 0) BEGIN
      SPRINT ~co_name~ ~%co_name%%char2%~
     END
     PATCH_IF (("char" = 0x00) AND ("i2" = 0x00)) THEN BEGIN
      SET "i2" = 0x20
     END
     ELSE
     PATCH_IF (("char" = 0x00) AND ("i2" > 0x00)) THEN BEGIN
      READ_ASCII ("to" + "i1" + 0x00) ~trigger~ ("i2")
      SPRINT ~cont_var~ ~ab_%area%_%co_name%~
      INNER_ACTION BEGIN
       EXTEND_BOTTOM ~abparty.bs~ ~inlined/thief_hk_trap.baf~
        EVALUATE_BUFFER
      END
      SET "i2" = 0x20
     END
    END
   END
  END
  FOR ("i1" = 0x00; "i1" < ("cc" * 0xc0); "i1" += 0xc0) BEGIN
   SPRINT ~trigger~ ~~
   SPRINT ~co_name~ ~~
   READ_SHORT ("co" + "i1" + 0x2c) "trap_detect"
   READ_SHORT ("co" + "i1" + 0x2e) "trap_disarm"
   READ_SHORT ("co" + "i1" + 0x30) "trapped"
   READ_SHORT ("co" + "i1" + 0x26) "lock_dif"
   READ_LONG ("co" + "i1" + 0x28) "flag"
   PATCH_IF ( ("trap_detect" < 0x64)
          AND ("trap_disarm" < 0x64)
          AND (("trapped" & 0x01) = 0x01)
          AND !((%flag% BAND 0b001) = 0b001) ) THEN BEGIN //trapped only
    FOR ("i2" = 0x00; "i2" < 0x20; "i2" += 0x01) BEGIN
     READ_BYTE ("co" + "i1" + "i2") "char"
     READ_ASCII ("co" + "i1" + "i2") "char2" (1)
     PATCH_IF (~%char%~ = 32) AND (~%char2%~ STRING_COMPARE_REGEXP ~ ~ =0) BEGIN
      SPRINT ~char2~ ~_~
     END
     PATCH_IF (%char% != 0) BEGIN
      SPRINT ~co_name~ ~%co_name%%char2%~
     END
     PATCH_IF (("char" = 0x00) AND ("i2" = 0x00)) THEN BEGIN
      SET "i2" = 0x20
     END
     ELSE
     PATCH_IF (("char" = 0x00) AND ("i2" > 0x00)) THEN BEGIN
      READ_ASCII ("co" + "i1" + 0x00) ~trigger~ ("i2")
      SPRINT ~cont_var~ ~ab_%area%_%co_name%~
      INNER_ACTION BEGIN
       EXTEND_BOTTOM ~abparty.bs~ ~inlined/thief_hk_trap.baf~
        EVALUATE_BUFFER
      END
      SET "i2" = 0x20
     END
    END
   END
   PATCH_IF ( ("trap_detect" < 0x64)
          AND ("trap_disarm" < 0x64)
          AND (("trapped" & 0x01) = 0x01)
          AND ((%flag% BAND 0b001) = 0b001)) THEN BEGIN //trapped & locked
    FOR ("i2" = 0x00; "i2" < 0x20; "i2" += 0x01) BEGIN
     READ_BYTE ("co" + "i1" + "i2") "char"
     READ_ASCII ("co" + "i1" + "i2") "char2" (1)
     PATCH_IF (~%char%~ = 32) AND (~%char2%~ STRING_COMPARE_REGEXP ~ ~ =0) BEGIN
      SPRINT ~char2~ ~_~
     END
     PATCH_IF (%char% != 0) BEGIN
      SPRINT ~co_name~ ~%co_name%%char2%~
     END
     PATCH_IF (("char" = 0x00) AND ("i2" = 0x00)) THEN BEGIN
      SET "i2" = 0x20
     END
     ELSE
     PATCH_IF (("char" = 0x00) AND ("i2" > 0x00)) THEN BEGIN
      READ_ASCII ("co" + "i1" + 0x00) ~trigger~ ("i2")
      SPRINT ~cont_var~ ~ab_%area%_%co_name%~
      INNER_ACTION BEGIN
       EXTEND_BOTTOM ~abparty.bs~ ~inlined/thief_hk_lock&trap.baf~
        EVALUATE_BUFFER
      END
      SET "i2" = 0x20
     END
    END
   END
   PATCH_IF ( ("trap_detect" >= 0x64)
          AND ("trap_disarm" >= 0x64)
          AND (("trapped" & 0x01) = 0x01)
          AND ((%flag% BAND 0b001) = 0b001)) THEN BEGIN //trapped but can't remove & locked
    FOR ("i2" = 0x00; "i2" < 0x20; "i2" += 0x01) BEGIN
     READ_BYTE ("co" + "i1" + "i2") "char"
     READ_ASCII ("co" + "i1" + "i2") "char2" (1)
     PATCH_IF (~%char%~ = 32) AND (~%char2%~ STRING_COMPARE_REGEXP ~ ~ =0) BEGIN
      SPRINT ~char2~ ~_~
     END
     PATCH_IF (%char% != 0) BEGIN
      SPRINT ~co_name~ ~%co_name%%char2%~
     END
     PATCH_IF (("char" = 0x00) AND ("i2" = 0x00)) THEN BEGIN
      SET "i2" = 0x20
     END
     ELSE
     PATCH_IF (("char" = 0x00) AND ("i2" > 0x00)) THEN BEGIN
      READ_ASCII ("co" + "i1" + 0x00) ~trigger~ ("i2")
      SPRINT ~cont_var~ ~ab_%area%_%co_name%~
      INNER_ACTION BEGIN
       EXTEND_BOTTOM ~abparty.bs~ ~inlined/thief_hk_lock_cant_disarm.baf~
        EVALUATE_BUFFER
      END
      SET "i2" = 0x20
     END
    END
   END
   PATCH_IF (!(("trapped" & 0x01) = 0x01)
          AND ((%flag% BAND 0b001) = 0b001)) THEN BEGIN //locked only
    FOR ("i2" = 0x00; "i2" < 0x20; "i2" += 0x01) BEGIN
     READ_BYTE ("co" + "i1" + "i2") "char"
     READ_ASCII ("co" + "i1" + "i2") "char2" (1)
     PATCH_IF (~%char%~ = 32) AND (~%char2%~ STRING_COMPARE_REGEXP ~ ~ =0) BEGIN
      SPRINT ~char2~ ~_~
     END
     PATCH_IF (%char% != 0) BEGIN
      SPRINT ~co_name~ ~%co_name%%char2%~
     END
     PATCH_IF (("char" = 0x00) AND ("i2" = 0x00)) THEN BEGIN
      SET "i2" = 0x20
     END
     ELSE
     PATCH_IF (("char" = 0x00) AND ("i2" > 0x00)) THEN BEGIN
      READ_ASCII ("co" + "i1" + 0x00) ~trigger~ ("i2")
      SPRINT ~cont_var~ ~ab_%area%_%co_name%~
      INNER_ACTION BEGIN
       EXTEND_BOTTOM ~abparty.bs~ ~inlined/thief_hk_lock.baf~
        EVALUATE_BUFFER
      END
      SET "i2" = 0x20
     END
    END
   END
  END
  FOR ("i1" = 0x00; "i1" < ("dc" * 0xc8); "i1" += 0xc8) BEGIN
   SPRINT ~trigger~ ~~
   SPRINT ~co_name~ ~~
   READ_SHORT ("do" + "i1" + 0x6c) "trap_detect"
   READ_SHORT ("do" + "i1" + 0x6e) "trap_disarm"
   READ_SHORT ("do" + "i1" + 0x70) "trapped"
   READ_LONG ("do" + "i1" + 0x28) "flag"
   PATCH_IF ( ("trap_detect" < 0x64)
          AND ("trap_disarm" < 0x64)
          AND ((%flag% BAND 0b1000) = 0b1000)
          AND (("trapped" & 0x01) = 0x01)) THEN BEGIN
    FOR ("i2" = 0x00; "i2" < 0x20; "i2" += 0x01) BEGIN
     READ_BYTE ("do" + "i1" + "i2") "char"
     READ_ASCII ("do" + "i1" + "i2") "char2" (1)
     PATCH_IF (~%char%~ = 32) AND (~%char2%~ STRING_COMPARE_REGEXP ~ ~ =0) BEGIN
      SPRINT ~char2~ ~_~
     END
     PATCH_IF (%char% != 0) BEGIN
      SPRINT ~co_name~ ~%co_name%%char2%~
     END
     PATCH_IF (("char" = 0x00) AND ("i2" = 0x00)) THEN BEGIN
      SET "i2" = 0x20
     END
     ELSE
     PATCH_IF (("char" = 0x00) AND ("i2" > 0x00)) THEN BEGIN
      READ_ASCII ("do" + "i1" + 0x00) ~trigger~ ("i2")
      SPRINT ~cont_var~ ~ab_%area%_%co_name%~
      INNER_ACTION BEGIN
       EXTEND_BOTTOM ~abparty.bs~ ~inlined/thief_hk_trap.baf~
        EVALUATE_BUFFER
      END
      SET "i2" = 0x20
     END
    END
   END
  END
 END
BUT_ONLY_IF_IT_CHANGES
COPY ~override/abparty.bs~ ~scripts/abparty.bs~


One thing to note, I have learned that even non-thieves (or those you don't want to have thief actions) will return true with a check stat of GT 1 and that is due to the race modifier and in some cases dexterity modifier. Since you won't be limiting thief actions by class, you'll need to include race checks and stat checks greater than that amount. here's an example for finding traps:
//-------------------------------------------------------------
//Thief Actions
//will look for traps when not in combat mode
IF
  ActionListEmpty()
  !See([ENEMY])
  Global("ab_fight","GLOBAL",0)
  !Race(Myself,DWARF)
  !Race(Myself,GNOME)
  !Race(Myself,HALFLING)
  CheckStatGT(Myself,5,TRAPS)
  !GlobalTimerNotExpired("ab_trap_look","LOCALS")  //one turn timer expired
THEN
  RESPONSE #100
    SetGlobalTimer("ab_trap_look","LOCALS",ONE_TURN)  //one turn timer - don't restart if another action takes precedence
//    FloatMessage(Myself,@41)
    DisplayString(Myself,@41)
    FindTraps()
END
IF
  ActionListEmpty()
  !See([ENEMY])
  Global("ab_fight","GLOBAL",0)
  Race(Myself,HALFLING)
  CheckStatGT(Myself,10,TRAPS)
  !GlobalTimerNotExpired("ab_trap_look","LOCALS")  //one turn timer expired
THEN
  RESPONSE #100
    SetGlobalTimer("ab_trap_look","LOCALS",ONE_TURN)  //one turn timer - don't restart if another action takes precedence
//    FloatMessage(Myself,@41)
    DisplayString(Myself,@41)
    FindTraps()
END
IF
  ActionListEmpty()
  !See([ENEMY])
  Global("ab_fight","GLOBAL",0)
  Race(Myself,GNOME)
  CheckStatGT(Myself,15,TRAPS)
  !GlobalTimerNotExpired("ab_trap_look","LOCALS")  //one turn timer expired
THEN
  RESPONSE #100
    SetGlobalTimer("ab_trap_look","LOCALS",ONE_TURN)  //one turn timer - don't restart if another action takes precedence
//    FloatMessage(Myself,@41)
    DisplayString(Myself,@41)
    FindTraps()
END
IF
  ActionListEmpty()
  !See([ENEMY])
  Global("ab_fight","GLOBAL",0)
  Race(Myself,DWARF)
  CheckStatGT(Myself,20,TRAPS)
  !GlobalTimerNotExpired("ab_trap_look","LOCALS")  //one turn timer expired
THEN
  RESPONSE #100
    SetGlobalTimer("ab_trap_look","LOCALS",ONE_TURN)  //one turn timer - don't restart if another action takes precedence
//    FloatMessage(Myself,@41)
    DisplayString(Myself,@41)
    FindTraps()
END
this is from my bg1 script that I've been reverting from IWD version

Edited by Sasha Al'Therin, 30 October 2011 - 04:53 PM.

My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm


#23 i30817

i30817
  • Member
  • 611 posts

Posted 30 October 2011 - 05:30 PM

I wouldn't swap out the script in the override directory slot. extending to the bottom of to handle the hotkey block is fine, but changing the override script itself is asking for trouble with other mods.

Ok then. There's a alternative i saw in Solaufein that should work (should have thought of it first)...

Extend the end of the override script of each joinable...
Spoiler


Should work if installed after all mods that can change that file.


BTW;

don't do that... True() always returns true and without anything to check against this block will be a script stopper and not allow any blocks following to be parsed ever...


Does this also apply for the other character script files?
So if i put a "always happens" block on the OVERRIDE script, the GENERAL never runs at all? Because if so, my early bailout idea still doesn't work dammit.

Actually, i was also assuming that this didn't happen with the first version - since the script file was temporarily different and private, there would be no reason for it to be edited by another mod, so unconditionally triggering that was to return things to normal.

Thanks for the dexterity info! Do i really need to be racist towards halflings, gnomes and dwarfs?

Surely a check of ... say 7-10 pts would be more than enough. And if they have more? By mask, let them try it.

Edited by i30817, 05 November 2011 - 05:44 PM.


#24 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 30 October 2011 - 07:32 PM

the first block that returns true is ran and the script sequence is restarted and examined till a block returns true.

so your 'bailout' will prevent any later blocks (and lower level scripts as i understand it) from being performed. if it is only your stuff after and it is intentional so be it BUT any stuff that is added after by another mod will not be parsed ever


did i stress that too much? :P

try this idea...
-------------------------
hotkey turns it on, changes general script to a master area check script (which will change general to specific area thief script)

thief actions perform whenever possible.
block in specific area thief script to change ai back to master area check script if current area does not equal script's area

press hotkey again turns it off, and changes general script to null value

thief actions unavailable.
---------------------------

only requirement - ai button should be on when wanting to do thief actions (this isn't a bad thing to require)


//then the locks
IF

        AreaCheck("%area%")
        //err, actually IsLocked.
        //Dunno what can replace it. Maybe it can be omitted?
        !Disarmed("%lock%")

try: Unlocked(O:Object*) not sure what all it returns, if anything

My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm


#25 i30817

i30817
  • Member
  • 611 posts

Posted 31 October 2011 - 03:02 AM

Know of a way to find out which OVERRIDE script the npc's are using?

EDIT: hmmm, creature offset 0x0248 is it.
Now a simple Weidu question, appending to a resref?

I don't suppose there is a simple way way to discover who is joinable?


Something like the the Worldmap map_mods_areas.tbl but for joinable npcs, so that mods that need to change their dialogs or scripts could just iterate over a array?

Edited by i30817, 31 October 2011 - 05:46 AM.


#26 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 31 October 2011 - 08:10 AM

pdialog.2da has the data you are looking for. even mod added joinable npcs get added to the file... also lists a number of their ToB scripts to be switched to if they make it into ToB...

several ways to add to a file... depends on what you want to do

may I suggest reading up on the weidu readme html file that is included with the weidu download package

My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm


#27 i30817

i30817
  • Member
  • 611 posts

Posted 31 October 2011 - 08:38 AM

Mmm, yes, but it hasn't their CRE files. I'm worried, of course, that if i just change the OVERRIDE script in the join dialog, i might override one that already is running.

So i'd like to append to those if they exist too. For that i need to iterate over their CRE (joinable only), read the offset, transform that into a file somehow, if not empty append to it, if empty set it.

Is there a better way?

EDIT: wait, the bg2 version is different...

I'd want the column 25OVERRIDE_SCRIPT_FILE?

And what is 25DREAM_SCRIPT_FILE anyway?

Edited by i30817, 31 October 2011 - 08:44 AM.


#28 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 31 October 2011 - 01:45 PM

You'll have to ask someone else what the dream script does... I've not messed with ToB content at all so I don't want to steer you wrong

My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm


#29 i30817

i30817
  • Member
  • 611 posts

Posted 31 October 2011 - 02:17 PM

Gosh, i'm a terrible coder.

Anyway this is my prototype (haven't compiled yet, and haven't generated the trap disarming and lockpick code yet).
How can i do the same (change the OVERRIDE script) for the protagonist?
He's not in that table. Has he one anyway?
Spoiler

Edited by i30817, 05 November 2011 - 05:45 PM.


#30 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 31 October 2011 - 02:45 PM

protagonist does have an override script slot. don't think an actual script is applied, you'll have to check a save game to see if one does get applied

My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm


#31 i30817

i30817
  • Member
  • 611 posts

Posted 31 October 2011 - 03:10 PM

What's the right place to set the ChangeAIScript

For the protagonist without slowing down anything else?

Edited by i30817, 31 October 2011 - 03:12 PM.


#32 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 31 October 2011 - 06:48 PM

to be really honest, I'd stick with the empty script slots of race & general. leaving class open for any player chosen party ai scripts. It isn't that big of an issue to require that the party ai button be on. and i've not tested it, it might be that only class level scripts are turned on and off with that button...

honestly the activities that you are wanting the scripts to do are best being kept outside of the normal standard scripts whenever possible. cause using the override script means that your mod has to install dead last or at least after every npc mod added to the game. I can see lots of conflict potential when someone decides they want to try out another NPC without changing the rest of their install...

You will have to tie into existing scripts in order to kick start the process, but that can be minimally done.


rather than having each character process the script changing, since your stuff will be valid for any character because of the stat changes you will be giving them, allow the protagonist to do it for all of them.

1) use baldur.bcs for soa and baldur25.bcs for tob to change only the protagonist's override script to an area check script
2) the area check script will action override all player characters to change race script to the relevant map related script
3) the area check script can also action override all player characters to change general scripts to a basic thief skills script (not area dependent)

globals will need to be set so that blocks aren't constantly repeated unnecessarily


but it is your mod so...

My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm


#33 i30817

i30817
  • Member
  • 611 posts

Posted 01 November 2011 - 02:24 AM

Area check script are run every time you enter a area? How can i know which npc join to know which creature i need to change? Isn't that the same problem you mentioned?

But maybe i can use a item to change the script - i'll need one anyway to simulate the thief level progression...

Edit: bingo
#82 (0x052) Set AI Script [82]

Edited by i30817, 01 November 2011 - 02:30 AM.


#34 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 01 November 2011 - 05:42 AM

if you aren't messing with pre-existing scripts assigned to joinable npcs you can use any other script to assign a script to the party member's unused script slot


ok let me show you what I said in the last post

extend to the bottom of baldur.bcs & baldur25.bcs
IF
HotKey(F)
Global("ab_thiefactions","GLOBAL",0)
THEN
RESPONSE #100
ActionOverride(Protagonist,ChangeAIScript("abARchk",Override))
SetGlobal("ab_thiefactions","GLOBAL",1)
END
IF
HotKey(F)
Global("ab_thiefactions","GLOBAL",1)
THEN
RESPONSE #100
ActionOverride(Protagonist,ChangeAIScript("",Override))
ActionOverride(Player1,ChangeAIScript("",Race))
ActionOverride(Player2,ChangeAIScript("",Race))
ActionOverride(Player3,ChangeAIScript("",Race))
ActionOverride(Player4,ChangeAIScript("",Race))
ActionOverride(Player5,ChangeAIScript("",Race))
ActionOverride(Player6,ChangeAIScript("",Race))
ActionOverride(Player1,ChangeAIScript("",General))
ActionOverride(Player2,ChangeAIScript("",General))
ActionOverride(Player3,ChangeAIScript("",General))
ActionOverride(Player4,ChangeAIScript("",General))
ActionOverride(Player5,ChangeAIScript("",General))
ActionOverride(Player6,ChangeAIScript("",General))
SetGlobal("ab_thiefactions","GLOBAL",0)
END


then script abarchk.bcs
IF
AreaCheck("arXXXX")
Global("ab_setabTXXXX","GLOBALS",0)
THEN
RESPONSE #100
ActionOverride(Player1,ChangeAIScript("abTXXXX",Race))
ActionOverride(Player2,ChangeAIScript("abTXXXX",Race))
ActionOverride(Player3,ChangeAIScript("abTXXXX",Race))
ActionOverride(Player4,ChangeAIScript("abTXXXX",Race))
ActionOverride(Player5,ChangeAIScript("abTXXXX",Race))
ActionOverride(Player6,ChangeAIScript("abTXXXX",Race))
ActionOverride(Player1,ChangeAIScript("abTbase",General))
ActionOverride(Player2,ChangeAIScript("abTbase",General))
ActionOverride(Player3,ChangeAIScript("abTbase",General))
ActionOverride(Player4,ChangeAIScript("abTbase",General))
ActionOverride(Player5,ChangeAIScript("abTbase",General))
ActionOverride(Player6,ChangeAIScript("abTbase",General))
SetGlobal("ab_setabTXXXX","GLOBALS",1)
END
IF
!AreaCheck("arXXXX")
Global("ab_setabTXXXX","GLOBALS",1)
THEN
RESPONSE #100
SetGlobal("ab_setabTXXXX","GLOBALS",0) //so we can try area specific actions on another visit to the area
END
//repeated for each map  XXXX denotes the unique map number


then abTXXXX.bcs script would have the break down of any area specific thieving actions


#82 (0x052) Set AI Script [82] I'm not sure if that actually works... you could try it if you wish

My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm


#35 i30817

i30817
  • Member
  • 611 posts

Posted 01 November 2011 - 06:09 PM

I'm planning to use the dialog of the item i'm creating to attach and deattach (if you want to) the script.

Seems like the best way not to slow things down, and it also resolves the race issue. Only npcs that want it should get the script.

Now making a dynamic dialog to redistribute changing thieves skills free points...

It might be beyond me ... >_>

The planned text, note that i've combined the descriptions of learning hideinshadows&move silently, picklocks&disarmtraps and detecttraps&detectillusions skills.
I just don't know how to describe those as a book when not combined, probably a lack of imagination.

Think it's a bad idea to combine those and spend points on both if the option is selected? Should i lose the attempt at immersion and just go in your face *learn lockpicking*?
Spoiler


State machine would be:
@20 first time read
@21 second+ time read

REPLIES:
@22) show the points your char has on the skills (how?)
@23) If you have the EXP, drain experience, set the thief non modal actions script on the RACE slot, possibly add the backstab bonus, goto allocating points state @26
If you don't, goto 25, end
@24) remove the thief non modal actions script, end dialog.

@26) trap until you allocate all level up points (how?) end dialog when all are allocated.

Edited by i30817, 05 November 2011 - 05:46 PM.


#36 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 01 November 2011 - 09:57 PM

Think it's a bad idea to combine those and spend points on both if the option is selected? Should i lose the attempt at immersion and just go in your face *learn lockpicking*?

reminds me too much of PST "updated my journal" that is so annoying
I certainly don't have a problem with hide in shadows being combined with move silently as those two were split from BG1's singular stealth....

My thought would be that you could just split the points equally...

Or gasp.. create some quests/activities that when actually performed increment a global and after so many successful times a point is awarded. i.e. learn thru use for thieving skills. In BG2 always wanted to instead of gaining party xp, gain towards skill when doing lock picking etc...

have you checked into Rogue Rebalancing? I know there is a lot of thief related stuff worked on in there. perhaps ideas you could garner....

My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm


#37 i30817

i30817
  • Member
  • 611 posts

Posted 02 November 2011 - 03:53 AM

That quest idea would be very nice, although i'm still at the stage where i don't know how to make a dynamic dialog :whistling:

Problems:

If I try to put in the quest idea, i think i'd need rather a lot of them, even if they gave relatively large bonus.

Which party member would get the skills?

Use by doing systems are the embodiment of grinding (i like QFG like any other OCD, but i admit it).

If i give skills to every member of the party, how would i deal with new members? (This has a obvious solution, "teach" new members).

Where, BG1 or BG2? I'm using BGT.


More mechanical problems i'm having with the dialog now...

How can i check the skills of the npc's the book (or the pc if i go the quests idea) is talking to?

<_< there doesn't appear to be a way to read the current thief skills values (much less increase them).

(important not to overflow due to race bonus, dex bonus -that can changege- etc)

Edited by i30817, 02 November 2011 - 04:01 AM.


#38 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 02 November 2011 - 10:46 AM

going dialog route whether it be via an item or a creature...

the states in your dialog file can check for the stat value. If you are wanting a range, it would be using
CheckStatGT(LastTalkedToBy,X,STAT)
CheckStatLT(LastTalkedToBy,Y,STAT)

You can create multiple states in your dialog file to cover all the ranges in which you want to deal with

else create one state for each point up to the max you wish to deal with...

My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm


#39 i30817

i30817
  • Member
  • 611 posts

Posted 02 November 2011 - 11:35 AM

The problem is the increase of the stats.

Doing 255 states for 8 stats, just to be able to do +5 is not a good option.

What i'd need is a way to subtract inside the engine, (not on a weidu transformation)

So i'd have 20 pt to destribute, and have a

IF ~GT(Global("thief_stats", LOCALS), 5) AND CheckStatLT(LastTalkedToBy,250, LOCKPICKING)~
THEN DO ~ SetGlobal("thief_stats", SUBTRACT(Global("thief_stats", LOCALS), 5))
ADDSTAT(LastTalkedTo, LOCKPICKING, 5) ~
END

Pseudocode.

Problem is, there doesn't appear to neither a ADDSTAT (crucial, but maybe it can be done with effects) nor a SUBTRACT (in fact there don't seem to be any arithmetic functions that return integers, not booleans).

EDIT AHAH:

found AddGlobals(S:Name*,S:Name2*)


Instead of a single item, or learn by use, i like the idea of trainers (ala, PST), but it's not as convenient...

Edited by i30817, 02 November 2011 - 12:45 PM.


#40 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 02 November 2011 - 03:05 PM

you are now embarking into realms beyond me :P

the adding and subtracting of stuff within game is not something i've dealt with before. the thief actions & script switching, yes. but not what you are getting into now.

I see no problem in having 51 states that look for a 5 point range of a given value up to 255. i.e. GT 0 & LT 6; GT 5 & LT 11

but aren't thief skills a percentage and thus max at 100? don't they reset to 0 and have no effect if they go beyond 100? thought I read about something like that at one point....

My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm