Jump to content


Photo

Revised Thievery addition - [IMPLEMENTED]


  • Please log in to reply
53 replies to this topic

#1 aVENGER

aVENGER
  • Modder
  • 1680 posts

Posted 13 March 2009 - 08:00 AM

It has always bothered me when a merchant simply goes hostile (and often starts to attack a fully equipped, combat-ready party) after a player fails to steal an item from his store. IMO, that's fairly implausible in most cases and usually annoying to the player. Therefore, I've decided to alter this behavior within the Revised Thievery component. Basically, I want to grant the player a "second chance" which would allow him to talk his way out of this situation if his mental attributes are high enough. Here's an example:

Posted Image


As you can see, you get various dialogue options depending on your Intelligence, Wisdom, Charisma, Lore and Reputation scores. The initial requirements are fairly low (12 for either INT/WIS/CHA, 20 for Lore and 14 for Reputation) However, each merchant keeps track of how many times you've tried to talk your way of a theft, and these values exponentially rise with every further failed theft attempt. This goes up to a maximum of 3 freebee attempts after which no amount of talking will be able to convince that merchant of your "innocence". Anyway, even after all of your "second chance" attempts have been spent, the merchant won't go hostile. Instead, he will report the theft to his superiors/guards which will lower your reputation by 2 and prevent you from shopping at that merchant's store ever again. Any thoughts?

#2 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 13 March 2009 - 10:00 AM

Sounds good, albeit I never make use of the pickpocket skill, so it won't be of any difference to me.
You might also add checks for low rep, as few people would risk to anger a band of infamous never-do-wells.

BTW, I thought it was impossible to track which exactly item was stolen ('you can have you trinket back')?

Edited by GeN1e, 13 March 2009 - 10:01 AM.

Retired from modding.


#3 Daulmakan

Daulmakan

    Comfortably numb

  • Member
  • 1065 posts

Posted 13 March 2009 - 10:25 AM

:Bow:

BTW, I thought it was impossible to track which exactly item was stolen ('you can have you trinket back')?

If the item was succesfully stolen, the merchants never notice. This only applies to missed attempts (where nothing is actually taken). I presume that the 'trinket' line is merely generic.

item_pack.jpg   Drows.jpg

 


#4 aVENGER

aVENGER
  • Modder
  • 1680 posts

Posted 13 March 2009 - 10:37 AM

You might also add checks for low rep, as few people would risk to anger a band of infamous never-do-wells.


Good point. I'll add the corresponding options for characters with extra low reputation (7 and below).

If the item was succesfully stolen, the merchants never notice. This only applies to missed attempts (where nothing is actually taken). I presume that the 'trinket' line is merely generic.


Yup, those sentences are merely there for flavor. ;)

#5 -erik-

-erik-
  • Guest

Posted 13 March 2009 - 03:15 PM

Excellent idea! :)

An element of chance in there, I hope? Letting the character embarass himself further by unconvincing babbling...

Perhaps even let another charismatic party member interject and save his ass... difficult, I imagine.

#6 jon-eli

jon-eli
  • Member
  • 26 posts

Posted 13 March 2009 - 07:20 PM

This has bothered me more than anything else in BG. Period. It's kind of like when you attack Gorion in Candlekeep... what does he do? Does he consider your mental state? The fact that he may have scared the heck out of you with all this talk of "hurry, hurry, hurry, we must leave tonight!"? Nah... he just insta-kills you with a lightning bolt.

So anyway, how do you get the dialog to run? I thought the turning-hostile was hardcoded?

#7 SirLancelot

SirLancelot
  • Member
  • 356 posts

Posted 13 March 2009 - 07:52 PM

Lovely. ^_^
Where men gather, a bustle of chaos ensues. I would save them all, if I could.

#8 aVENGER

aVENGER
  • Modder
  • 1680 posts

Posted 13 March 2009 - 08:08 PM

Excellent idea! :)

An element of chance in there, I hope? Letting the character embarass himself further by unconvincing babbling...


Nope, just simple attribute checks as I'm not particularly fond of having a randomness factor in dialogues (scripts are a different matter).

Perhaps even let another charismatic party member interject and save his ass... difficult, I imagine.


That's a nice idea but I should note that it's not always Player1 who does the talking on a failed theft attempt. It's actually the party member who botched the theft (i.e. Nalia in the screenshot above) so there's not much point in adding a separate set of interjections.

Edited by aVENGER, 13 March 2009 - 08:26 PM.


#9 aVENGER

aVENGER
  • Modder
  • 1680 posts

Posted 13 March 2009 - 08:09 PM

This has bothered me more than anything else in BG.


Unfortunately, the method that I'm using only works in BG2:SoA and ToB areas at the moment. This is because the merchant reaction in those games is managed by STEALAMN.BCS, STEAL25.BCS, STEALPIR.BCS and a few other scripts which I deliberately don't touch (i.e. STEALUND.BCS the Ust Natha Drow merchants) in coordination with STOLEN.DLG. Minor patching to the scripts and dialogue files were all that was needed for this change to work. OTOH, in BG1 (and Tutu) things seem to work a bit differently - the hostile reaction seems to occur automatically there since the aforementioned scripts are not being used by the BG1 merchants. I'll see if I can work around that somehow.

So anyway, how do you get the dialog to run? I thought the turning-hostile was hardcoded.


As noted above, the hostile reaction after a failed theft attempt (from a store) does not seem to be hardcoded. However, the hostile reaction upon a failed pickpocket check (i.e. failing to pick a creature's pocket) does, and there's not much I can do about that.

#10 jon-eli

jon-eli
  • Member
  • 26 posts

Posted 13 March 2009 - 08:30 PM

This is because the merchant reaction in those games is managed by STEALAMN.BCS, STEAL25.BCS, STEALPIR.BCS [...]

Now that's something I never knew. Wow. How did I never notice that? A pat on the back for you, my friend.

#11 -erik-

-erik-
  • Guest

Posted 14 March 2009 - 01:32 PM

Excellent idea! :)

An element of chance in there, I hope? Letting the character embarass himself further by unconvincing babbling...


Nope, just simple attribute checks as I'm not particularly fond of having a randomness factor in dialogues (scripts are a different matter).


While I'm not fond of knowing that all the choices that actually come up in a situation will be successful. Kind of ruins suspense.

#12 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 14 March 2009 - 03:01 PM

I'm not fond of knowing that all the choices that actually come up in a situation will be successful. Kind of ruins suspense.


Nothing prevents the use of
+~CheckStatGT(PC,14,INT)~+ ~Calm down, I did nothing wrong.~ GOTO success
+~CheckStatLT(PC,15,INT)~+ ~Calm down, I did nothing wrong.~ GOTO failure
form.

Retired from modding.


#13 -Glabro-

-Glabro-
  • Guest

Posted 18 March 2009 - 12:52 PM

This is simply superb! I had a hard time deciding how to tackle this problem and figured out a system where if I get caught, I will lose everything I stole from the merchant (load game), and can try again one more time after I've increased my pick pockets by at least 5 after leveling up with my thief class (am playing a multiclass kensai / thief).

This component would mean no more relying on load-saving and would finally let the stealing be sensible.
Now, if only someone did that economy rehaul so the money would matter even towards the end, and you couldn't get everything fast, the game would become exponentially more interesting.

#14 aVENGER

aVENGER
  • Modder
  • 1680 posts

Posted 08 May 2009 - 11:23 AM

Unfortunately, the method that I'm using only works in BG2:SoA and ToB areas at the moment.


I've managed to resolve this.

As of the upcoming RR v4.11, the merchants in the BG1 part of the game (i.e. in BGT/Tutu) will also give the player a chance to talk his way out of a failed theft attempt. :)

#15 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 08 May 2009 - 04:27 PM

Nice. Can you implement everything else I had planned for "Thievery" while you're at it? :D

Does this work for mod creatures too? For example, we have some merchants with a StealFailed() trigger that shout for help and turn Enemy(). They also have their own dialogues of course. Would this work for them, or if not, can we pinch the code?

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#16 aVENGER

aVENGER
  • Modder
  • 1680 posts

Posted 08 May 2009 - 08:26 PM

Nice. Can you implement everything else I had planned for "Thievery" while you're at it? :D


I'll look into it. :) BTW, some of the material that's mentioned there is already implemented in RR (i.e. thievery potions are non-stackable, animals and incapacitated creatures won't summon the guards if someone is stealing nearby, some of the BG1 merchants like Black Lily are now considered as fences and will buy stolen goods, a Sap (Blackjack) can be purchased at certain stores...etc.). See here for a more detailed overview.

Does this work for mod creatures too? For example, we have some merchants with a StealFailed() trigger that shout for help and turn Enemy(). They also have their own dialogues of course. Would this work for them, or if not, can we pinch the code?


Right now, only those creatures that use one of the default in-game scripts which contain StealFailed() will be affected. Since I also use a custom dialogue file which checks for the INT/WIS/CHA/Reputation/Lore of the character who failed at the theft attempt, the other scripts wouldn't work without that anyway. However, if the creatures added by your mod already have their own custom dialogue file for failed theft attempts, feel free to borrow (and expand) the RR approach if you'd like. Otherwise, just give me the names of the appropriate scripts and I'll include them in a dedicated ACTION_IF block and patch them through RR.

#17 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 08 May 2009 - 09:35 PM

a Sap (Blackjack) can be purchased at certain stores...etc.

I did add the blackjack, lockpick and a thievery mask to a mod I'm working on (I think I offered these to you a while back and you didn't bite right away, so...). Since mine is called a blackjack and yours a sap and they're at least slightly different (though not by much), no real conflict there.

However, if the creatures added by your mod already have their own custom dialogue file for failed theft attempts, feel free to borrow (and expand) the RR approach if you'd like. Otherwise, just give me the names of the appropriate scripts and I'll include them in a dedicated ACTION_IF block and patch them through RR.

It's actually in their custom scripts, though the anti-thieving blocks are pretty similar to the default. Is the code in your latest 4.1? Can you direct me to the relevant bits for easy stealing? If it's technical, feel free to PM the info. :cheers:

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#18 aVENGER

aVENGER
  • Modder
  • 1680 posts

Posted 08 May 2009 - 10:35 PM

I did add the blackjack, lockpick and a thievery mask to a mod I'm working on (I think I offered these to you a while back and you didn't bite right away, so...). Since mine is called a blackjack and yours a sap and they're at least slightly different (though not by much), no real conflict there.


RR's Sap is loosely based on the PnP version, as described in the Arms and Equipment Guide. Basically, it's just a club which deals non-lethal (unarmed) damage. :)

It's actually in their custom scripts, though the anti-thieving blocks are pretty similar to the default. Is the code in your latest 4.1?


Most of it is, though the aforementioned part relevant for the BGT/Tutu merchants isn't there yet. Anyway, the code is not complex at all, I'm simply making the merchants fire off a custom dialogue file on a failed theft attempt. I do so by adding this block to their scripts:

IF
	StealFailed([ANYONE])
	!Allegiance(Myself,ENEMY)
THEN
	RESPONSE #100
		StartDialogOverride("RR#STLN1",LastTrigger)
END

Using the StartDialogOverride() action ensures that the merchant's default dialogue is not overwritten by my custom RR#STLN1.DLG. Instead, RR#STLN1.DLG fires off only when needed and checks the thief's stats. If they are sufficiently high, the dialogue increments a LOCALS variable by one after each failed theft attempt, otherwise the variable maxes out right away. Once the variable reaches a certain point, the merchant in question refuses to have any further dealings with the thief and lowers the party's reputation by 2. This currently occurs after 3 failed theft attempts. It should be noted that a merchant will never turn hostile and/or try to attack the thief with this approach, he will simply refuse to have any further dealings with the party. Check the RR tp2 and the corresponding files for more details.

#19 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 11 May 2009 - 06:01 AM

Check the RR tp2 and the corresponding files for more details.

Cheers, mate. I pretty much pinched this wholesale, if you don't mind :D. I made some minor changes to the dialogue so it's not exactly the same and changed the variables so there's no conflict too (not that that's too likely but just in case).

I was wondering though - does this apply also to pickpocketing or just merchant shop thefts? If not the former, is there any way to implement that? Sure, a lot of people might get violent if pickpocketed, but it's unlikely a lowly merchant with any sense would try to take on a fully armored party.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#20 Daulmakan

Daulmakan

    Comfortably numb

  • Member
  • 1065 posts

Posted 11 May 2009 - 06:31 AM

I was wondering though - does this apply also to pickpocketing or just merchant shop thefts? If not the former, is there any way to implement that? Sure, a lot of people might get violent if pickpocketed, but it's unlikely a lowly merchant with any sense would try to take on a fully armored party.


As noted above, the hostile reaction after a failed theft attempt (from a store) does not seem to be hardcoded. However, the hostile reaction upon a failed pickpocket check (i.e. failing to pick a creature's pocket) does, and there's not much I can do about that.


item_pack.jpg   Drows.jpg