Note: FilePlanet is no longer being updated and is in the process of being archived.

Vampire: the Masquerade Bloodlines - Model Changing Script v1.4

File Info: Vampire: the Masquerade Bloodlines - Model Changing Script v1.4

Title:
Vampire: the Masquerade Bloodlines - Model Changing Script v1.4
Author:
Daniel Vernon
Created:
5/4/2005
Updated:
10/19/2010
Downloads:
 
User Rating

/5.0

Description: Vampire: the Masquerade Bloodlines - Model Changing Script v1.4

A few configuration scripts that quickly allow a character to switch models during gameplay.

Once installed, this script will allow quick changing of the player’s model skin to ANY of the 7 clans skins, and their various outfits.

Some people like the idea of playing as a particular clan, but are not satisfied with the look of the clan. Now they can quickly switch to any model they want without sacrificing clan characteristics.


(Readme.txt) Version 1.4 adds support for 200 models and is compatible with all other mods/patches.

======================================================================
Model Changer Version 1.4
By Rezzz ([email protected])
======================================================================

*Requires Version 1.2 Patch or greater
*Do not recommend usage on Computers with less than 1 Gig of RAM.

Summary: Allows you to scroll through any and all game models and use them
for your character if you wish. Model choice will not affect clan or disciplines,
however it WILL affect percieved gender.

Details: I was aggrevated by the lack of model selection in Bloodlines. Personally,
there are several clans I like playing as, but just cant stand to look at the
model all the time. I made this script so that I could change the model at
will.

Email : please include "Model Changer" or "modchg" in subject

Table of Contents:
-------------------------------------------

A. Installation
B. How to Use
C. Unocking the "Spoiler" Models
D. Editing Key Setup
E. Ease of Use
F. Known Problems
G. Version History (Scripting Notes)
H. Extra: Turning on the game Console

======================================================================
A. Installation
======================================================================

1) extract all files to your games config directory.

Typically:

C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\mc_autoexec.cfg
C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\mc_start.cfg
C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\mc_stop.cfg
C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\mc_pfd1.cfg
C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\mc_pfd2.cfg
C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\p1
C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\p2
C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\p2_spoiler
C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\p3
C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\p4
C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\p5
C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\p6
C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\p7
C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\p8
C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\p9

2) Link mc_autoexec.cfg to startup:

If there is an existing autoexec.cfg file within the cfg directory (Unofficial
Updates install their own autoexec.cfg), then you need to edit the
file and add the following line to the end of the file:

exec mc_autoexec.cfg

If there is not an autoexec.cfg in the cfgg directory, then make a
copy of mc_autoexec.cfg and rename it to autoexec.cfg.

3) Add binding to your config:

- Open/Edit your config.cfg file with notepad. Typically located at:

C:\Program Files\Activision\Vampire Bloodlines\Vampire\cfg\config.cfg

- at the bottom of the file, add the line:

bind "PAUSE" "startMV"

4) [Optional: read section E "Ease of Use" below for details]

- within the config.cfg file, Search and Replace:

"+forward"

with

"+mforward"

======================================================================
B. How to Use
======================================================================

Load a game (make sure a map is loaded). Press the NUMLOCK key. The player should switch to third person if they are not already in that position.

-------------------------------------------
Default Key Setup:

PAUSE : (Num Lock) Activate\Deactivate Model Changer
KP_UPARROW : Rotate camrea up
KP_DOWNARROW : Rotate Camera Down
KP_RIGHTARROW : Rotate Camera right
KP_LEFTARROW : Rotate Camera Left
KP_5 : Center
KP_PLUS : Zoom In
KP_MINUS : Zoom Out
KP_PGUP : Next Model (starts with Male Models)
KP_DOWNARROW : Previous Model (starts with Female Models)
MOUSE3 : Quick Model Restore (works anytime)

-------------------------------------------
Notes

Depending on where script is activated, sometimes you may have to rotate over the models head before rotate left and right will work.

All bindings are saved every time you exit the game. When you start up bloodlines, you can quickly restore your model choice by tapping MOUSE3. EVEN IF YOU SEE THE CORRECT MODEL YOU SHOULD DO THIS.

For those without MOUSE3, see "Editing Key Setup" below

======================================================================
C. Unocking the "Spoiler" Models
======================================================================
The purpose of this model Changer program was to allow someone who is unhappy
with the default clan models to choose a different model for their
character. However, this is a powerful script and I realized after some
testing that it could "spoil" the game for someone who had never finished
it.

So therefore, I removed "spoiler" models from the the standard install. However,
for those who have finished the game or simply don't care, you can "unlock"
the spoiler models by renaming p2_spoiler to p2. Specifically:

1) Rename p2 -> p2_old (In order to back it up)
2) Rename p2_spoiler -> p2

When you start up the model changer script (Num Lock), hitting the KP_PGUP key
will take you through the models stored in the pageing files, starting with
paging file "p1". After scrolling through the first 25 models (male standard
models), you will begin viewing the contents of p2, which now containes the
spoiler models. If your console is enabled, you can go strait to the spoiler
modules by opening the console and issuing the command "s26"

Word of Warning about spoiler models
------------------------------------
When you attack someone in the game, the game engine executes a sequence of
commands on your models skeleton. Models based on humans (2 arms, 2 legs, torsoe
and head) generally have no problem. However, unusual models like Bosses and Large
monsters or even decapitated corpses will generally fail to do anything.

The result is that non-human-like models are for the most part unplayable. They
can't attack or open doors or sometimes even start conversations with people.
Given the purpose of this Model Changer script, why would someone want to play
the game as a model that can't... play the game?

So some of the models in the "spoiler" module aren't just there because they are
some cool looking boss. A lot of the models are in that module because you
can't play the game as that model. In fact, it is pretty safe to say that you
can't "play" the game as any of the models in the spoiler module. It is really
just there for completeness and novelty.

======================================================================
D. Editing Key Setup
======================================================================

I had hoped to allow users to configure the key mappings from one config file. Unfortunately, Bloodlines console scripting language is not very friendly. As a result, if you wish to change the default bindings, you may have to do some search\replace.

The good news is, all but 1 of the bindings are defined in mc_start.cfg. Open this file
and rebind as you wish.

Per the installation instructions above, you need to bind the PAUSE key (numlock) so that it starts Model Changer. If you decided to reassign PAUSE in mc_start.cfg, be sure to update config.cfg as well.

Unfortunatley MOUSE3, (or Quick Restore) is embeded into the aliases. If you wish to change the quick restore functionality to something besides mouse3, your will have to search and replace all 9 of the paging files. Luckily, MOUSE3 is a unique string which shouldn't cause any global search and replace conflicts.

Example: Suppose you wanted to change the Quick Model Restore button from MOUSE3 to the letter "V" on the keyboard.

1) Open p1 with NotePad
2) Hit + h to bring up the search and replace box.
3) Enter "MOUSE3" in Find Box
4) Enter "V" in Replace Box
5) Hit "Replace ALL"
6) Repeat steps 1-5 for files: p2,p3,p4,p5,p6,p7,p8,p9 (and p2_spoilers)

======================================================================
E. Ease of Use
======================================================================

In Bloodlines, every time you change you weapon, your clans default model reloads. In my
original script, the only way to fix this was hitting the "Quick Model Restore" button.
After extensive testing, I found this to be very annoying.

With version 1.3 I included a custom forward motion alias which fixes
your model anytime you move forward. You will still see your model switch back and
forth between your custom choice the the default clan model, but by linking your
forward motion key to this new alias, you won't have to actively think about and fix
the model constantly.

See the "optional" step in the Install section. I highly recommend this step.

The downside is that moving forward ALWAYS loads the selected model. Therefore,
binding the forward motion button to my custom alias forces you to use the
model changer even if you decide you like your clans default model. This is
an option I would recommend enabling if you plan on playing through the game
with a custom model from start to finish, but not for just playing around.

======================================================================
F. Known Problems
======================================================================

1) Patch 1.2 Required. You will get a "No Precache" error if you do
not have the patch installed.

2) Z_Buff memory allocation errors : This error occurs when too many
aliases and binds defined simultaneously.

I have seen the error occure in 2 circumstances. In game, while using
the model changer script and during startup, preventing the game from
starting.

I have found one way to mitigate the error is to examine config.cfg
for any keyboard binds that you are NOT using and remove them. Each
Key mapping that you remove frees up memory for the scripts.

For example, the game allows 2 keys to be mapped to most functions, but
you really only need 1 key. In fact, many people dont even use some
functions (like turn left, right). These can be removed all together.

Additionally, the "Unofficial Update" includes addition key bindings
in the custom autoexec.cfg that you can remove if editing Config.cfg
doesnt do the trick.

NOTE: Commenting the binds out is not enough. They must be deleted.

Hopefully this does the trick for you.


======================================================================
G. Version History (Scripting Notes)
======================================================================

1.1 : Basic
----------------------------------------------------------------------
My original model changer script used the consoles "setModel" command. The problem with the
command was that it would crash the game if the model was not already loaded into memory.
There was an "sv_precachemodel" command that appeared as though it would fix the problem,
but the command was broken. No matter what random string of characters you passed it as an
arguement, it claimed the model was already in memory.

So version 1.0 only scrolled through the "standard" player models, because those were the
only safe models you could depend on being loaded into pre-cache at any given time.

1.2 : Advanced, but buggy
----------------------------------------------------------------------
In my quest for alternatives, I began looking through the python scripts included in the game
directy. THere, I saw examples of how models were changed from the python scripting environment.
While not all python commands work from the console, the OBJECTS exposed by the python script
do in fact exist and are accessible from the console. So alittle trial and error revealed
a non-documented object method which read the model into memory and displayed it without
crashing:

__main_.FindPlayer().SetModel()

However this was obviously one of the internal functions that was fixed with the 1.2 update
patch. In testing I found without the patch, this function call behaved identically to the
console setmodel and would crash if the model wasn't in precache.

For those who care, I discovered the model paths by unpacking the vtk files with vtktool. In
the original 1.1 version, there were only 56 models to scroll through. Therefore I didn't concern
myself with "remembering" the players model between loads and saves. Now there were over 200 models.
Not only was scrolling through all the models a hassle, but loading all those models into memory
made the game unstable.

As it turns out, when the game exits, all key binds are automatically saved off. So if
a key was bound in such a way that it uniquely identified the players model, I could
"remember" the model choice the next time the game started.

ex:

bind "setmodelToJeanette;changemodel"

Good in theory, but hard to implement. The problem is that the BIND command only accepts a
static KEY specification.

For example

eval("bind %s loadboss" % ( wont work

additionally, while you can define a bind within an alias, you can't assign it to more than 1
command. So if you want to perform 2 commands, you have to assign it to a pre-existing alias:

alias preexistingalias "clear;say This is a test!"
alias changebind "bind MOUSE3 preexistingalias"

In the end I had to create a complex alias for each model I wanted to display. This required the
creation of over 200 (large) aliases and (large) variables.

I had to trim all my aliases and variable definitions down. just to get the game to load without
exceeding the scripting memory. In some cases this meant scrapping the less useful models (removed
access to about 30). Even then, the game was unstable and would crash often due to "out of memory"
issues. But it worked...

1.3 : Getting Stable
----------------------------------------------------------------------
The reason why 1.2 was so buggy was because I loaded ALL the variables and aliases
at once. This chews up quite a bit of memory.

In version 1.3, I implemented paging. I create 225 "small" aliases defined over 2
paging files. These small aliases start off by loading 1 of 9 paging files and then
execute another alias within the paging file. The trick is that each paging file has
the exact same inner alias names. As a result, the game just re-uses the memory.

The 25 aliases within the paging files can be much larger. So in essence, paging allows
me to compress the data through memory re-use resulting in an overall memory consumption
of about half.

With the new design, I scrapped all 250 unique variables and instead used 15 unique
"paged" variables. Each model still has a unique alias.

The basic structure of the program is simple. I have a variable that represents the model
(named "m"). As the user activates the aliases in sequence, m is set to the value of
the next model and then a function is called to display the model. Each alias also
rebinds the NUMPAD keys to reflect the change in app state. (the funtions\models that PGUP
and PGDN link to are redefined)

Setting up the model Viewer wasn't too bad. Originally I had all the NUMPAD setup
stored in large aliases. However, as I came to grips with the alias memory limit,
I broke down the large startup alias into a standalone start config file. Eventually
decided to do the same for stop as well. That way the data isn't stored in memory and
honestly, it is easier to edit.

A major bug I ran into while testing was that I found if I exited the game while the model
viewer was active, I lost all my binds. This is because the model changer remaps all the
keys when you activate it. Originally it recovered the key setup by reloading the config
file. But since the game automatically saves all bindings to the config file when you exit,
there is a door there where you can lose all your bindings.

To patch up this bug, I now store the bindings in a swap file when the model changer
is activated. Since I bind the numlock key to reload the swap file, the worst case
scenario is that you would start the game up and the model viewer would already be
active. When you hit the NUMLOCK key to turn the model viewer off, the swap file
would be reloaded and the bindings restored. The only catch is that if you change
any game settings while the model viewer is active (gamma for example), the changes
are lost when you stop the model changer script.

1.4 : Updated for Unofficial Patch compatibility
------------------------------------------
It wasn't so much that my script had compatibility issues, but rather both my script and the unofficial update utilize the autoexec.cfg. So I yielded to the update as it is probably more popular and renamed my autoexec.cfg to mc_autoexec.cfg.

This adds an additional step to installation but prevents my script from conflicting with the update.

Additional notes:
------------------------------------------
- A single cfg file may not be more than 8048 bytes or it will flood the input buffer.
- There are other size limits and boundaries I am uncertain of. It is unknown just how much memory we have to play with for variables and aliases, but would appear to be between 32 and 64 Kb

========================================================================
H. Extra: Turning on the game Console
========================================================================

To enable the debug console, right click the startup icon and select properties. place " -console" after the path to the executable (outside the double quotes if they exist). So for example, it should something look like:

"C:\Program Files\Activision .... blah blah blah\vampire.exe" -console

Once a game has STARTED, hit the "~" key to bring up console. Now you can do some damage.




Less Information
More Information »

Related Information