collapse

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: lower player stats with python  (Read 411 times)

Offline argikt

  • Antediluvian
  • *****
  • Posts: 854
  • Reputation: +31/-0
lower player stats with python
« on: October 29, 2020, 07:19:19 pm »
HelloI would like to ask if someone knows a command or scrpit that you can use to lower some stat.I know that you can increase it using pc.BumpStat("stat",X) but this only allow raise it, dont work with negative numbers....

Offline Entenschreck

  • Methuselah
  • ****
  • Posts: 347
  • Reputation: +226/-0
Re: lower player stats with python
« Reply #1 on: October 30, 2020, 09:41:42 am »
HelloI would like to ask if someone knows a command or scrpit that you can use to lower some stat.I know that you can increase it using pc.BumpStat("stat",X) but this only allow raise it, dont work with negative numbers....

The approach depends on what exactly you're trying to do. It can be done pretty easily, but you'll need consoleutil.py for that. AFAIK, the UP doesn't use it, but it's a part of Companion Mod and we use it in Bloodlines Prelude, too. Feel free to copy it from there. Credit goes to Dheu. He wrote the code.
Consoleutil.py adds a little hack that lets you use every single console command in python. It has some weaknesses, but if you don't rely on it constantly it's a great tool.

What you can do with it is use "vstats sell xyz" to lower a stat, but in this case you'd also have to fix the player's exp afterwards.

Code: [Select]
import consoleutil.cfg
def LowerStrength():
    exp = __main__.FindPlayer().experience
    string = "vstats sell strength"
    string = string + "\n giftxp %s" % exp
    consoleutil.console(string)

This is written from memory. There might be some mistakes in it, but I think the idea comes across.
Don't forget to copy console.cfg as well.

There might even be an easier way to lower a stat, but I know for sure that this one works.


Offline argikt

  • Antediluvian
  • *****
  • Posts: 854
  • Reputation: +31/-0
Re: lower player stats with python
« Reply #2 on: October 30, 2020, 09:48:48 am »
Thanks!! I will try it

Offline Malkav

  • Antediluvian
  • *****
  • Posts: 1873
  • Reputation: +393/-13
Re: lower player stats with python
« Reply #3 on: October 30, 2020, 12:38:28 pm »
Afaik neither bumpstat() nor "vstats get" can handle negative values, so there probably is no easier way.
Co Author of Camarilla Edition Mod

 

SimplePortal 2.3.7 © 2008-2021, SimplePortal