One big script or separated in smaller ones for a spell system

Hello,

Quick question, I’m currently creating a spell system and I was wondering what was the best for the script(s) where I stock all the info of the spell and what they do.

Would it be better to make all the spells and their infos in a giant table (1 module script), or each spell gets his own module script ?

1 module script :

  • pros :

    • only 1 module script
  • cons :

    • requiring 1 spell will put in memory all of the other spells (even if they are not currently used)

divided into multiple module scripts :

  • pros :

    • requiring 1 spell will only put in the serv memory that spell
  • cons :

    • more than 1 module script

Am I missing something ? If not which would be the best ?

Thx for reading

1 Like

It would be easier to maintain a system where each spell gets its own module script, especially if there’s a lot of different spells in the game. This would be good for memory, and would allow you make quick changes to individual spells without digging through one big script. Put all spell scripts inside a folder, and calling a spell requires just a folder search, similar to accessing a dictionary.

1 Like