Welcome to the Builder Academy

Question MAX_SPELLS reached

More
12 Apr 2025 14:26 - 12 Apr 2025 14:27 #10657 by JTP
MAX_SPELLS reached was created by JTP
Hi

I have just made a spell 130

MAX_SPELLS is 130

from 131-220 are all the skills

MAX_SKILLS are 250


How do I now add more spells from now on ?
Last edit: 12 Apr 2025 14:27 by JTP.

Please Log in or Create an account to join the conversation.

More
13 Apr 2025 10:56 #10659 by JTP
Replied by JTP on topic MAX_SPELLS reached
.

Please Log in or Create an account to join the conversation.

More
13 Apr 2025 21:12 #10660 by thomas
Replied by thomas on topic MAX_SPELLS reached
This is a little bit difficult, because the players are save with the old values for the skills. So the process involves two steps, one of which can be done either through code or by simply searching and replacing in the save files.
You need to "bump" the saved skills in the save files - for instance, a save file might contain something like this:
Code:
Skil: 131 40 132 45 139 21 0 0
Let's say you want to put MAX_SPELLS at 10130 (for simplicitys sake), so you want to transform rows with numbers above 130 to the same with 10 added in front. This is perhaps doable by hand, depending on how many players you have, or chatgpt or similar can help to write a command line utility for it. This is of course also possible to do in the C code, but I think it would be easier with a script.

Once you've got a script for it, stop the mud, make a backup of the player files, run the script, adjust MAX_SPELLS and MAX_SKILLS (and the numbers on the actual skills in structs.h) accordingly, and reboot. Now, everyone should be able to log in with correct, higher numbers, and everything should just work.

So, it's a litte bit of work, but you can test your script on a copy of some player files, to make sure you only alter the lines that need altering.

Please Log in or Create an account to join the conversation.

More
14 Apr 2025 11:37 - 14 Apr 2025 11:39 #10661 by JTP
Replied by JTP on topic MAX_SPELLS reached
As I have been thinking of maybe doing a pwipe anyway, would that make it easier ?

If I added 10 in front of all spells and skills. Then in theory there wouldn’t be any spells from 1 to 101 ?


BUT what about all the messages for spells and skills ? They are also linked to a spell number or skill number ?
Last edit: 14 Apr 2025 11:39 by JTP.

Please Log in or Create an account to join the conversation.

More
14 Apr 2025 18:22 #10662 by ironfist
Replied by ironfist on topic MAX_SPELLS reached
The spellnum is also recorded in wands and such for values (oedit), but generally there are no skills there so I'd guess that is ok.

Please Log in or Create an account to join the conversation.

More
14 Apr 2025 20:26 #10663 by Salty
Replied by Salty on topic MAX_SPELLS reached

As I have been thinking of maybe doing a pwipe anyway, would that make it easier ?

Yes.

I defined MAX_SPELLS at 300, MAX_SONGS (for custom bard class) at 400, MAX_SKILLS at 675, TOP_SPELL_DEFINE at 699, and MAX_ATTACK_TYPES at 800 after a pwipe.

Stock spell defines remained unchanged so existing wands/potions/staves/etc were unchanged.  Skill messages in the 'messages' file needed to be adjusted to fit the new definitions.

It took maybe an hour total to do everything because pfiles didn't need to be edited due to a pwipe.

Please Log in or Create an account to join the conversation.

Time to create page: 0.624 seconds