Finished implementing the troublesome "attack people in town" set of scripts. You can attack people in towns and villages which will cause loss of popularity both in the settlement and in the eyes of the local lord.
Thanks to Slawomir of Aaarrghh, HokieBT (biggest part of the code), Swyter (combing up the code), SheriffTheRevenger (lose popularity code) and MadVader for putting up with my lack of mable language.
There are some issues that bug me still, as the fact that you can still press TAB and get out of the place just like that and that the village and/or town still allow you to enter even if your popularity is -100, but that can wait for now.