Please note that new user registrations disabled at this time.

Need some help with commands

This forum is to be used for all discussions pertaining to Troika Games' Vampire: The Masquerade - Bloodlines.
Post Reply
User avatar
Soulforged
Posts: 74
Joined: Thu Feb 24, 2005 1:21 am
Contact:

Need some help with commands

Post by Soulforged »

It's actually scripting related too. I want to know if there's any commands or functions available to:
1- Take XP points from the player character. I want to place this command on the dialogs. I know how to give players an increase in their stats through commands (pc.BumpStat ("[StatName]", "#")), but I don't know how to decrease them permanently, except for Humanity (wich is FindPlayer().HumanityAdd(-1), thuogh it doesn't work with other stats).
2- Restore all Vitae Points or at least increase the rate at wich they heal in a particular situation. I want to make an script that gets called everytime you enter your haven (any of them) and restores all your vitae points. If anyone knows at least how to increase its healing rate in a particular situation (that is, not on the system, because I know how to do that, but through an script wich runs and then breaks everytime), I could achieve the same effect.

Thanks.
"And from the flames the Soulforged, the stainless, will rise"
User avatar
Anaximander
Posts: 367
Joined: Wed Apr 27, 2005 4:47 pm
Location: The City of Sin
Contact:

Post by Anaximander »

Soulforged wrote:It's actually scripting related too. I want to know if there's any commands or functions available to:
1- Take XP points from the player character. I want to place this command on the dialogs. I know how to give players an increase in their stats through commands (pc.BumpStat ("[StatName]", "#")), but I don't know how to decrease them permanently, except for Humanity (wich is FindPlayer().HumanityAdd(-1), thuogh it doesn't work with other stats).
I spent about an hour trying to figure this one out. I don't have a solution for you, and I don't think there is one. It looks like the mechanics just aren't there. When the game awards experience to the player, it uses the AwardExperience() function. This function takes a string argument which corresponds to a name in the experiencetables.tx file found in the Vampire\vdata\system folder. How much xp is given to the player is determined by the experience tables. All values in the experience tables are positive, and trying to change them to negative doesn't work.

Alternatively, you could use a little math in tandem with the giftxp command. Giftxp sets the player's current experience to a specified ammount, overwring whatever was there previously. If the player has 10 xp and you want to reduce it by 2, giftxp 8 would do the trick. You can calculate what value to use with the giftxp command with a simple subraction.

pc = __main__.FindPlayer();
newXP = pc.experience - x
giftxp newXP

Where x is the ammount of experience you want to take away from the player. This approach doesn't work either. The giftxp command will only take 0 or a positive integer as an argument. Try to pass it anything not an integer, like a variable name, and it becomes confused. Doing this from within the console results in the player's xp being set to 0. Doing it in a script gives you a syntax error.
No matter how you try to script it, you would still end up having pass a variable to giftxp, which just doesn't work.

You might try asking this on the modding forum over at planetvampire. Those guys have a lot more experience hacking at this game than I do. Wesp, the guy who makes the unofficial patches, includes his e-mail address in the patch notes. He might know a way this can be done.
2- Restore all Vitae Points or at least increase the rate at wich they heal in a particular situation. I want to make an script that gets called everytime you enter your haven (any of them) and restores all your vitae points. If anyone knows at least how to increase its healing rate in a particular situation (that is, not on the system, because I know how to do that, but through an script wich runs and then breaks everytime), I could achieve the same effect.
I need something cleared up for this one. Do you know a console command to restore health or increase the player's regen rate? I've been trying to find one forever with no luck. If you do know one, then all you'd have to do is execute the command in a script, then attach the script to a logic_auto node in the sm_apartment_1.bsp the la_hub_1.bsp map files. You can do this by using the Map Tools tab of Turfster's .vpk extractor. Open the map file and search for "posterCheck()," a function that runs every time you enter a haven to see which posters should be up. You should find something like this:

{
"classname" "logic_auto"
"spawnflags" "0"
"OnMapLoad" ",,,0,-1,malkTalkToTV(),"
"OnMapLoad" ",,,0,-1,posterCheck(),"
"OnMapLoad" ",,,0,-1,unlockHaven(),"
"OnMapLoad" ",,,0,-1,heatherHaven(),"
"origin" "-56.3879 -37.2917 921"
}

Well, that one's actually taken from the Skyline apartments map, but it's close enough. Add another line that copies the posterCheck() line exactly, but replace posterCheck() with the script you wrote that calls the health restoring command. Then just click on "Write New Data" and you're done.

This would make your script run once every time you enter your haven. Excercise extreme caution when tampering with your map files. The slightest mistake can result in serious errors. Make a backup of the files first so you can restore them if something goes wrong. Also, you'll have to start a new game after changing anything in the map files. Maps change as you progress in the game. Items and NPCs dissappear, or new ones show up. All of this is recorded in your saved game files. Changing the maps then loading a previously saved game will result in all kinds of weird bugs.
".... for I had seen the Human face of the Vampires, and now I beheld the monstrousness of these Men..."
User avatar
Soulforged
Posts: 74
Joined: Thu Feb 24, 2005 1:21 am
Contact:

Post by Soulforged »

Anaximander wrote:I spent about an hour trying to figure this one out. I don't have a solution for you, and I don't think there is one. It looks like the mechanics just aren't there. When the game awards experience to the player, it uses the AwardExperience() function. This function takes a string argument which corresponds to a name in the experiencetables.tx file found in the Vampire\vdata\system folder. How much xp is given to the player is determined by the experience tables. All values in the experience tables are positive, and trying to change them to negative doesn't work.
I spent an hour or more too :laugh: . The simple answer could be that there's no way to performe this. I wanted to place this on a dialog because the training provided by certain characters throughout the game seems a little unrealistic. I mean, even if you've a master you should still use your experience to pay for more knowledge and abilities. Anyway, rationale aside, I think this one is impossible. I've tried asking on the forums at PlanetVampire, but so far no answer.
The function that you posted could serve in an script but I want to place it on a dialog. In dialogs it's simply a matter of printing single lined simple functions, nothing else. Bumping the XP through dialogs, or any other stat, is pretty easy in fact, you just add "pc.BumpStat("[Stat name here, taken from the stats.txt]", "[positive integer]")".
I need something cleared up for this one. Do you know a console command to restore health or increase the player's regen rate? I've been trying to find one forever with no luck.
Nope, sorry. I also tried to find one, but correct me if I'm wrong: you can list the available commands on the console and if not you can simply browse the available commands by typing letters in the command case. However I would not trust the console too much, many commands that actually function in other places (like "pc.BumpStat" for instance) do not show up or do anything on the console.
If you do know one, then all you'd have to do is execute the command in a script, then attach the script to a logic_auto node in the sm_apartment_1.bsp the la_hub_1.bsp map files. You can do this by using the Map Tools tab of Turfster's .vpk extractor. Open the map file and search for "posterCheck()," a function that runs every time you enter a haven to see which posters should be up.
Thanks that's already more helpful than you imagine.
"And from the flames the Soulforged, the stainless, will rise"
User avatar
Anaximander
Posts: 367
Joined: Wed Apr 27, 2005 4:47 pm
Location: The City of Sin
Contact:

Post by Anaximander »

The function that you posted could serve in an script but I want to place it on a dialog. In dialogs it's simply a matter of printing single lined simple functions, nothing else.
Right. What I posted was intended to go into a function of my own creation which could then be used in a dialogue. Unfortunately, as I explained, it just doesn't work. You can use vstats sell to reduce any stat, but then you end up with an excess of experience, which you can't get rid of except by manually using giftxp to correct it. I'm guessing this the same conclusion you've already reached....
Nope, sorry. I also tried to find one, but correct me if I'm wrong: you can list the available commands on the console and if not you can simply browse the available commands by typing letters in the command case. However I would not trust the console too much, many commands that actually function in other places (like "pc.BumpStat" for instance) do not show up or do anything on the console.
You are absolutely correct. You can use cmdlist to list all console commands, but a lot of useful Python functions aren't shown. pc.AddMoney(int) and stockTheFridge() are two of my favorites. I found stockTheFridge() by looking at the map files, and pc.AddMoney() in LaCroix's dialogue.
".... for I had seen the Human face of the Vampires, and now I beheld the monstrousness of these Men..."
User avatar
Soulforged
Posts: 74
Joined: Thu Feb 24, 2005 1:21 am
Contact:

Post by Soulforged »

I've found some possible ways to achieve the healing effect:
1- We can use two commands: "give item_g_eldervitaepack" and then "use item_g_eldervitaepack".
2- We can use one command: "map [insert map name here]". This transports you to a certain map wich in turn restores your health.

There's nothing else wich can be done.

Now the problem is how to script this. You can't simply put the commands on the *.py file as they're because the script will consider them to be syntax errors. I've found other functions wich are used on scripts to get similar effects:

1- __main__.GiveItem(pc, "item..."), but I don't have an equivalent function to use the given item. I can however remove it through __main__.RemoveItem(pc, "item..."), but I want to find a more prolix way to do it (i.e. without forcing the player to use the item manually).
2- __main__.ChangeMap(2.5, "[map name without spaces or underlines]", "[teleport trigger name]"). However when I try that I always get the message that the location couldn't be find, even when I copy the string exactly from another part of the same *.py file!!.

So, any thoughts...
"And from the flames the Soulforged, the stainless, will rise"
Post Reply