Skip to content

Adjusting reputation?

GreenerGreener Member Posts: 430
Is there a way to adjust reputation other than restricting alignments during character creation?

IE...

-4 starting reputation

Comments

  • ErgErg Member Posts: 1,756
    @Greener, try this custom script made by @Cuv.
  • GreenerGreener Member Posts: 430
    Thank you for the suggestion, I now need to figure out how to use implement this into a AP_SPCL file...
  • ErgErg Member Posts: 1,756
    edited June 2014
    Greener said:

    Thank you for the suggestion, I now need to figure out how to use implement this into a AP_SPCL file...

    Ah, you are creating a kit.

    Take a look at the Slayer Change for an example of an innate ability decreasing reputation. Basically, they use opcode 265 to set a global variable to a given value that can be checked by a script or a dialogue containing a call to ReputationInc().

    Edit: depending on what you need to do, you can also use opcode 108, although, according to IESDP, opcode 108 does not affect the reputation of the party, but only the targeted creature.
  • GreenerGreener Member Posts: 430
    Hmmm,

    So I continue to struggle with my search for a way to adjust the starting reputation of my custom kit

    I've tried creating an AP_SPCL file using opcode 108 but as @Erg suggested it doesn't affect the reputation of the party

    Furthermore I have been until to get opcode 265 to work could someone assist me?

    I'd like to create a disadvantage of -4 reputation for a kit I'm building
  • ErgErg Member Posts: 1,756
    edited July 2014
    @Greener, how are you implementing exactly opcode 265 and where are you checking for the variable?

    You can use opcode 265 in your AP_SPCL to set a variable to 1, let's say pf_rep, where pf, here and in the rest of my post, should be replaced by your registered prefix.

    Now the real problem is where to check that variable. One possibility is to use baldur.bcs. Even though messing with this file is not recommended and should be avoided as much as possible, it can still be done, if enough precautions are taken, as a last resort option. However, it's not ideal and I would be interested myself in a better alternative, so I hope a more experienced modder can provide a better solution. Until then, you can maybe try something like adding the following code to baldur.bcs

    IF Global("pf_rep","GLOBAL",1) Global("pf_doonce","GLOBAL",0) THEN RESPONSE #100 SetGlobal("pf_doonce","GLOBAL",1) ReputationInc(-4) END
    Notice the use of the variable pf_doonce. This is very important to ensure that your portion of the script only triggers once. Failing to do that, could really break the game.
    Post edited by Erg on
  • GreenerGreener Member Posts: 430
    @Erg, I had created an AP_SPCL

    Type: Set global variable (265)
    Target: Self (1)
    Power: 0
    Value: 1
    Modifier type: Set (0)
    Timing mode: Instant/Permanent (9)
    Dispel/Resistance: Not dispel/bypass resistance (2)
    Duration: 0
    Probability 1: 100
    Probability 2: 0
    String: REPCHECK
    # dice size/minimum level: 0
    Save type: ( No save )
    Save bonus: 0
    Unused: 0

    REPCHECK = baf/bcs file

    IF
    Global("pf_rep","GLOBAL",1)
    Global("pf_doonce","GLOBAL",0)
    THEN
    RESPONSE #100
    SetGlobal("pf_doonce","GLOBAL",1)
    ReputationInc(-4)
    END

    Unfortunately nothing happens...
  • ErgErg Member Posts: 1,756
    edited July 2014
    @Greener,

    OK, the variable in your case it's called REPCHECK instead of pf_rep, like in my example. So you could add

    IF Global("REPCHECK","GLOBAL",1) Global("pf_doonce","GLOBAL",0) THEN RESPONSE #100 SetGlobal("pf_doonce","GLOBAL",1) ReputationInc(-4) END
    to the existing script baldur.bcs using either EXTEND_TOP or EXTEND_BOTTOM.

    However, these variable names are just examples and both RE (first two letters of REPCHECK) and PF (first two letters of pf_doonce) are already registered, so to avoid possible clashes with other mods you should register your own prefix instead and change the variable names accordingly, especially if you are planning to publicly release your mod.

    You can check the available prefixes and eventually register your own here.
  • GreenerGreener Member Posts: 430
    Excellent, thank you

    I have attempted to register the prefix OA (Oriental Adventures)

    I understand most of what you are describing except the part about adding it to baldur.bcs?

    Can't I simply create my own .bcs file and link it to there, thus avoiding the risk of corruption?
  • ErgErg Member Posts: 1,756
    edited July 2014
    @Greener, the reason why I'm suggesting to use baldur.bcs, despite all the drawbacks, is because that script is a default one that runs all the time no matter what.

    If you, or someone else, can find an alternative it would be great, but I wonder where are you planning to link your .bcs and how are you planning to ensure that it will fire. I don't mean that it can't be done, just that I can't find an alternative myself.
  • GreenerGreener Member Posts: 430
    @Erg I understand, thank you....
  • argent77argent77 Member Posts: 3,434
    As @Erg suggested, setting a global variable via AP_xxx spell together with a script block in BALDUR.BCS (and BALDUR25.BCS) is probably the easiest option. However, I would avoid that file if possible as it contains hundreds or (in mega-mod installations) thousands of script blocks. Furthermore, your own block might never be executed if the file contains buggy scripts.

    If the reputation loss occurs only once after character generation, you can add your script block to the area scripts of Candlekeep (BG1), Chateau Irenicus (SOA) and the Forest of Tethir (TOB). Alternatively, you could extend the script DPLAYER3.BCS which is assigned to user-created or imported characters (including the protagonist) by default.

    If you want to use your kit for an NPC only, you can also use the reputation-related fields in CRE files (look around offsets 0x7f - 0x81 in NearInfinity).
  • ErgErg Member Posts: 1,756
    edited July 2014
    argent77 said:

    your own block might never be executed if the file contains buggy scripts.

    That's a very good point. Other mods can break baldur.bcs too.
    argent77 said:

    you could extend the script DPLAYER3.BCS which is assigned to user-created or imported characters (including the protagonist) by default.

    Good idea. I didn't consider this script, because it doesn't work if the party AI is disabled, but in this case it should be fine because the penalty is applied soon after character generation and, while I'm not entirely sure, I think it's not possible to start the game with the party AI already disabled.
    argent77 said:

    you can add your script block to the area scripts of Candlekeep (BG1), Chateau Irenicus (SOA) and the Forest of Tethir (TOB).

    This is another good alternative. It would be incompatible with a mod changing the starting area, but I'm not even sure such a mod exists.
Sign In or Register to comment.