I’ve been toying around with editing my Mount and Blade character’s looks for some time, and found
that one of the more annoying aspects is that the code generated is not the same format as the one when you export your character.
However, after looking at the different face code strings, I did see a method to the madness, and managed to create a crappy VBS file
that makes it easy for me to go from the one in the editor screen to the one in the character file.
strInput=InputBox("Enter Full Face Code from CTRL-E on Character Screen","Facecode Converter")firstCode=GetFirstPart(strInput)lastCode=GetSecondPart(strInput)' Thanks to http://nerds-central.blogspot.com/2007/01/using-vbscript-to-paste-text-into.html' Open notepad SetWshShell=WScript.CreateObject("WScript.Shell")WshShell.Run"notepad",9' Give Notepad time to loadWScript.Sleep1000WshShell.SendKeys"// Replace the bottom of your character text file with the following 2 lines: {ENTER}"WshShell.SendKeys"face_key_1 = "&firstCode&" {ENTER}"WshShell.SendKeys"face_key_2 = "&lastCode&" {ENTER}"FunctionGetFirstPart(faceCode)' Take the first part of the face code based on substringsfirst16=Mid(faceCode,3,16)first16AsDecimal=Hex_to_Dec(first16)GetFirstPart=MyHex(first16AsDecimal)WScript.Echo"First Code "&GetFirstPartEndFunctionFunctionGetSecondPart(faceCode)' Take the first part of the face code based on substringssecondPart=Mid(faceCode,19,32)GetSecondPart=Left(secondPart,16)WScript.Echo"Second Code "&GetSecondPartEndFunctionFunctionHex_to_Dec(hex_value)Hex_to_Dec=CDbl("&h"&hex_value)EndFunctionFunctionMyHex(ByValNumber)' Thanks to http://blogs.msdn.com/b/ericlippert/archive/2004/08/30/222760.aspx for thisDimSignConstHexChars="0123456789ABCDEF"Sign=Sgn(Number)Number=Fix(Abs(CDbl(number)))IfNumber=0ThenMyHex="0"ExitFunctionEndIfWhileNumber>0MyHex=Mid(HexChars,1+(Number-16*Fix(Number/16)),1)&MyHexNumber=Fix(Number/16)WEndIfSign=-1ThenMyHex="-"&MyHexEndFunction
Ugly, as most VBScript is to me. Unfortunately, Mount and Blade only runs on Windows. I would
love it if I could stop having to use my Windows machine to play on it, but that’s a sacrifice I’m willing to make for this awesome game.