Skip to content

Help me with a patch?

CerevantCerevant Member Posts: 2,314
Ok, I'm a complete newb when it comes to modding, but I'm starting to feel my way around. I found the cause of a bug (GNOLL5 challenge in AR5200) and am trying to fix it, but the game isn't behaving as I would expect. Either I'm missing some detail, the Near Infinity doesn't work properly with BGEE, or some other mystery... Anyone able to prod me in the right direction?

So, the bug is that in the DLG it uses the Global GnollFightOver=1 when it wants to fight, but the BCS uses it to mean that the challenge is in progress. I decided to leave it as defined in the DLG, so that I wouldn't have to change GNOLL5A (companions). Here's what I've done so far:

GnollFIghtOver is undefined at the start of the encounter. I have the DLG set it to 0 when there is a challenge (new), 1 when there is a fight and 2 to indicate the challenge is over (last two were already there). I also changed the triggers for the end of the challenge to check for 0 instead of 1.

The source for the BCS is now:

IF
See([PC])
AttackedBy([GOODCUTOFF],DEFAULT)
Allegiance(Myself,NEUTRAL)
THEN
RESPONSE #100
SmallWait(5)
Enemy()
END

IF
See([PC])
NumTimesTalkedTo(0)
THEN
RESPONSE #100
Dialogue([PC])
END

IF
HPLT(Myself,20)
Global("GnollFightOver","GLOBAL",0)
THEN
RESPONSE #100
Dialogue([PC])
SetGlobal("GnollFightOver","GLOBAL",2)
EscapeArea()
END

IF
HPLT(StrongestOf,5)
Global("GnollFightOver","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("GnollFightOver","GLOBAL",1)
Dialogue([PC])
END


I think the first block covers the case where you initiate a fight outside the challenge. The second block initiates the first dialog. The third block is where it is failing:
I start the challenge
I start attacking
If I start a conversation with Ludrug, he has nothing to say
I confirm with CLUAConsole that GnollFightOver is 0
I continue to attack him until I do more than 10 damage (he has 30HP to begin with)
I move away and stop attacking
Ludrug follows and keeps attacking
I start a dialog with him, and he says I won, but does not award the XP, or set GnollFightOver to 2 (actions associated with that dialog option)
Ludrug keeps attacking

Thoughts? How can I execute a dialog option and have the actions not fire (there is no trigger for the action)?

Comments

  • LaughingManLaughingMan Member Posts: 65
    The BCS stuff is quirky and easy to make misbehave. Personally I avoid touching them as much as possible, so I can only offer a few guesses. Something about the way scripts are handled can lead to subsequent blocks in a script never getting tested or firing properly.

    Could the first or second block be testing true in some way as to prevent the third block from being tested or applied correctly? I'm not solid on how the allegiance line works, might it not actually be testing differently even after enemy()?
  • CerevantCerevant Member Posts: 2,314
    I finally figured it out:

    The DLG was starting the challenge combat with Attack() - two problems with that. First, Attack() stops evaluating the script until the target is dead. The other problem is that calling AttackReevaluate() from a DLG doesn't do anything.

    I got it to work by setting the state variables in the script, and putting the attack code in the BCS. Voila!

    One more thing I want to figure out - If you get lucky, you can do more than 20 points of damage and kill him before his script can respond. Anyone have an example of a death-override script? (target is reduced to 0 hit points, but is still alive)
  • LaughingManLaughingMan Member Posts: 65
    I thought there was a setting or variable that prevented death, but I can't find it so I may be wrong.

    You could work around the issue with a combination of opcodes 0x127 and 0x020.

    0x127 Disables most forms of permanent death (such as chunking), though they will still die at 0 hp.
    0x020 Is just "Cure Death" and raises the target, but should do it without animation.

    That should result in him falling dead then appearing to just stand back up, implying that he was badly hurt and knocked down but not actually killed.
  • CerevantCerevant Member Posts: 2,314
    How do you invoke an opcode/effect in a script without casting a spell? The spell effect looks a little hokey...
  • CerevantCerevant Member Posts: 2,314
    Here's a patch - unzip the files and put them in your override folder:
    https://docs.google.com/open?id=0BwOwEmwBQcTWQUVBYUQ1LXFVUEE
  • LaughingManLaughingMan Member Posts: 65
    Create a custom "spell" that uses the opcodes and has no animations. Fire that spell. There are probably other ways, but I don't get into scripting much.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited December 2012
    I fixed this with AttackOneRound. What you look for is ApplySpell.
  • DurlachionDurlachion Member Posts: 82
    edited December 2012
    I think there is also an item "minhp1". I saw that it is equipped to Neera for her first encounter...
    GiveItemCreate("minhp1","NEERA",0,0,0)
    ActionOverride("NEERA",FillSlot(SLOT_AMULET))

    [...]

    DestroyItem("minhp1")
    I would assume that it does, what you are looking for - but not sure.

    Obligatory Edit:
    minhp1 also adds protection from Confusion, Poison, Stun, Sleep, Held, Imprisonment and so on... so maybe this is not the way to go...
  • CerevantCerevant Member Posts: 2,314
    All good stuff! Thanks!
Sign In or Register to comment.