Feature request - carrying capacity readable from character object

Bug reports and feature requests. New features can only be added to the current development version. Bug-fixes may be back-ported.

Current release: 099 / Current development: 100
Post Reply
OWHorus
Grandmaster Poster
Posts: 105
Joined: Sat Feb 04, 2006 1:24 pm
Location: Vienna, Austria

Feature request - carrying capacity readable from character object

Post by OWHorus »

Hello,

I am about to use the new adjustments to carrying capacity. There is an option to multiply the standard carrying capacity ((STR * 7)/2 + 40) in ssopt, and a mod on a character (carrying_capacity_mod).

I want to increase the carrying capacity by around 10% and maybe make a potion, which will further increase it (for a time), using the modifier.

As I tried to look where I had to change things, I found that we always calculated the carrying capacity in a script! So in every place where it is needed the carrying capacity is calculated anew, always as weight := STR * 3.5 + 40, this includes also reading the current strength of the character.

I think it would be helpful if the you could add an element into the character object, like character.current_carrying_capacity (read only).

So we could always read the resulting carrying capacity for a character, which the core needs to calculate anyway. This could be the carrying capacity with or without the mod. But as it is now, even if nothing is changed from the default all scripts who need the carrying capacity need to look at the current strength and calculate it.
Since the carrying_capacity_mod value is added _before_ the multiplier, it would be ideal if all these things are calculated as the core needs to do anyway, and reported (read only) by character.current_carrying_capacity, because most of the time we need to look if something can be picked up, or if the character cannot carry it.

As it is now, I will write a function in an include to calculate the carrying capacity and call it every time I need the value. This function will also read and use carrying_capacity_mod. But it would be much simpler if this systemwide value could be read directly.

Thank you :-)
OWHorus
OWHorus
Grandmaster Poster
Posts: 105
Joined: Sat Feb 04, 2006 1:24 pm
Location: Vienna, Austria

Followup - was this planned anyway?

Post by OWHorus »

Hello,

just saw this description for the ssopt parameter CarryingCapacityMod:

CarryingCapacityMod: * modifier for mobile max_weight

Was it planned to make this script readable? Because manipulating the mod and this parameter is shown in the status window from the client, and updated immediately, so maybe it was planned to make it readable via mobile.max_weight ?

Horus
Nando
POL Developer
Posts: 282
Joined: Wed Sep 17, 2008 6:53 pm
Contact:

Re: Feature request - carrying capacity readable from character object

Post by Nando »

It's hard to know what was the idea then. Maybe "max_weight" is just a way to give it a short name in the docs...

Nevertheless, I think it's a good feature to have. I'll see what I can do.

EDIT: It's done. I decided on calling it "carrying_capacity", because max_weight can be misleading.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Feature request - carrying capacity readable from character object

Post by Yukiko »

I'll get a new Core build release posted, probably tomorrow or Thursday (That's USA Central Time). Also I am going to attempt to do a Linux build as well. Nando explained how to set-up a proper Linux VM using "vagrant". Let's hope my soon to be 58 year old brain has the capacity to do it. :)
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: Feature request - carrying capacity readable from character object

Post by boberski »

You can download linux build from me if you want :)
Post Reply