Skip to content

[(BG1) BUG] Stealing from shopkeepers (0824)

KeithSKeithS Member Posts: 623
edited September 2012 in Fixed
Current Behaviour
When stealing from them directly and you get caught the only thing that happens is they turn hostile.

Expected Behaviour
But according to the script they were supposed to call for guards as well. This was prevented by the order the script ran. You need to reverse the order of Wait & Enemy actions

Files altered: innkeep.bcs, merch2.bcs, merch5.bcs, merch6.bcs, shop03.bcs, shop04.bcs, shop05.bcs, shop06.bcs, shop07.bcs, shop08.bcs, shopkn.bcs, maltz.cre, lucky.cre, shop01.cre, innke2.cre, winthr2.cre

Fixed in: v0626+

Originally found and fixed in: BG1Fixpack
http://forum.baldursgate.com/discussion/858
Post edited by Bhryaen on
«13

Comments

  • CadrosCadros Member Posts: 253
    Confirmed fixed
  • BhryaenBhryaen Member Posts: 2,874
    Prefatorily... This is confirmed not fixed. For one example try spawning LUCKY.CRE or going to his shop in BG City (AR0810). He neither goes hostile nor spawns guards on a failed theft. I'm working on a full list though because some do work- like the initial Winthrop (at least in the inn).

  • CadrosCadros Member Posts: 253
    Ah that was the one I went to @Bhryaen your dedication is admirable
  • BalquoBalquo Member, Developer Posts: 2,746
    @Bhryaen Thank you so much! But you don't need to carry on as I know exactly which ones are not working.

    These ones work as they had the script in the first place.
    ~innkeep~ ~merch2~ ~merch5~ ~merch6~ ~shop03~ ~shop04~ ~shop05~ ~shop06~ ~shop07~ ~shop08~ ~shopkn~
    The others never had the script. It needs to be added.
    IgneousAvenger_teambg
  • BhryaenBhryaen Member Posts: 2,874
    edited September 2012
    Spawned merchants:
    Confirmed fixed (failed a steal & merchant goes hostile, guards summoned) for:
    merch2.cre

    Confirmed not fixed (failed a steal but neither summoned guards nor made him go hostile for:
    maltz.cre
    lucky.cre
    shop01.cre
    winthr2.cre

    Encountered merchants:
    Winthrop 1 (AR2616): works
    Lucky (AR0810): no guards, no hostile
    Storekeep (AR1117): works
    Storekeep (AR1112): works
    Storekeep (AR1116): works
    Storekeep (AR1115): works
    Storekeep (AR4803): no guards, but goes hostile
    Merchant (AR4901): works
    Merchant (AR4908): works
    Merchant (AR4909): works
    (trails off due to @Balquo's intervention...)

    OBSERVED:
    The guards don't always spawn nearby- particularly if you test this in the outdoors where they can spawn far away. And when they do, they don't spawn in a reasonable location, as @Balquo has mentioned elsewhere. When stealing from Winthrop1 (innke1.CRE) they spawn almost right next to CHARNAME. Here is an example of a less-than-reasonable location, though Balquo has mentioned them spawning in bathrooms as well...

    [SNIP]

    In this one they spawned in, but I thought they hadn't because it was behind a wall:

    [SNIP]

    EXPECTED:
    Have guards always spawn in at an entrance and/or on the periphery of the failed thief's vision.
    Post edited by Bhryaen on
    IgneousCadros
  • BalquoBalquo Member, Developer Posts: 2,746
    edited June 2012
    @Bhryaen Yes, the guard spawn location is the second phase haha I only mentioned the initial fix in case they never implemented it. Now that they have, I'll get the guard locations posted. They are all done and coordinates are complete. Just need to write it up for the devs.
    Bhryaen
  • BalquoBalquo Member, Developer Posts: 2,746
    edited July 2012
    @KeithS

    Here is all the fixes. The spoiler shows how to fix them but to make it a bit easier for yourself I have attached all the required files so no work for you :) You can double check everything as the only thing I've changed is what is shown in the spoiler.

    [SPOILER]
    innkeep.bcs (replace the existing with this)
    CreateCreature("WATCHN",[554.516],8) // Watcher
    CreateCreature("WATCHN2",[554.516],8) // Watcher
    CreateCreature("WATCHN2",[554.516],8) // Watcher
    merch2.bcs (replace the existing with this)
    CreateCreature("AMNISE",[275.590],10) // Amnish Soldier
    CreateCreature("AMNISE2",[275.590],10) // Amnish Soldier
    CreateCreature("AMNISE2",[275.590],10) // Amnish Soldier
    CreateCreature("AMNISE2",[275.590],10) // Amnish Soldier
    CreateCreature("AMNISE2",[275.590],10) // Amnish Soldier
    merch5.bcs (replace the existing with this)
    CreateCreature("AMNISE",[262.326],8) // Amnish Soldier
    CreateCreature("AMNISE2",[262.326],8) // Amnish Soldier
    CreateCreature("AMNISE2",[262.326],8) // Amnish Soldier
    CreateCreature("AMNISE2",[262.326],8) // Amnish Soldier
    CreateCreature("AMNISE2",[262.326],8) // Amnish Soldier
    merch6.bcs (replace the existing with this)
    CreateCreature("AMNISE",[262.326],8) // Amnish Soldier
    CreateCreature("AMNISE2",[262.326],8) // Amnish Soldier
    CreateCreature("AMNISE2",[262.326],8) // Amnish Soldier
    CreateCreature("AMNISE2",[262.326],8) // Amnish Soldier
    CreateCreature("AMNISE2",[262.326],8) // Amnish Soldier
    shop03.bcs (replace the existing with this)
    CreateCreature("FLAMEN",[558.462],6) // Flaming Fist Enforcer
    CreateCreature("FLAMEN2",[558.462],6) // Flaming Fist Enforcer
    CreateCreature("FLAMEN2",[558.462],6) // Flaming Fist Enforcer
    shop04.bcs (replace the existing with this)
    CreateCreature("FLAMEN",[694.372],6) // Flaming Fist Enforcer
    CreateCreature("FLAMEN2",[694.372],6) // Flaming Fist Enforcer
    CreateCreature("FLAMEN2",[694.372],6) // Flaming Fist Enforcer
    shop06.bcs (replace the existing with this)
    CreateCreature("FLAMEN",[558.462],6) // Flaming Fist Enforcer
    CreateCreature("FLAMEN2",[558.462],6) // Flaming Fist Enforcer
    CreateCreature("FLAMEN2",[558.462],6) // Flaming Fist Enforcer
    shop07.bcs (replace the existing with this)
    CreateCreature("FLAMEN",[558.462],6) // Flaming Fist Enforcer
    CreateCreature("FLAMEN2",[558.462],6) // Flaming Fist Enforcer
    CreateCreature("FLAMEN2",[558.462],6) // Flaming Fist Enforcer
    shop08.bcs (replace the existing with this)
    CreateCreature("FLAMEN",[694.372],6) // Flaming Fist Enforcer
    CreateCreature("FLAMEN2",[694.372],6) // Flaming Fist Enforcer
    CreateCreature("FLAMEN2",[694.372],6) // Flaming Fist Enforcer
    shopkn.bcs (This one was not working. Anyway, use the following)
    Wait(3)
    CreateCreature("FLAMEN",[694.372],6) // Flaming Fist Enforcer
    CreateCreature("FLAMEN2",[694.372],6) // Flaming Fist Enforcer
    CreateCreature("FLAMEN2",[694.372],6) // Flaming Fist Enforcer
    Enemy()
    maltz.cre, maltz.bcs
    You will need to create a new script as we can not use an existing script due to his "unique" area. Use the following: (I named it maltz.bsc in the attached files but you can change that of course)
    IF
    StealFailed([ANYONE])
    THEN
    RESPONSE #100
    Wait(3)
    CreateCreature("FLAMEN",[425.362],6) // Flaming Fist Enforcer
    CreateCreature("FLAMEN2",[400.370],6) // Flaming Fist Enforcer
    CreateCreature("FLAMEN2",[435.340],6) // Flaming Fist Enforcer
    Enemy()
    END
    lucky.cre can use shop07.bcs
    shop01.cre can use shop07.bcs
    winthr2.cre can use innkeep.bcs

    Shop03 was being used twice so I switched one of the trap scripts so the spawn locations would be correct.
    shop03.cre can use shop08.bcs
    [/SPOILER]

    @Bhryaen If you want to give this a test just copy all the files into your override folder ;) Also check the guard facing directions once spawned and tell me what you think.
    Post edited by Balquo on
    IgneousBhryaenKeithS
  • BhryaenBhryaen Member Posts: 2,874
    edited June 2012
    @Balquo
    :-) Will do... when I'm home

    [EDIT] Just musing over the discussion had elsewhere regarding NPCs no longer going hostile when they see hostiles around them but instead fleeing. Doesn't it make more sense for shopkeepers and merchant to behave the same way- call for the guards but run away rather than go hostile. That might also work for pickpocket victims- make them call for the guard and run away instead of go hostile when they can't even fight- at least if they're "innocents." The difference with merchants is that their store DLG would have to be made permanently unavailable afterward.
    Post edited by Bhryaen on
  • BhryaenBhryaen Member Posts: 2,874
    @Balquo
    Just installing those (saving the originals for... whatever), but just to mention initially your new maltz.bcs is spelled matlz.bcs. Everything else looks good... Testing now...
  • BalquoBalquo Member, Developer Posts: 2,746
    @Bhryaen Thanks man, got that fixed and uploaded.
  • BhryaenBhryaen Member Posts: 2,874
    edited July 2012
    @Balquo
    OK, I've tested the .CRE files and they all seem to work except innke2.CRE. He works in his Candlekeep original instance, but not in subsequent CLUA'd instances somehow- neither goes hostile, nor calls guards. Is it possible that the scripts work differently when encountered normally?

    For guard arrivals, it's partially better... :-/ Well, if you meet the shopkeeps in their regular locations anyway: the original Winthrop (and Maltz, Lucky, etc.) now spawns guards at the door rather than right next to CHARNAME:

    image

    But for other instances of merchant CLUA creation where they're not in their normal store location they can end up anywhere- from right next to CHARNAME...

    image

    ... to clear across the area. In this instance I walked to the south part of AR1000 before spawning Maltz but the guards entered in the same location.

    image

    Perhaps that's not important since CLUA makes things odd anyway, but... I decided to try another issue: the shopkeep runs away from battle to the outside. I had that happen once in a no-reload when my attempt to exploit the Great Gazib went horribly wrong and then all the villagers became red circles and ran into the merchant tents- after which the merchants in turn ran outside to get away from the red circles (at least when entering the tents in stealth). So then the guards would need to spawn correctly outside.

    Anyway just tried it with the original Winthrop- CLUA'd in a xvart to scare him outside (and he actually got scared, so @HeroicSpur would be proud), then failed a steal. The guards spawned here:

    image

    This means it's spawning the guards at the same location as CLUAConsoleMoveToArea places the character- perhaps what the game considers the area entrance? I tested it at the Carnival as well to be sure, and sure enough they appeared in the NW corner of the area.

    However, the spawn-in isn't consistently at the entrance, even when the merchant is CLUA'd into a store or interior. When I CLUA'd in Lucky in the empty Ulgoth's Beard shop they actually spawned here:

    image

    Hope these results help!
    IgneousCadros
  • BalquoBalquo Member, Developer Posts: 2,746
    edited July 2012
    @Bhryaen Thanks for the test!

    All the summon guard scripts are attached to the actual shopkeep (.CRE files) with the exception of Winthrop. The script is attached to the actor attribute which is connected to the area file. So it only works if he is in ar1616. This was the way it was originally - I didn't change this. I can of course add it to Winthrop's creature file.

    I wouldn't consider when using CLUA to summon merchants a bug due to that cheating anyway and not part of normal gameplay.

    However as you mentioned if they get scared and run outside and then steal from them... then will have problems. See making innocents turn hostile when attacking others solves all problems. :D
    This was all designed with BG1 in mind so I never anticipated that problem. Many shopkeeps do not have a run script so if they get scared or turn hostile they will not run. We could add this to all shopkeeps and that would solve the problem.

    EDIT: 8 out of the 13 shopkeeps you can steal from do not have a run script. Just FYI really.

    EDIT: Another thing about coordinates @Bhryaen they are all set manually to a specific coordinate so if you steal from a merchant outside of their initial area then the guards will spawn at the same coordinates in the new area.
    Post edited by Balquo on
    IgneousBhryaen
  • TanthalasTanthalas Member Posts: 6,738
    This is probably something that is complicated to do, but maybe merchants shouldn't open their shop when they're not in their shop (but this would break the CLUA cheat I guess).
  • BhryaenBhryaen Member Posts: 2,874
    See making innocents turn hostile when attacking others solves all problems. :D
    No way! :-P Must fix the making of insulted innocents into instant mortal enemies who- naturally due to their nemesis identity- do nothing but run in and out of doors to avoid you. hehe
    Many shopkeeps do not have a run script so if they get scared or turn hostile they will not run. We could add this to all shopkeeps and that would solve the problem.
    I could go for that. There would still have to be a store-killer script (or variable) that turns off any merchant that catches the thief, but it's not necessary that they run from a the thief anyway. I could even imagine a storekeep getting irate with the thief, but not going hostile and just begging to be a Rep drop.
    Another thing about coordinates @Bhryaen they are all set manually to a specific coordinate so if you steal from a merchant outside of their initial area then the guards will spawn at the same coordinates in the new area.
    Hmph. Well, then also so much for the idea of having guards spawn in if you open a guard-trapped locked chest outdoors! Go ahead and unlock the Carnival box since if anyone calls the Amnish police, they'll be way north with the ogres and kobolds.
  • BalquoBalquo Member, Developer Posts: 2,746
    @KeithS In summary everything works as it should. The file above in a previous post has the fixes required.

    The only problem is if some of the merchants run outside due to you attacking a nearby NPC. My suggestion for that was to remove the run scripts from merchants who have them. The majority of them do not. But maybe you have another option.
  • BalquoBalquo Member, Developer Posts: 2,746
    No change on this since last time.
  • NathanNathan Member Posts: 1,007
    Changes verified internally - stealing from merchants using the merchant gui stealing menu results in expected behaviour (hostility, guards summoned). This should be in the next build.
  • BhryaenBhryaen Member Posts: 2,874
    edited July 2012
    This bugfix was first introduced by kangaxxx in this Bugs forum thread:
    http://forum.baldursgate.com/discussion/1068/merchants-dont-turn-hostile-after-a-thiefs-stealing-ability-fails

    Essentially it is this:

    OBSERVED:
    If you steal from a merchant and fail, the game immediately ejects you from the store back to the main game screen. If you then immediately click back on the merchant to re-enter their store, the merchant completely forgets that he was about to go hostile or call the guards or what-have-you and business resumes as usual. In this way you have an infinite exploit to keep attempting a steal until you succeed. Or it's just a way to prevent consequences, but in either case it renders the Steal function useless and otherwise should be renamed the "Thieves Freebies" function.

    EXPECTED:
    Once a steal failure occurs, the first result should be the prevention of further dialog. I'm against making otherwise "innocent" NPCs go hostile for disgruntlement about theft given that they're not capable of combat (will hopefully be addressed later with more focus in its own thread), but for sure the merchant's regular dialog or at least store dialog needs to be eliminated instantly- even before the store ejection. Best would be inclusion of a single reply of "You tried making off with my merchandise and expect me to deal with you further? You're out of your xvart-blasted mind!"... or some such.
    Post edited by SethDavis on
  • SethDavisSethDavis Member Posts: 1,812
    edited July 2012
    checking this one now

    [EDIT] Potentially fixed - When caught stealing you will thereafter be disallowed from purchasing anything at a store. The store keeper will refuse to speak with you until cause the sprite to be recreated (by traveling away and back). If the store is an inn you will still be able to rent rooms. You can no longer cancel the guards. Clicking the keeper will distract him momentarily, but he will still call the guards. The time guards arrive in has been reduced.
    Post edited by SethDavis on
  • BalquoBalquo Member, Developer Posts: 2,746
    @SethDavis Nice. So I assume that the shopkeepers will no longer run away neither?
  • SethDavisSethDavis Member Posts: 1,812
    @Balquo - They will run as soon as the guards show up. I can kill that if you like.
  • BhryaenBhryaen Member Posts: 2,874
    @SethDavis
    The issue with running was that they'd run outside, though actually if the store is dead at that point, the concern about them running is also gone. The concern was that if they run outside (where there is no workable guard-spawn location) you can steal from them and trigger guards which end up way up in the NW corner of the area as if having CLUA'ed in their arrival. But if guards are guaranteed anyway and the merchant is no longer going to have a store for the thief to exploit, the issue will pretty much be resolved and the merchant can run outside as they wish with nothing further to exploit.
    SethDavis
  • BhryaenBhryaen Member Posts: 2,874
    @SethDavis
    Mind you, if the merchant retains a run script regarding running from hostiles, the issue will still be viable, but really I can see them not running (nor becoming hostile) in either case, but simply no longer providing a store.
  • SethDavisSethDavis Member Posts: 1,812
    @Bhryaen - Ok, I'll see if I can change that.
  • BhryaenBhryaen Member Posts: 2,874
    @SethDavis
    Best would be to add a line of "You think I'm sellin' to YOU, ya thievin' scoundrel? Not a chance!", but, well, extra dialog and all...
    SethDavis
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Confirmed partially (4/5).
    Steal scripts have been added for:
    lucky - shoplu
    maltz - maltz
    winthr2 - innkeep
    shopkn (ar4803) - shopkn

    No script for:
    shop01 (AR0304) - tested this in game too, not even red circle. But stealing is disabled for a second time :)
    I didn't know that feature.
  • BhryaenBhryaen Member Posts: 2,874
    edited August 2012
    @SethDavis
    Well, there was another stealing fix that went in simultaneously... seems to have partially overridden the stealing exploit fix... [EDIT: Just merged them- got tired of flitting between them.]

    I liked yours better: no going hostile, no running away, but the store closes and guards are called.

    That one has it so the merchant does go hostile and does run away (and likely outside). Guards are also called, but then the store closing aspect becomes irrelevant...

    Hm, but it does appear something of what you were doing got in: clicking on him immediately (instantly) after the failed steal does manage to get him to open up his merchant dialog but nothing is available other than the inn. Whether or not you rent a room, when you click out of his now-limited merchant dialog, no guards appear and he does not go hostile. All for just being a fast clicker.

    If you don't immediately click on him, however, and instead pause for even a moment before clicking on him, @KeithS's fix takes over. The merchant seems to convulse like being seized by an alien mind control device (I've seen this before IRL, so I would know), after which if you click on him you only get the red "Has nothing to say to you" message. If you wait long enough (and it's fairly long) the guards will appear and INITDLG to do their spiel. If you run out of the area fast enough at that point when , however, it's like when they see you stealing from a chest but you leave the area fast enough- no guards show.
    Post edited by Bhryaen on
  • BalquoBalquo Member, Developer Posts: 2,746
    I believe SethDavis said that you should be able to rent rooms from them even if caught stealing. You just can't open their shop.
  • BhryaenBhryaen Member Posts: 2,874
    edited August 2012
    @Balquo
    Yes, but at present SethDavis' or KeithS's fixes aren't meshing properly. What needs to be hammered out definitively is a consistent encounter:

    -Guard Spawn in:
    As fast as when caught stealing from chests. They can't be bypassed by talking to the merchant right after, but it's possible to avoid them showing up by leaving the area quickly enough (as with getting caught stealing from chests).
    -Merchant lines:
    Either "Get lost!" if 1. he has no inn or 2. party hasn't left the area yet. Or, if 1. party has left and returned to the area and 2. he has an inn, he opens his merchant dialog, but only for the inn.
    -Merchant behavior:
    Consistently never going hostile, never running, but store option removed instantly and can no longer be accessed. (Throwing speaking with Charmed creatures into this adds another element... but we'll deal with that down the road...)

    At present we're getting instead:

    -Guards Spawn in:
    Very slowly after maybe 10 sec. They can be forestalled easily (and ridiculously) by insta-clicking on the merchant before he convulses in order to get his merchant options or simply repeatedly clicking on him when he's a "Has nothing to say to you" merchant while you're still in the area.
    -Merchant lines:
    If clicking fast, you get the inn. If clicking too slow, you get the mechanical "has nothing to say to you." If waiting too long he goes hostile: no lines at all.
    -Merchant behavior:
    3 different forms-
    1. He remains a blue circle if you talk to him fast enough to get his regular dialog SethDavis-style but missing all options except for inn rest. If you manage to click fast enough to get his behavior 1, you won't get his behavior 2 or 3.
    2. He remains a blue circle if you keep clicking him until you leave the area. This is his "has nothing to say to you" stage. If you leave the area fast enough (possibly by repeatedly clicking him while running away) guards aren't called and you don't get his behavior 3.
    3. He becomes a red circle if you remain in the area long enough for him to convulse a second time signalling that guards have been called. He then runs away.

    NOTES:
    I think the convulsions might actually not be aliens after all but instead be the merchant raising his fist or something to do with yelling at the thief- which is actually a nice touch, if so, maybe something to make him do repeatedly until all party members leave the area.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    DialogInterrupt(FALSE) can take the wind out of spam clicking.
    SethDavis
Sign In or Register to comment.