Adding permanent points to Char Stats via Cubemain.txt

Post here about all aspects of D2 mod making whether it's information, problems or whatever. Please specify whether your post is relating to Classic D2 or the Expansion.

Moderator: Nizari

Post Reply
strafano
Posts: 92
Joined: Mon Feb 19, 2018 12:43 am
Italy

Adding permanent points to Char Stats via Cubemain.txt

Post by strafano » Tue Mar 14, 2023 11:13 pm

Hello,
I read here viewtopic.php?f=4&t=27474
that it should be possible to add points to a saved char stat via cubing. However, it is not clear how this can be accomplished.
I have created a new stat in itemstatcost.txt as explained by SVR (viewtopic.php?t=19942&highlight=Saving+User)and I have compiled the OP columns in cubemain.txt. But now, how to assign points to the new character stat instead that to an cube output item?

User avatar
Cypress
Moderator
Champion of the Light
Posts: 446
Joined: Fri Dec 01, 2017 2:08 am

Re: Adding permanent points to Char Stats via Cubemain.txt

Post by Cypress » Wed Mar 15, 2023 2:20 am

It's unfortunately not possible, cubemain only modifies items, not players. It seems DeClineD simply assumed that "make the recipe add 1 to the stat" was a robust and simple step along the process but never actually tested it out since he knew the other two seemingly trickier steps worked (I find that almost all problems in D2 modding are something along these lines: come up with some clean logic for a fun modded system, everything seems to check out, then when you try it you can get 99% of the way to the answer only one simple step doesn't actually work ruining everything).

If you don't mind hardcoded and 1.10f, then look into "D2Mod Cubemain Op Codes Plugin v2.11", this adds new properties which can set or increase stat values of the player (I've never used it myself, but I'm 99% sure it works since I know Battle for Elements does exactly this and has cubeops.dll as one of its plugins).

I might or might not be able to suggest a softcoded alternative depending on what exactly you are trying to do.

strafano
Posts: 92
Joined: Mon Feb 19, 2018 12:43 am
Italy

Re: Adding permanent points to Char Stats via Cubemain.txt

Post by strafano » Wed Mar 15, 2023 8:21 am

Cypress wrote:
Wed Mar 15, 2023 2:20 am
I might or might not be able to suggest a softcoded alternative depending on what exactly you are trying to do.
Thank you very much Cypress for your help.
My aim is to make a certain cube recipe not working anymore after the first use.

User avatar
Cypress
Moderator
Champion of the Light
Posts: 446
Joined: Fri Dec 01, 2017 2:08 am

Re: Adding permanent points to Char Stats via Cubemain.txt

Post by Cypress » Wed Mar 15, 2023 10:38 pm

In that case, there isn't a good softcoded fix. The best I can think of would be something like having an item required for the recipe only able to be dropped once per character, or have a monster that can only be encountered once who gives some temporary stat to the player that is needed to finish the recipe. If you are worried about a consumable produced by the cube being used multiple times, then you can prevent that by using calcs to set the bonus value to 0 on subsequent uses. And if you are afraid of the player producing too many of an equippable item, you can use passive skills which sets the player's stats to 0 if the passive skill's base level is higher than 2, i.e. (lvl-stat('item_allskills'.accr)>1)?(-10000):(0)

Post Reply

Return to “General Mod Making”