Jump to content

Thievery realism mod


Miloch

Recommended Posts

It would be cool, but it would involve making changes to darned near every item and anonymous NPC in the game.

Besides, in regards to pick-pocketing, I simply never do it-if it works, well woopee, most generic idiots don't have anything worth pinching anyway, (if they do they're almost invariably enemies) and if it doesn't he (and half the map usually) goes hostile, and I can't really do anything because if I kill the guy who is attacking me for no apparent reason (he doesn't yell anything like 'Thief!') in self defense I lose rep and people go hostile.

 

So... yay. But I do agree, many things like that are silly.

 

Give this a read. #183 is too true, but I believe in the case of WInthrop you're thinking of rule #14:

 

Let's not mince words: you're a thief. You can walk into just about anybody's house like the door wasn't even locked. You just barge right in and start looking for stuff. Anything you can find that's not nailed down is yours to keep. You will often walk into perfect strangers' houses, lift their precious artifacts, and then chat with them like you were old neighbors as you head back out with their family heirlooms under your arm. Unfortunately, this never works in stores.
Link to comment

Any progress here?

 

Tying up unconscious people would be neat, so I don't have to kill them eventually... I try to be nice and just knock out pickpocket victims that catch me in the act. But they wake up and cause trouble, eventually. Especially out in the open in the city, that's awkward.

Link to comment

No, no real progress... this has pretty much moved to the bottom of my priority list, since most of the other mods I'm working on have something concrete coded and this one doesn't. I thought of maybe just coding up something quick for the stuff I have done so far (mainly just the items in my sig link) and offering it as a mini-mod or fencing it to aVENGER for Rogue Rebalancing if he wants it. But maybe the quick fix isn't the solution for this mod, as my overall goal was to make things more realistic, which will take a lot of overhauling the game via scripts etc. The good news is I have at least a vague idea of how to go about doing that now, as opposed to when I first started posting about this. And who knows, maybe RR already does some of it in some ways (but probably not all). I haven't really looked into that mod in detail as yet (it was sort of "dormant" when I first started this topic, and there wasn't a Tutu version).

Link to comment

I'd been thinking about the idea of knocking someone out and looting them/stripping their armor.

 

AFAIK, it would require some sort of dialog triggered on unconscious () or something, giving the PC the option of stripping them while unconscious, which would then do a GivePartyAllItems()

 

difficulties:

- you cannot converse with a hostile - so you can't have it work the other way 'round

 

Simplicity:

- every script to use the same "rob me" dialog, since it's possible to have any dialog file started by any script.

 

-----------------

 

Stealing stuff from people's houses... couldn't you tag every item in a locked chest in a home as "stolen"? Then, it couldn't be sold, except to a fence. Perhaps, though, it might be more appropriate to just do it for rare items, since no one's necessarily going to recognize a common dagger, or the exact healing potion of gem.

Yep, each item in a container has a "flags" word, one bit of which is "Stolen"

 

------------------

 

I think the "some has seen you" is done by having a trap on the chest which is undetectable - let me check - the "someone has noticed you" text is used by ACT01 through ACT13 scripts... _ACT01 through _ACT12 in tutu... hrm; istrapped is yes trap detection and removal are 100. The different scripts are for different guards that get summoned.

 

So, that could easily be changed to a more complex script... though right now they have a See([NOTGOOD]) already. Personally, I'd rather have the LastSeenBy() ActionOverrided to say "Stop Thief! Guards!" Oddly, I think he family pets would trigger this script at the moment - so likely it should be changed to check somehow that it is a humanoid seeing you steal.

Link to comment
I thought of maybe just coding up something quick for the stuff I have done so far (mainly just the items in my sig link) and offering it as a mini-mod or fencing it to aVENGER for Rogue Rebalancing if he wants it. But maybe the quick fix isn't the solution for this mod, as my overall goal was to make things more realistic, which will take a lot of overhauling the game via scripts etc. The good news is I have at least a vague idea of how to go about doing that now, as opposed to when I first started posting about this. And who knows, maybe RR already does some of it in some ways (but probably not all).

 

Well, I currently have a Revised Thievery component in RR, but that's more of an exploit fix than an all encompassing revision of the thieving system. :) FYI, I'm also planning to add the PnP versions of the thievery potions as of RR v3.9.

 

The problem is, many things regarding thievery are hardcoded in the BG2 version of the IE. For example, once an item is flagged as "stolen" the flag persists forever and can not be cleared in any way. Furthermore, it's impossible to introduce varying difficulty percentages for stealing larger items (such as a Full Plate Mail) and smaller items (such as a dagger). Realistically, trying to steal a large item (from a store) should have a huge penalty to the skill check, and pickpocketing a person for anything larger than a dagger should be extremely difficult, if not impossible. Sadly, there is no way to reflect that within the game.

 

So, that could easily be changed to a more complex script... though right now they have a See([NOTGOOD]) already. Personally, I'd rather have the LastSeenBy() ActionOverrided to say "Stop Thief! Guards!" Oddly, I think he family pets would trigger this script at the moment - so likely it should be changed to check somehow that it is a humanoid seeing you steal.

 

I had plans to fix that part, along with introducing a dialogue option to talk your way out of a failed stealing attempt which would require an Intelligence/Charisma check. It might make it into the next revision of RR, although it's not very high on my priority list ATM.

Link to comment

I was just thinking when I saw this...seeing as my BG2CPM is copying a lot of creatures to the override...it'd be possible and not too much work to add random treasure to them.

 

Perhaps using one of the treasure tables 2da's (if it doesn't contain super items in it). Or perhaps some kind of random assignment of treasure based on a variable in the tp2.

 

In case anyone was wondering..random treasure for pickpocket purposes....maybe a few mousetraps for light fingers while we're at it.

Link to comment
- you cannot converse with a hostile - so you can't have it work the other way 'round
Couldn't you script it so they turn non-hostile when they become unconscious, and become hostile again when they wake up?
Yep, each item in a container has a "flags" word, one bit of which is "Stolen"
It's a possibility. But if we tagged, say, a dagger +1 in a private citizen's lockbox as "stolen," wouldn't that make all daggers +1 stolen, unless we copied the items to new ones? Still a possibility though, even if that's true.

 

As to aVENGER's comment about "once an item is marked as stolen, it's always stolen," this is fine IMO. I see it as sort of the equivalent of carving one's initials, mark or coat-of-arms on an item (a common practice even in medieval times) so that anyone who has a clue can identify it as stolen.

 

On the other hand, this gives me another idea. There could be a new type of shop, like a fence who performs a specialty service of removing such marks by exchanging the "stolen" items for equivalent items without that flag - for a price.

Personally, I'd rather have the LastSeenBy() ActionOverrided to say "Stop Thief! Guards!" Oddly, I think he family pets would trigger this script at the moment - so likely it should be changed to check somehow that it is a humanoid seeing you steal.
Certainly there is room for improvement in these scripts - this is something I see as high-priority, even if aVENGER doesn't.
In case anyone was wondering..random treasure for pickpocket purposes....maybe a few mousetraps for light fingers while we're at it.
igi's iiItems (and probably other mods) already disburse random treasure to various humanoids. But the idea of "mousetraps" is a good one. It's not that there isn't sufficient treasure in the game for easy pinching - there's plenty. But there aren't enough penalties and challenges, and you'd think with all the thieves running amok in Faerun, people are going to safeguard their valuables a little better.
Link to comment

After doing some research, I noticed that the problem of pets summoning guards is pretty much non-existent in BG2 and already fixed in BGT. However, TuTu still seems to suffer from it since TuTu scripts use See([NOTGOOD]) instead of See([NEUTRAL.HUMANOID]).

 

I've added a quick fix for this to RR v3.9 (locally) but I think it might also be a good idea to include this into the BG1 Fixpack. For the RR code, I also added several state checks to ensure that sleeping and otherwise incapacitated characters don't summon guards:

 

// TuTu compatibility for anti-stealing script changes

ACTION_IF FILE_EXISTS_IN_GAME ~_sw1h01.itm~ THEN BEGIN					   // TuTu check
COPY_EXISTING ~_SLEEPDW.CRE~ ~override~  // Sleeping Dwarf
 WRITE_ASCII_TERMINATE 0x280 ~SLEEPDW~  // assign a death variable (the creature had none in the unmodded game)
 BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~_SLEEPFH.CRE~ ~override~  // Sleeping Woman
 WRITE_ASCII_TERMINATE 0x280 ~SLEEPFH~  // assign a death variable (the creature had none in the unmodded game)
 BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~_SLEEPMH.CRE~ ~override~  // Sleeping Man
 WRITE_ASCII_TERMINATE 0x280 ~SLEEPMH~  // assign a death variable (the creature had none in the unmodded game)
 BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~_SLEEPEL.CRE~ ~override~  // Sleeping Elf
 WRITE_ASCII_TERMINATE 0x280 ~SLEEPEL~  // assign a death variable (the creature had none in the unmodded game)
 BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~_ACT01.BCS~  ~override~ // container alarm script
		  ~_ACT02.BCS~  ~override~ 
		  ~_ACT03.BCS~  ~override~ 
		  ~_ACT04.BCS~  ~override~ 
		  ~_ACT05.BCS~  ~override~ 
		  ~_ACT06.BCS~  ~override~ 
		  ~_ACT08.BCS~  ~override~ 
		  ~_ACT10.BCS~  ~override~ 
		  ~_ACT11.BCS~  ~override~ 
		  ~_ACT12.BCS~  ~override~ 
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY EXACT_MATCH ~See([NOTGOOD])~ ~See([NEUTRAL.HUMANOID])
!Name("SLEEPDW",LastSeenBy(Myself)) // Sleeping Dwarf
!Name("SLEEPEL",LastSeenBy(Myself)) // Sleeping Elf
!Name("SLEEPFH",LastSeenBy(Myself)) // Sleeping Woman
!Name("SLEEPMH",LastSeenBy(Myself)) // Sleeping Man
!StateCheck(LastSeenBy(Myself),STATE_SLEEPING)
!StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
!StateCheck(LastSeenBy(Myself),STATE_STUNNED)
!StateCheck(LastSeenBy(Myself),STATE_BLIND)
!StateCheck(LastSeenBy(Myself),STATE_CHARMED)
!StateCheck(LastSeenBy(Myself),STATE_DEAD)
!StateCheck(LastSeenBy(Myself),STATE_FEEBLEMINDED)~
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES
END

 

BTW, Miloch, feel free to nick this code for the BG1 Fixpack if you like. :)

Link to comment
BTW, Miloch, feel free to nick this code for the BG1 Fixpack if you like. :)
Cheers, I'll let plainab know, since he was already working on something else in the guard summoning scripts. (BTW, if you don't have Fixroom access and want it, even just for occasional browsing, all you have to do is ask CamDawg. :))
Link to comment

hm.

First: it would be better to give the Sleeping .CRE files the sleeping state, that is offset 0x20 should be 0x00000001 (STATE_SLEEPING) which, of course, only makes sense.

 

Second: I did some testing. A Trap script like this becomes active, and the Opened() is valid from the time of opening. Then, if the other conditions Become true, it triggers, thus the delayed action I have sometimes seen, when the trap can finally see the target.

 

This Trigger block:

 
See([NUETRAL.HUMANOID])
!StateCheck(LastSeenBy(Myself),STATE_SLEEPING)
!StateCheck(LastSeenBy(Myself),STATE_HELPLESS)
!StateCheck(LastSeenBy(Myself),STATE_STUNNED)
!StateCheck(LastSeenBy(Myself),STATE_BLIND)
!StateCheck(LastSeenBy(Myself),STATE_CHARMED)
!StateCheck(LastSeenBy(Myself),STATE_DEAD)
!StateCheck(LastSeenBy(Myself),STATE_FEEBLEMINDED)

Will not trigger if the nearest is incapacitated but further away are not.

 

So, using the fact that state is a bit field... 0x143FE9 (Feeblemind, Blind, Silenced, Charmed, any Dead, Helpless, Stunned or sleeping)

and doing the same check for the 10 nearest...

(and using NOTGOOD since EA is a minimum)

 

Let me go off and do some testing. Really should hack a chest t have a resetting _ACT trap...

Link to comment

Bleh, I don't like it, but...

 

IF
Opened([ANYONE])
StateCheck(LastTrigger,STATE_NOT_VISIBLE)
THEN
RESPONSE #100
	DisplayStringHead(LastTrigger,396) // Invisible
END

IF
Opened([ANYONE])
THEN
RESPONSE #100
	DisplayStringHead(LastTrigger,1082) // Thief
	Continue()
END

IF
Opened([ANYONE])
See([NOTGOOD.HUMANOID])
!StateCheck(LastSeenBy(Myself),STATE_SLEEPING | STATE_STUNNED | STATE_HELPLESS | STATE_FROZEN_DEATH | STATE_STONE_DEATH | STATE_EXPLODING_DEATH | STATE_FLAME_DEATH | STATE_ACID_DEATH | STATE_DEAD | STATE_SILENCED | STATE_CHARMED | STATE_BLIND | STATE_FEEBLEMINDED)
THEN
RESPONSE #100
	DisplayStringHead(LastSeenBy(Myself),3001) // I do not believe it!  Sound a warning!  'Tis as father predicted; a thief in our midst!
	SetGlobal("Alarming","LOCALS",1)
	Wait(3)
	CreateCreature("_WATCHN",[-1.-1],0) // Watcher
END

IF
Opened([ANYONE])
See(SecondNearest([NOTGOOD.HUMANOID]))
!StateCheck(LastSeenBy(Myself),STATE_SLEEPING | STATE_STUNNED | STATE_HELPLESS | STATE_FROZEN_DEATH | STATE_STONE_DEATH | STATE_EXPLODING_DEATH | STATE_FLAME_DEATH | STATE_ACID_DEATH | STATE_DEAD | STATE_SILENCED | STATE_CHARMED | STATE_BLIND | STATE_FEEBLEMINDED)
THEN
RESPONSE #100
	DisplayStringHead(LastSeenBy(Myself),3001) // I do not believe it!  Sound a warning!  'Tis as father predicted; a thief in our midst!
	SetGlobal("Alarming","LOCALS",1)
	Wait(3)
	CreateCreature("_WATCHN",[-1.-1],0) // Watcher
END

IF
Opened([ANYONE])
See(ThirdNearest([NOTGOOD.HUMANOID]))
!StateCheck(LastSeenBy(Myself),STATE_SLEEPING | STATE_STUNNED | STATE_HELPLESS | STATE_FROZEN_DEATH | STATE_STONE_DEATH | STATE_EXPLODING_DEATH | STATE_FLAME_DEATH | STATE_ACID_DEATH | STATE_DEAD | STATE_SILENCED | STATE_CHARMED | STATE_BLIND | STATE_FEEBLEMINDED)
THEN
RESPONSE #100
	DisplayStringHead(LastSeenBy(Myself),3001) // I do not believe it!  Sound a warning!  'Tis as father predicted; a thief in our midst!
	SetGlobal("Alarming","LOCALS",1)
	Wait(3)
	CreateCreature("_WATCHN",[-1.-1],0) // Watcher
END

IF
Opened([ANYONE])
See(FourthNearest([NOTGOOD.HUMANOID]))
!StateCheck(LastSeenBy(Myself),STATE_SLEEPING | STATE_STUNNED | STATE_HELPLESS | STATE_FROZEN_DEATH | STATE_STONE_DEATH | STATE_EXPLODING_DEATH | STATE_FLAME_DEATH | STATE_ACID_DEATH | STATE_DEAD | STATE_SILENCED | STATE_CHARMED | STATE_BLIND | STATE_FEEBLEMINDED)
THEN
RESPONSE #100
	DisplayStringHead(LastSeenBy(Myself),3001) // I do not believe it!  Sound a warning!  'Tis as father predicted; a thief in our midst!
	SetGlobal("Alarming","LOCALS",1)
	Wait(3)
	CreateCreature("_WATCHN",[-1.-1],0) // Watcher
END

IF
Opened([ANYONE])
See(FifthNearest([NOTGOOD.HUMANOID]))
!StateCheck(LastSeenBy(Myself),STATE_SLEEPING | STATE_STUNNED | STATE_HELPLESS | STATE_FROZEN_DEATH | STATE_STONE_DEATH | STATE_EXPLODING_DEATH | STATE_FLAME_DEATH | STATE_ACID_DEATH | STATE_DEAD | STATE_SILENCED | STATE_CHARMED | STATE_BLIND | STATE_FEEBLEMINDED)
THEN
RESPONSE #100
	DisplayStringHead(LastSeenBy(Myself),3001) // I do not believe it!  Sound a warning!  'Tis as father predicted; a thief in our midst!
	SetGlobal("Alarming","LOCALS",1)
	Wait(3)
	CreateCreature("_WATCHN",[-1.-1],0) // Watcher
END

IF
Opened([ANYONE])
See(SixthNearest([NOTGOOD.HUMANOID]))
!StateCheck(LastSeenBy(Myself),STATE_SLEEPING | STATE_STUNNED | STATE_HELPLESS | STATE_FROZEN_DEATH | STATE_STONE_DEATH | STATE_EXPLODING_DEATH | STATE_FLAME_DEATH | STATE_ACID_DEATH | STATE_DEAD | STATE_SILENCED | STATE_CHARMED | STATE_BLIND | STATE_FEEBLEMINDED)
THEN
RESPONSE #100
	DisplayStringHead(LastSeenBy(Myself),3001) // I do not believe it!  Sound a warning!  'Tis as father predicted; a thief in our midst!
	SetGlobal("Alarming","LOCALS",1)
	Wait(3)
	CreateCreature("_WATCHN",[-1.-1],0) // Watcher
END

IF
Opened([ANYONE])
See(SeventhNearest([NOTGOOD.HUMANOID]))
!StateCheck(LastSeenBy(Myself),STATE_SLEEPING | STATE_STUNNED | STATE_HELPLESS | STATE_FROZEN_DEATH | STATE_STONE_DEATH | STATE_EXPLODING_DEATH | STATE_FLAME_DEATH | STATE_ACID_DEATH | STATE_DEAD | STATE_SILENCED | STATE_CHARMED | STATE_BLIND | STATE_FEEBLEMINDED)
THEN
RESPONSE #100
	DisplayStringHead(LastSeenBy(Myself),3001) // I do not believe it!  Sound a warning!  'Tis as father predicted; a thief in our midst!
	SetGlobal("Alarming","LOCALS",1)
	Wait(3)
	CreateCreature("_WATCHN",[-1.-1],0) // Watcher
END

IF
Opened([ANYONE])
See(EighthNearest([NOTGOOD.HUMANOID]))
!StateCheck(LastSeenBy(Myself),STATE_SLEEPING | STATE_STUNNED | STATE_HELPLESS | STATE_FROZEN_DEATH | STATE_STONE_DEATH | STATE_EXPLODING_DEATH | STATE_FLAME_DEATH | STATE_ACID_DEATH | STATE_DEAD | STATE_SILENCED | STATE_CHARMED | STATE_BLIND | STATE_FEEBLEMINDED)
THEN
RESPONSE #100
	DisplayStringHead(LastSeenBy(Myself),3001) // I do not believe it!  Sound a warning!  'Tis as father predicted; a thief in our midst!
	SetGlobal("Alarming","LOCALS",1)
	Wait(3)
	CreateCreature("_WATCHN",[-1.-1],0) // Watcher
END

IF
Opened([ANYONE])
See(NinthNearest([NOTGOOD.HUMANOID]))
!StateCheck(LastSeenBy(Myself),STATE_SLEEPING | STATE_STUNNED | STATE_HELPLESS | STATE_FROZEN_DEATH | STATE_STONE_DEATH | STATE_EXPLODING_DEATH | STATE_FLAME_DEATH | STATE_ACID_DEATH | STATE_DEAD | STATE_SILENCED | STATE_CHARMED | STATE_BLIND | STATE_FEEBLEMINDED)
THEN
RESPONSE #100
	DisplayStringHead(LastSeenBy(Myself),3001) // I do not believe it!  Sound a warning!  'Tis as father predicted; a thief in our midst!
	SetGlobal("Alarming","LOCALS",1)
	Wait(3)
	CreateCreature("_WATCHN",[-1.-1],0) // Watcher
END

IF
Opened([ANYONE])
See(TenthNearest([NOTGOOD.HUMANOID]))
!StateCheck(LastSeenBy(Myself),STATE_SLEEPING | STATE_STUNNED | STATE_HELPLESS | STATE_FROZEN_DEATH | STATE_STONE_DEATH | STATE_EXPLODING_DEATH | STATE_FLAME_DEATH | STATE_ACID_DEATH | STATE_DEAD | STATE_SILENCED | STATE_CHARMED | STATE_BLIND | STATE_FEEBLEMINDED)
THEN
RESPONSE #100
	DisplayStringHead(LastSeenBy(Myself),17590) // THIEF AGGRESSIVE:
	SetGlobal("Alarming","LOCALS",1)
	Wait(3)
	CreateCreature("_WATCHN",[-1.-1],0) // Watcher
END

 

I don't like it because it means dupping the action for 10 blocks. Which means it becomes High Weidu Magic instead of a simple thing.

 

Not impossible, but more than I'm up to.

 

The DisplayStringHead stuff could all be left out, or set to more appropriate values.

 

A Virtue mod would put stuff in where I display the "Thief" string to take account of the immoral action.

Link to comment
hm.

First: it would be better to give the Sleeping .CRE files the sleeping state, that is offset 0x20 should be 0x00000001 (STATE_SLEEPING) which, of course, only makes sense.

 

I suppose that could be done as well, though I'd still assign proper death variables to the creatures for different reasons.

 

This Trigger block <snip> will not trigger if the nearest is incapacitated but further away are not.

 

Good point, code revised to include six possible targets:

 

// TuTu compatibility for anti-stealing script changes

ACTION_IF FILE_EXISTS_IN_GAME ~_sw1h01.itm~ THEN BEGIN					   // TuTu check
COPY_EXISTING ~_SLEEPDW.CRE~ ~override~  // Sleeping Dwarf
 WRITE_ASCII_TERMINATE 0x280 ~SLEEPDW~  // assign a death variable (the creature had none in the unmodded game)
 BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~_SLEEPFH.CRE~ ~override~  // Sleeping Woman
 WRITE_ASCII_TERMINATE 0x280 ~SLEEPFH~  // assign a death variable (the creature had none in the unmodded game)
 BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~_SLEEPMH.CRE~ ~override~  // Sleeping Man
 WRITE_ASCII_TERMINATE 0x280 ~SLEEPMH~  // assign a death variable (the creature had none in the unmodded game)
 BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~_SLEEPEL.CRE~ ~override~  // Sleeping Elf
 WRITE_ASCII_TERMINATE 0x280 ~SLEEPEL~  // assign a death variable (the creature had none in the unmodded game)
 BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~_ACT01.BCS~  ~override~ // container alarm script
		  ~_ACT02.BCS~  ~override~ 
		  ~_ACT03.BCS~  ~override~ 
		  ~_ACT04.BCS~  ~override~ 
		  ~_ACT05.BCS~  ~override~ 
		  ~_ACT06.BCS~  ~override~ 
		  ~_ACT08.BCS~  ~override~ 
		  ~_ACT10.BCS~  ~override~ 
		  ~_ACT11.BCS~  ~override~ 
		  ~_ACT12.BCS~  ~override~ 
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY EXACT_MATCH ~See([NOTGOOD])~ ~See([NEUTRAL.HUMANOID])
OR(6)
!Name("SLEEPDW",[NEUTRAL.HUMANOID]) // Sleeping Dwarf
!Name("SLEEPDW",SecondNearest([NEUTRAL.HUMANOID])) // Sleeping Dwarf
!Name("SLEEPDW",ThirdNearest([NEUTRAL.HUMANOID])) // Sleeping Dwarf
!Name("SLEEPDW",FourthNearest([NEUTRAL.HUMANOID])) // Sleeping Dwarf
!Name("SLEEPDW",FifthNearest([NEUTRAL.HUMANOID])) // Sleeping Dwarf
!Name("SLEEPDW",SixthNearest([NEUTRAL.HUMANOID])) // Sleeping Dwarf
OR(6)
!Name("SLEEPFH",[NEUTRAL.HUMANOID]) // Sleeping Woman
!Name("SLEEPFH",SecondNearest([NEUTRAL.HUMANOID])) // Sleeping Woman
!Name("SLEEPFH",ThirdNearest([NEUTRAL.HUMANOID])) // Sleeping Woman
!Name("SLEEPFH",FourthNearest([NEUTRAL.HUMANOID])) // Sleeping Woman
!Name("SLEEPFH",FifthNearest([NEUTRAL.HUMANOID])) // Sleeping Woman
!Name("SLEEPFH",SixthNearest([NEUTRAL.HUMANOID])) // Sleeping Woman
OR(6)
!Name("SLEEPMH",[NEUTRAL.HUMANOID]) // Sleeping Man
!Name("SLEEPMH",SecondNearest([NEUTRAL.HUMANOID])) // Sleeping Man
!Name("SLEEPMH",ThirdNearest([NEUTRAL.HUMANOID])) // Sleeping Man
!Name("SLEEPMH",FourthNearest([NEUTRAL.HUMANOID])) // Sleeping Man
!Name("SLEEPMH",FifthNearest([NEUTRAL.HUMANOID])) // Sleeping Man
!Name("SLEEPMH",SixthNearest([NEUTRAL.HUMANOID])) // Sleeping Man
OR(6)
!StateCheck([NEUTRAL.HUMANOID],STATE_SLEEPING)
!StateCheck(SecondNearest([NEUTRAL.HUMANOID]),STATE_SLEEPING)
!StateCheck(ThirdNearest([NEUTRAL.HUMANOID]),STATE_SLEEPING)
!StateCheck(FourthNearest([NEUTRAL.HUMANOID]),STATE_SLEEPING)
!StateCheck(FifthNearest([NEUTRAL.HUMANOID]),STATE_SLEEPING)
!StateCheck(SixthNearest([NEUTRAL.HUMANOID]),STATE_SLEEPING)
OR(6)
!StateCheck([NEUTRAL.HUMANOID],STATE_HELPLESS)
!StateCheck(SecondNearest([NEUTRAL.HUMANOID]),STATE_HELPLESS)
!StateCheck(ThirdNearest([NEUTRAL.HUMANOID]),STATE_HELPLESS)
!StateCheck(FourthNearest([NEUTRAL.HUMANOID]),STATE_HELPLESS)
!StateCheck(FifthNearest([NEUTRAL.HUMANOID]),STATE_HELPLESS)
!StateCheck(SixthNearest([NEUTRAL.HUMANOID]),STATE_HELPLESS)
OR(6)
!StateCheck([NEUTRAL.HUMANOID],STATE_STUNNED)
!StateCheck(SecondNearest([NEUTRAL.HUMANOID]),STATE_STUNNED)
!StateCheck(ThirdNearest([NEUTRAL.HUMANOID]),STATE_STUNNED)
!StateCheck(FourthNearest([NEUTRAL.HUMANOID]),STATE_STUNNED)
!StateCheck(FifthNearest([NEUTRAL.HUMANOID]),STATE_STUNNED)
!StateCheck(SixthNearest([NEUTRAL.HUMANOID]),STATE_STUNNED)
OR(6)
!StateCheck([NEUTRAL.HUMANOID],STATE_BLIND)
!StateCheck(SecondNearest([NEUTRAL.HUMANOID]),STATE_BLIND)
!StateCheck(ThirdNearest([NEUTRAL.HUMANOID]),STATE_BLIND)
!StateCheck(FourthNearest([NEUTRAL.HUMANOID]),STATE_BLIND)
!StateCheck(FifthNearest([NEUTRAL.HUMANOID]),STATE_BLIND)
!StateCheck(SixthNearest([NEUTRAL.HUMANOID]),STATE_BLIND)
OR(6)
!StateCheck([NEUTRAL.HUMANOID],STATE_FEEBLEMINDED)
!StateCheck(SecondNearest([NEUTRAL.HUMANOID]),STATE_FEEBLEMINDED)
!StateCheck(ThirdNearest([NEUTRAL.HUMANOID]),STATE_FEEBLEMINDED)
!StateCheck(FourthNearest([NEUTRAL.HUMANOID]),STATE_FEEBLEMINDED)
!StateCheck(FifthNearest([NEUTRAL.HUMANOID]),STATE_FEEBLEMINDED)
!StateCheck(SixthNearest([NEUTRAL.HUMANOID]),STATE_FEEBLEMINDED)~
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES
END

 

BTW, I dropped STATE_CHARMED and STATE_DEAD as they seemed to be superfluous and unnecessarily lengthened the script.

Link to comment

Avenger: all the StateCheck stuff for a single actor can be combined, either with STATE | STATE as decompiled, or an int which is the bitmap.

 

Charmed shouldn't be in there, anyway, now that I think of it, since anything that is STATE_CHARMED and NOTGOOD is going to be an ally of your who got charmed, and thus should alert the guards if you do something like open a chest in someone's home.

 

Making the Sleeping Actors actually have STATE_SLEEPING simplifies things here, because then you don't need to check for their prescence... just check for STATE_SLEEPING, along with everything else.

 

But I do like the idea of a big nasty single trigger block. Though an OR is needed, since we're checking to make sure the state isn't there for at least one of the targets.

 

So...

See([NOTGOOD.HUMANOID])
OR(10)
!StateCheck(LastSeenBy(Myself),1327081)
!StateCheck(SecondNearest([NOTGOOD.HUMANOID]),1327081)
!StateCheck(ThirdNearest([NOTGOOD.HUMANOID]),1327081)
!StateCheck(FourthNearest([NOTGOOD.HUMANOID]),1327081)
!StateCheck(FifthNearest([NOTGOOD.HUMANOID]),1327081)
!StateCheck(SixthNearest([NOTGOOD.HUMANOID]),1327081)
!StateCheck(SeventhNearest([NOTGOOD.HUMANOID]),1327081)
!StateCheck(EighthNearest([NOTGOOD.HUMANOID]),1327081)
!StateCheck(NinthNearest([NOTGOOD.HUMANOID]),1327081)
!StateCheck(TenthNearest([NOTGOOD.HUMANOID]),1327081)

 

This might be slightly buggy is the closest is in LOS, but disabled, and there is a non-disabled [NOTGOOD.HUMANOID] out of LOS. Arcana of Nearest Trigger...

Link to comment
But I do like the idea of a big nasty single trigger block. Though an OR is needed, since we're checking to make sure the state isn't there for at least one of the targets.
OR doesn't work in BG1 sadly, if we're going to be using any of this for the Fixpack. Is there a way to reverse the logic to produce to produce "false conditions" (or in this case, true) and enable an AND instead, the way Sim describes in his scripting guide?
Link to comment
But I do like the idea of a big nasty single trigger block. Though an OR is needed, since we're checking to make sure the state isn't there for at least one of the targets.

 

Right on, code edited to include ORs. :)

 

My code should now work fine in TuTu, but as Miloch pointed out BG1 has no ORs so an alternative solution has to be implemented there.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...