Jump to content

Thievery realism mod


Miloch

Recommended Posts

In hindsight, flagging sleeping characters as STATE_SLEEPING is indeed better than checking their death variables. During in-game testing, I noticed that, for some reason, the script would occasionally bog down and return a false positive when I used death variables, but it worked flawlessly when I limited it to mere state checks. I'm also going to use NOTGOOD.HUMANOID as WizWom suggested because that will catch hostile characters as well. So, here's the final TuTu code from RR:

 

// 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
		  ~_SLEEPFH.CRE~  ~override~  // Sleeping Woman
		  ~_SLEEPMH.CRE~ ~override~  // Sleeping Man
		  ~_SLEEPEL.CRE~  ~override~  // Sleeping Elf
		  ~_LEEPFAT.CRE~  ~override~  // Sleeping Man
		  ~_LEEPHAL.CRE~  ~override~  // Sleeping Halfling
 WRITE_LONG 0x20 ~1~  // add the STATE_SLEEPING flag
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([NOTGOOD.HUMANOID])
OR(10)
!StateCheck([NOTGOOD.HUMANOID],1318889) // sleeping, stunned, helpless, all death states, silenced, blind, feebleminded
!StateCheck(SecondNearest([NOTGOOD.HUMANOID]),1318889)
!StateCheck(ThirdNearest([NOTGOOD.HUMANOID]),1318889)
!StateCheck(FourthNearest([NOTGOOD.HUMANOID]),1318889)
!StateCheck(FifthNearest([NOTGOOD.HUMANOID]),1318889)
!StateCheck(SixthNearest([NOTGOOD.HUMANOID]),1318889)
!StateCheck(SeventhNearest([NOTGOOD.HUMANOID]),1318889)
!StateCheck(EighthNearest([NOTGOOD.HUMANOID]),1318889)
!StateCheck(NinthNearest([NOTGOOD.HUMANOID]),1318889)
!StateCheck(TenthNearest([NOTGOOD.HUMANOID]),1318889)~
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES
END

 

BTW, although using NOTGOOD.HUMANOID is better overall, it could lead to an occasional oddity. For example, if a hostile humanoid character (i.e. a Kobold) follows you into an empty house which you've previously robbed, he will trigger the alarm and the guards will be summoned. :) This should be a fairly rare case though.

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.

I find letting the hostile follow you into a room you don't need to go into again, beating them unconscious, then leaving works. They won't follow because combat has been broken.

 

I was looking at Virtue mod, for figuring out where we'd need to place code for a "rob the unconscious person" code block. It must go in the default script, so Weidu would have to make a list of all the default scripts used for people, and modify them.

Link to comment
er, you mean OR(10), right?

 

Heh, yeah. :) Note to self: updating scripts with new content while in the process of posting will produce errors. :)

 

And there are two more sleeping .CRE files...

_LEEPFAT "Sleeping Man"

_LEEPHAL "Sleeping Halfling"

 

Thanks! I guess I missed those for TuTu because they are unused in BG2.

 

I was looking at Virtue mod, for figuring out where we'd need to place code for a "rob the unconscious person" code block. It must go in the default script, so Weidu would have to make a list of all the default scripts used for people, and modify them.

 

Perhaps this might be of help to you: Non-Lethal combat tutorial by Vlasak

Link to comment

I looked into this a bit and came up with something that might help.

First, I did a check on all containers with an ACTxx script. Then I listed the actors assigned to that area (while displaying certain info about them). I noticed that while all who were not enemy had the notgood entry for the EA field, only those who could or should call the guards had an entry of 1 in the general field.

 

So to avoid having enemy or cats and other animals call the guards add this line to your trigger after the See trigger:

 

General(LastSeenBy(Myself),1) //1 is humanoid

 

There maybe one or two exceptions where somebody was marked wrong in the general field but that's what the fixpack is for....

Link to comment

I guess that makes sense that only humanoids can call the guards. I could see maybe dogs barking loud enough to call the guards, but are there even any pet dogs in BG? Stray cats being able to call the guards is a bit much. Yes, the guards could probably hear the cats but I dunno if they'd come running after ever caterwaul in the night...

Link to comment

Possibly plainab was suggesting replacing your block with that one statement, since we can't use the OR in BG1 (he is thinking about it from a fixpack perspective). Not sure though - he'd have to clarify. But obviously we don't want ten or more scripting blocks where one would suffice, and no one responded to my question on how we would "dup" the script block effectively to avoid using the OR.

Link to comment

Remember that there is Morrow Gate mod, where exists an option of givin' bribe to guards.

 

I was also thinking about other solution for a problem of evil-gaming. Once I've edited reputation 2DA tables to make having reputation score 1 impossible - then, you can have min. 2 (but you can still do some evil quest to have it 1).

Link to comment
Remember that there is Morrow Gate mod, where exists an option of givin' bribe to guards.
Yeah, I mentioned that a year ago in this thread (geez, had it been that long?) but see what I said about it.
I was also thinking about other solution for a problem of evil-gaming. Once I've edited reputation 2DA tables to make having reputation score 1 impossible - then, you can have min. 2 (but you can still do some evil quest to have it 1).
Interesting. Of course, you would have to make some point to having a rep of 1... :)
Link to comment

Reputation of 1 makes game impossible. But if you have got 2:

- you still can play (cool!)

- there are guards who want to hurt you (cool!)

- if you aren't too cautious, you still can get reputation of 1 (by for example ending evil quest)

Link to comment
Possibly plainab was suggesting replacing your block with that one statement, since we can't use the OR in BG1 (he is thinking about it from a fixpack perspective). Not sure though - he'd have to clarify. But obviously we don't want ten or more scripting blocks where one would suffice, and no one responded to my question on how we would "dup" the script block effectively to avoid using the OR.

I was thinking from the bg1 perspective that by adding that one line in would prevent the issue on a bg1 install. As far as sleeping people, I've got no clue.

Link to comment

OK, The tutorial for replacing an OR block with NAND logic is one Black Wyrm Lair. It involves the use of temporary variables, which - since containers don't have LOCALS - creates some issues (the most esoteric being when two containers are opened simultaneously which have the same script).

 

But, basically, it involves a "fall through" logic ladder. Each "true" condition (which is the opposite of a part of the OR block) has a NoAction() block, ending script processing. So, if all the logic falls through, you know every block above failed, meaning that the OR is false.

 

But, it's 3:30 AM here, and the system with a running BG1 installation is doing a virus & malware scan, so I'll post the code tomorrow.

Link to comment

Archived

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

×
×
  • Create New...