Jump to content

A question about editing Breakable items in PST Classic


Prrsha

Recommended Posts

I’ve been trying to mod some weapons that get destroyed upon a single successful hit (in Planescape Torment Classic).

The problem that many of the items like The Rusty Dagger have a charge value of 20 in their .itm file but break on a single use every time.  With a charge value of 20, I’d logically think it would then be able to be used as a weapon for 20 times but this is not the case… it breaks when used once.

I can’t figure out if this is hardcoded into the game or not, or could be changed.

The only thing I’ve found is some values in the EFF effects area: https://gibberlings3.github.io/iesdp/file_formats/ie_formats/eff_v1.htm#effv1_Header_0x2

There is a mention of using 0x0012 and 0x0013 effect values to activate Probability1 and Probability2 values but I am not sure if this hex value only relates to BG1 and the Iron Crisis break %.  I have doubts it will have any use in PST.

I was curious to know if it is even possible to make an item that would only work 10-20 times or so (or have a random possibility of breaking?) in classic PST.

Am I waisting my time with this?

Thank you!

Edited by Prrsha
Link to comment

The charge number in the item file isn't the only number that matters. When an item is placed in the world - in a container, in a store, on a creature created by script action - that comes with a charge number too. The number in the item file is the maximum (relevant for recharge purposes), while the number in that specific instance is what it has when you find it. You need to check that too.

Link to comment
On 11/21/2023 at 5:31 PM, jmerry said:

The charge number in the item file isn't the only number that matters. When an item is placed in the world - in a container, in a store, on a creature created by script action - that comes with a charge number too. The number in the item file is the maximum (relevant for recharge purposes), while the number in that specific instance is what it has when you find it. You need to check that too.

Ah!  That was the solution.  The quantity/charges value of the item in the container was set to 0.  I set it to 10 and now it breaks after 10 uses.  The only minor messy thing is that the item’s number of uses appear on the item combat wheel in PST (but not in the paper doll equipment screen).  I’d like the player to not quite know when the blade will break, but I guess this might be one of the limitations of PST’s unique item wheel UI.

The important part is that it works now and for that I am quite grateful!

Also Lurker’s advice into looking at the staff of striking in BG was quite insightful and it gives me some new ideas for some other item balance issues for combat in PST.

Link to comment
3 minutes ago, Prrsha said:

I’d like the player to not quite know when the blade will break, but I guess this might be one of the limitations of PST’s unique item wheel UI.

Not just PST; item charges are visible to the player somewhere in the interface in all IE games. If you want unpredictability, you need a different system - most likely, one with true randomness such as the BG1 "iron crisis" system. At least in BGEE, the way that one works is that the weapon has an on-hit effect; 1% of the time (actually, 2% due to an off-by-one bug) the weapon breaks, and the rest of the time nothing happens.

Link to comment
15 hours ago, jmerry said:

Not just PST; item charges are visible to the player somewhere in the interface in all IE games. If you want unpredictability, you need a different system - most likely, one with true randomness such as the BG1 "iron crisis" system. At least in BGEE, the way that one works is that the weapon has an on-hit effect; 1% of the time (actually, 2% due to an off-by-one bug) the weapon breaks, and the rest of the time nothing happens.

Yeah I was thinking about that initially but the hex values in IESDP’s description was a bit confusing about the 2 values it uses.  It mentions that there are two hex values, but which one is the valid entry seems vague to me (Plus raising it to a figure to around 25%-75% might not even work on PST), but I have no clue really.

My only work with that effect was trying to use it on armor in a mod for BG where metal armor lesser than full plate could crumble and “change” into an unused broken armor .itm in the game, but all I did was just copy the same values.  It turns out that only weapons had the special spell effect header that achieved that.. apparently there was much more going on with it then I initially understood.

The following is from IDESP under Feature Block:

https://gibberlings3.github.io/iesdp/file_formats/ie_formats/itm_v1.1.htm

0x0012 1 (char) Probability 1
0x0013 1 (char) Probability 2

Note: The BG1 engine treats probability as a single word, effects are applied in the range 0-probability.
Note: Other engines treat probability as two values, effects are applied in the range probability <= x <= probability.
Probability range is 0-99


I’m not sure if it means that Probability 1 and 2 are linked (or probably 1 is the first part of the % number and 2 is the second part?).  So to get 75%, Probability 1 would be 7 and Probably 2 would be 5?  Each value only allows one character.

Or is probably 1 and 2 the range like it mentions in other engines, with <= x <= (where probably 1 could be 25 and probably 2 be 75 in the above example?)

Or does probably 1 do nothing and 2 is the % value?  Gah…

Maybe I’m just really obtuse and not understanding the description properly.

I was hoping that this probably value could make items break in a random manner but I also could be looking way too far into something I don’t fully understand yet.

I also wonder if this only works in BG1.

Edited by Prrsha
Link to comment

The way those probability fields work: roll 0-99 randomly to get a result X. If Probability 2 ≤ X ≤ Probability 1, the effect happens. Otherwise, it doesn't. So if you want an effect that happens 75% of the time, you could have P1 = 74 and P2 = 0, or P1 = 84 and P2 = 10, or P1 = 100 and P2 = 25, etc. Setting P1 = 7 and P2 = 5 would result in an effect that happened 3% of the time. Note also that the same roll is used for all effects that happen at the exact same time as part of a spell or ability; that lets "one of these things at random" effects like the Sphere of Chaos spell work.

Most effects in the games don't have any randomness to them, and use values of 0 and 100 for the two probability fields. And then, for quite a few of the effects that do have randomness, the designers apparently thought it was rolling 1-100 and got things off by one. Oops.

The BG1 (EE) breakable weapons system, in more detail:

- Each breakable weapon has an associated spell. That spell removes the weapon and creates the "broken weapon" item.

- Each breakable weapon has, as part of its attack ability, an effect that casts that spell. Probability 1 = 1, Probability 2 = 0: a 2% chance.

This is absolutely something that could be made to work in any game.

That note about the BG1 engine ... original BG1 did things differently, ignoring the "Probability 2" field and treating it as always being zero. You're not playing that game or using that engine, so you can ignore that note and just look at the standard version of how the probabilities work.

Link to comment
1 hour ago, jmerry said:

The way those probability fields work: roll 0-99 randomly to get a result X. If Probability 2 ≤ X ≤ Probability 1, the effect happens. Otherwise, it doesn't. So if you want an effect that happens 75% of the time, you could have P1 = 74 and P2 = 0, or P1 = 84 and P2 = 10, or P1 = 100 and P2 = 25, etc. Setting P1 = 7 and P2 = 5 would result in an effect that happened 3% of the time. Note also that the same roll is used for all effects that happen at the exact same time as part of a spell or ability; that lets "one of these things at random" effects like the Sphere of Chaos spell work.

Most effects in the games don't have any randomness to them, and use values of 0 and 100 for the two probability fields. And then, for quite a few of the effects that do have randomness, the designers apparently thought it was rolling 1-100 and got things off by one. Oops.

The BG1 (EE) breakable weapons system, in more detail:

- Each breakable weapon has an associated spell. That spell removes the weapon and creates the "broken weapon" item.

- Each breakable weapon has, as part of its attack ability, an effect that casts that spell. Probability 1 = 1, Probability 2 = 0: a 2% chance.

This is absolutely something that could be made to work in any game.

That note about the BG1 engine ... original BG1 did things differently, ignoring the "Probability 2" field and treating it as always being zero. You're not playing that game or using that engine, so you can ignore that note and just look at the standard version of how the probabilities work.

Wow!  That opens up tons of possibilities to so many things I’ve never considered with items and spells!  This could be used to make some very interesting chaos mage items in BG2.  At the very least it could add some spice to overpowered artifacts that could have some very nasty random consequences when using them.  >:3

Thanks so much… now to see if there is a spell effect like in PST that will replace an item like in BG1.  If not I guess a custom effect could be made in theory that just makes the item disappear.  I’ll have to browse IDESP more and look maybe some similar mods for ideas.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...