Skip to content

Granting special abilities through .bcs

smyth25smyth25 Member Posts: 219
Hey, I'm trying to write a script for a custom NPC that will add an innate ability when particular quests are completed, but can't make it work. There are no reported errors when I compile the .bcs file, so I must be formatting the file correctly, perhaps though I am using the wrong .ids triggers/actions or something similar. I have attached an example for when the party saves Nalia's keep, I can post any other necessary files.

Comments

  • GwendolyneGwendolyne Member Posts: 461
    edited July 2018
    Try this:

    AddSpecialAbility("GWPist1")

    Replace GWPist1 with your spell file.
  • smyth25smyth25 Member Posts: 219
    Unfortunately it didn't work, I think it may be an error in the triggers because no matter what kind of action I write in, nothing works, perhaps basing it around the NaliaKeepPlot variable is inappropriate, I'm not sure.
  • BubbBubb Member Posts: 1,001
    Quick stab at this, I don't know if I'm remotely correct: is "CWMYLES" the script name of your NPC? If it isn't, the InParty() trigger might not be firing. The CRE file might be named that, but in scripts you use the script name (defined at offset 0x280 in the CRE) to reference the creature.
  • smyth25smyth25 Member Posts: 219
    @Bubb I checked and it is correct, I think it would have been flagged as an error anyway had it been wrong. I feel like the problem stems from the use of the global variable, like maybe it would be more appropriate if the ability was gained upon Tor'Gals death?
  • BubbBubb Member Posts: 1,001
    edited July 2018
    @smyth25: You could base it on Tor'Gal's death, though from looking at the global you are using it should be working as you intend. Have you tested whether or not the global variable is in the state you expect it to be in with this console command?
    C:GetGlobal("NaliaKeepPlot","GLOBAL")Sorry if I am asking obvious questions, I am just trying to narrow down the error.

    If that returns 1 like you expect it to, you could try adding DisplayStringHead(Myself,1) to the script block to see if it is running. That scripting action should display "No, I'm sorry, none of them sound familiar." above the NPC's head and in the combat log.

    Other than simple errors such as the CRE not being assigned the script to begin with, or the "Dott" local already being set, I am unsure what could be preventing the spell from being granted.

    Gwendolyne is correct that the AddSpecialAbility() scripting action should be used to grant the ability, so make sure you are using that.

    Edit: I just thought of something - If a higher-priority script is calling NoAction() your check could be being skipped.
  • smyth25smyth25 Member Posts: 219
    @Bubb Ok I checked NaliaKeepPlot and it was in the state I expected, yet I couldn't trigger the string, and ultimately the script block. However if it is a higher-priority script that is nullifying it, how would I fix this?
  • BubbBubb Member Posts: 1,001
    edited July 2018
    @smyth25: If it is a higher-level script block you would have to make sure execution continues. If there is a higher-priority script block that is being spammed (which is ultimately what would be blocking your lower-level script), you would need to make sure it doesn't trigger 100% of the time, or put a Continue() at the bottom (and make sure it's not calling NoAction()). Could you upload all script-levels of your NPC here so I could take a look at them?
  • smyth25smyth25 Member Posts: 219
    edited July 2018
    @Bubb I haven't actually progressed very far with the project so far so these are the only 'script' files I have made so far:
  • BubbBubb Member Posts: 1,001
    @smyth25: Hmm, well it doesn't look like CWMYLES.CRE has any scripts assigned; is this the file you are currently working with? That would explain why you can't get the script block to fire. One of these fields needs to be set to CWMYLES.BCS; they are all set to "None" currently:

    Override script (offset 0x248) => None
    Class script (offset 0x250) => None
    Race script (offset 0x258) => None
    General script (offset 0x260) => None
    Default script (offset 0x268) => None
  • smyth25smyth25 Member Posts: 219
    edited July 2018
    @Bubb Yep that was it that was actually the one.
    God I'm such an idiot, Thanks for all your help mate. Take 300 gold pieces.
Sign In or Register to comment.